|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.data.DataObject
ewe.util.Vector
A vector is an array of object references. The vector grows and shrinks dynamically as objects are added and removed.
Here is an example showing a vector being used:
... Vector vec = new Vector(); vec.add(obj1); vec.add(obj2); ... vec.insert(3, obj3); vec.del(2); if (vec.getCount() > 5) ...
| Constructor Summary | |
Vector()
Constructs an empty vector. |
|
Vector(int size)
Constructs an empty vector with a given initial size. |
|
Vector(Object[] items)
|
|
| Method Summary | |
void |
add(int index,
Object obj)
Inserts an object at the given index. |
void |
add(Object obj)
Adds an object to the end of the vector. |
static Vector |
add(Vector v,
Object toAdd)
This adds an object to the end of the Vector v. |
void |
addAll(Object[] objs)
|
void |
addAll(Object[] objs,
int start,
int length)
|
void |
addAll(Vector objs)
|
void |
addCopiesFrom(Object[] object,
int start,
int length)
|
void |
addElement(Object what)
|
void |
clear()
|
int |
compare(Object one,
Object two)
|
boolean |
contains(Object obj)
|
void |
copyCopiesFrom(Object other)
|
void |
copyFrom(Object other)
Copy all appropriate data from another object. |
void |
copyInto(Object[] array)
The destination array MUST be big enough to hold the vector. |
void |
copyInto(Object[] array,
int destPos)
The destination array MUST be big enough to hold the vector. |
void |
del(int index)
Deletes the object reference at the given index. |
Object |
elementAt(int index)
This is the same as get(). |
Enumeration |
elements()
Get an Enumeration for the elements of the vector. |
int |
find(Object obj)
Finds the index of the given object. |
Object |
find(ObjectFinder finder)
|
Object |
get(int index)
Returns the object at the given index. |
int |
getCount()
Returns the number of objects in the vector. |
Vector |
getFullCopy()
This returns a Vector that is a copy of this one, where all the items are themselves copies of the original items. |
void |
insert(int index,
Object obj)
Deprecated. Use add(index,obj) instead. |
void |
insertElementAt(Object obj,
int index)
|
boolean |
isEmpty()
|
Iterator |
iterator()
Get an Iterator for the vector. |
static Iterator |
iterator(Vector v)
This returns an iterator for the specified Vector. |
static Object |
pop(Vector v)
This removes and returns the object at the front of the Vector v. |
static Vector |
push(Vector v,
Object toPush)
This inserts an object to the front of the Vector v. |
void |
remove(Object obj)
|
void |
removeAllElements()
|
void |
removeElementAt(int index)
|
void |
set(int index,
Object obj)
Sets the object at the given index. |
void |
setElementAt(Object obj,
int index)
|
void |
setSize(int size)
|
int |
size()
|
void |
sort(Comparer comparer,
boolean descending)
|
boolean |
sort(Handle h,
Comparer comparer,
boolean descending)
|
Object[] |
toArray()
Create a new Object array and copy all the elements into it. |
Object[] |
toArray(Object[] dest)
Copy the vector into the destination array, creating a new one if the provided destination is not big enough to hold all the elements. |
Object[] |
toObjectArray()
Converts the vector to an array of objects. |
String |
toString()
Return a String representation of this object. |
void |
zero()
|
| Methods inherited from class ewe.data.DataObject |
_getSetField, appendAllFields, compareTo, copied, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode |
| Constructor Detail |
public Vector()
public Vector(int size)
public Vector(Object[] items)
| Method Detail |
public void copyFrom(Object other)
DataUnit
copyFrom in interface DataUnitcopyFrom in class DataObject
public void addCopiesFrom(Object[] object,
int start,
int length)
public void copyCopiesFrom(Object other)
public Vector getFullCopy()
public void add(Object obj)
public void insert(int index,
Object obj)
index - The index to insert the object.obj - The object to add.
public void add(int index,
Object obj)
public void del(int index)
public Object get(int index)
public void set(int index,
Object obj)
public int getCount()
public Object[] toObjectArray()
public void clear()
public Iterator iterator()
public Enumeration elements()
public int size()
public int compare(Object one,
Object two)
public int find(Object obj)
public boolean contains(Object obj)
public void remove(Object obj)
public void addAll(Object[] objs,
int start,
int length)
public void addAll(Object[] objs)
public void addAll(Vector objs)
public void copyInto(Object[] array,
int destPos)
public void copyInto(Object[] array)
public Object find(ObjectFinder finder)
public static Vector add(Vector v,
Object toAdd)
public static Vector push(Vector v,
Object toPush)
public static Object pop(Vector v)
public static Iterator iterator(Vector v)
public String toString()
Object
toString in class Objectpublic Object[] toArray(Object[] dest)
public Object[] toArray()
public Object elementAt(int index)
public void addElement(Object what)
public void setElementAt(Object obj,
int index)
public void setSize(int size)
public void removeElementAt(int index)
public void insertElementAt(Object obj,
int index)
public boolean isEmpty()
public void removeAllElements()
public boolean sort(Handle h,
Comparer comparer,
boolean descending)
public void sort(Comparer comparer,
boolean descending)
public void zero()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||