public class IntegerArray extends Object implements Comparable<Object>, Serializable
It supports hashCode(), toString(), equals(), compareTo() methods.
它支持hashCode(), toString(), equals(), compareTo()方法。
Modifier and Type | Field and Description |
---|---|
protected int[] |
values |
Constructor and Description |
---|
IntegerArray(int... values)
Constructs an IntegerArray that encapsulates specified int values.
创建一个包含这些整型值的实例。 |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object obj)
Compare.
比较。 |
boolean |
equals(Object obj) |
int |
getIntValue(int index)
Gets the value in specified position.
获得指定位置的值。 |
long |
getLongValue(int index)
Gets the value in specified position.
获得指定位置的值。 |
int |
getValue(int index)
Gets the value in specified position.
获得指定位置的值。 |
int[] |
getValues()
Gets all the values encapsulated in this object.
获得所有值。 |
int |
hashCode()
Gets the calculated hash code.
获得计算得到的hash值。 |
String |
toString() |
public IntegerArray(int... values)
values
- int values that will be encapsulated.public int[] getValues()
public int getValue(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 int getIntValue(int index)
index
- position (position of the first one is 0)public int hashCode()
public int compareTo(Object obj)
compareTo
in interface Comparable<Object>
obj
- The object to be compared withCopyright © 2014. All Rights Reserved.