|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.col.NumberArray<T>
public class NumberArray<T extends Number>
Encapsulates multiple objects of Number(such as Integer, Long, Double) into one object,
which is suitable to be used as the key object of Map.
把多个Number(比如Integer, Long, Double)类型的值封装在这一个对象里,适合用来作为Map的key。
It supports hashCode(), toString(), equals(), compareTo() methods.
它支持hashCode(), toString(), equals(), compareTo()方法。
| Field Summary | |
|---|---|
protected T[] |
values
|
| Constructor Summary | |
|---|---|
NumberArray(T... values)
Constructs a NumberArray with specified value objects. 创建一个包含这些数值对象的实例。 |
|
| Method Summary | |
|---|---|
int |
compareTo(Object obj)
Compare. 比较。 |
boolean |
equals(Object obj)
|
byte |
getByteValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
double |
getDoubleValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
float |
getFloatValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
int |
getIntValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
long |
getLongValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
short |
getShortValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
T |
getValue(int index)
Gets the value in specified position. 获得指定位置的值。 |
T[] |
getValues()
Gets all the values encapsulated in this object. 获得所有值。 |
int |
hashCode()
Gets the calculated hash code. 获得计算得到的hash值。 |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected T extends Number[] values
| Constructor Detail |
|---|
public NumberArray(T... values)
values - value objects of Number type that will be encapsulated.| Method Detail |
|---|
public T[] getValues()
public T getValue(int index)
index - position (position of the first one is 0)
public int getIntValue(int index)
index - position (position of the first one is 0)
public long getLongValue(int index)
index - position (position of the first one is 0)
public double getDoubleValue(int index)
index - position (position of the first one is 0)
public float getFloatValue(int index)
index - position (position of the first one is 0)
public short getShortValue(int index)
index - position (position of the first one is 0)
public byte getByteValue(int index)
index - position (position of the first one is 0)
public int hashCode()
hashCode in class Objectpublic int compareTo(Object obj)
compareTo in interface Comparable<Object>obj - The object to be compared with
public boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||