|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.util.igo.VecInt
A vector class for int.
Field Summary | |
private int[] |
arr
An array to store elements. |
private int |
pSize
The size to add when extending the capacity. |
private int |
sp
The count of the elements. |
Constructor Summary | |
VecInt()
Constructor. |
|
VecInt(int size)
Constructor. |
|
VecInt(int size,
int pz)
Constructor. |
Method Summary | |
int |
add(int i)
Add a element. |
int |
at(int i)
Get value from a element. |
void |
clear()
Clear all element. |
Object |
clone()
Get clone object. |
void |
del(int i)
Delete a element. |
boolean |
in(int i)
Check the index is effective or not. |
void |
set(int i,
int v)
Set value to a element. |
int |
size()
Get the count of all elements. |
int[] |
toArr()
Convert this object to a int array. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int sp
private int[] arr
private int pSize
Constructor Detail |
public VecInt()
public VecInt(int size)
size
- The size of the capacity.public VecInt(int size, int pz)
size
- The size of the capacity.pz
- The size to add when extend the capacity.Method Detail |
public int add(int i)
i
- The value of the new element.
public void del(int i)
i
- The index of the target element.public boolean in(int i)
i
- The index.
public void set(int i, int v)
i
- The index of the element.v
- The value to set to the element.public int at(int i)
i
- The index of the element.
public void clear()
public int size()
public int[] toArr()
public Object clone()
clone
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |