public class MCollection
extends java.lang.Object
BaseInstance
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
m_store |
Constructor and Description |
---|
MCollection()
Construct an empty collection instance
|
MCollection(java.util.Enumeration enumer)
Convert from java.util.Enumeration to MCollection
|
MCollection(int size)
Construct an empty collection instance with certain initial capacity
|
MCollection(MCollection collection) |
MCollection(java.lang.Object[] objs)
Convert from an object array to MCollection
|
MCollection(java.util.Vector vector)
Convert from java.util.Vector to MCollection
|
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.Object data)
Append the data to this collection
|
static void |
copyInto(MCollection collection,
java.lang.Object[] objs)
Convert from MCollection collection to an object
array objs.
|
int |
elementCount()
Return the number of items the collection
|
java.lang.Object |
getElement(int nIndex)
Return the element at nIndex.
|
java.lang.Object |
getElement(int nIndex,
java.lang.Object defaultValue)
Return the element at nIndex, returning a defaultValue
if any error occurs.
|
java.util.Enumeration |
getElements()
Return an enumeration through the elements in the collection.
|
int |
getIndexByElement(java.lang.Object data) |
void |
insertAt(int nIndex,
java.lang.Object data)
Insert the data at nIndex.
|
void |
remove(java.lang.Object data)
Remove the first occurrence of the specified data
|
void |
removeAll()
Remove all the data from the collection
|
void |
removeAt(int nIndex)
Remove the data at specified nIndex
|
void |
setElement(int nIndex,
java.lang.Object value)
Replace the object at nIndex with the new value.
|
java.lang.String |
toString() |
public MCollection(java.util.Vector vector)
public MCollection(MCollection collection)
public MCollection(java.util.Enumeration enumer)
public MCollection(java.lang.Object[] objs)
public MCollection()
public MCollection(int size)
public int elementCount()
public void append(java.lang.Object data)
public void remove(java.lang.Object data)
public void removeAt(int nIndex)
public void removeAll()
public void insertAt(int nIndex, java.lang.Object data)
public int getIndexByElement(java.lang.Object data)
public java.lang.Object getElement(int nIndex)
public java.lang.Object getElement(int nIndex, java.lang.Object defaultValue)
public void setElement(int nIndex, java.lang.Object value)
java.lang.Exception
- On any failureremoveAt
,
insertAt
public java.util.Enumeration getElements()
public static void copyInto(MCollection collection, java.lang.Object[] objs)
java.lang.Exception
- Error is "bubbled up"public java.lang.String toString()
toString
in class java.lang.Object