|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.SimpleEnumerator
public class SimpleEnumerator
Provide a generic implementation of an array enumerator.
Field Summary | |
---|---|
protected Object[] |
m_aoItem
Array of items to enumerate. |
protected boolean |
m_fForward
Iterator direction. |
protected int |
m_iItem
Iterator position: next item to return. |
protected int |
m_ofLimit
Iterator end position (beyond last). |
Constructor Summary | |
---|---|
SimpleEnumerator(Collection col)
Construct a simple enumerator based on a collection. |
|
SimpleEnumerator(Enumeration enmr)
Construct a simple enumerator based on another Enumeration. |
|
SimpleEnumerator(Iterator iter)
Construct a simple enumerator based on another Iterator. |
|
SimpleEnumerator(Object[] aoItem)
Construct the simple enumerator based on an array of objects. |
|
SimpleEnumerator(Object[] aoItem,
int ofStart,
int cItems)
Construct the simple enumerator based on an array of objects. |
|
SimpleEnumerator(Object[] aoItem,
int ofStart,
int cItems,
boolean fForward,
boolean fCopy)
Construct the simple enumerator based on an array of objects, making a copy of the array if specified. |
Method Summary | |
---|---|
boolean |
hasMoreElements()
Tests if this enumeration contains more elements. |
boolean |
hasNext()
Tests if this Iterator contains more elements. |
Object |
next()
Returns the next element of this Iterator. |
Object |
nextElement()
Returns the next element of this enumeration. |
void |
remove()
Remove the last-returned element that was returned by the Iterator. |
Object[] |
toArray()
Return the remaining contents of this SimpleEnumerator as an array. |
static Object[] |
toArray(Enumeration enmr)
Turns an enumeration into an array. |
static Object[] |
toArray(Enumeration enmr,
Object[] ao)
Turns an enumeration into an array. |
static Object[] |
toArray(Iterator iter)
Turns an Iterator into an array. |
static Object[] |
toArray(Iterator iter,
Object[] ao)
Turns an Iterator into an array. |
Object[] |
toArray(Object[] ao)
Return the remaining contents of this SimpleEnumerator as an array of the type specified by the passed array, and use that passed array to store the values if it is big enough, putting a null in the first unused element if the size of the passed array is bigger than the number of remaining elements in this enumerator, as per the contract of the Collection.toArray(Object[]) method. |
Field Detail |
---|
protected Object[] m_aoItem
protected int m_iItem
protected int m_ofLimit
protected boolean m_fForward
Constructor Detail |
---|
public SimpleEnumerator(Object[] aoItem)
aoItem
- array of objects to enumeratepublic SimpleEnumerator(Object[] aoItem, int ofStart, int cItems)
aoItem
- array of objects to enumerateofStart
- the first object positioncItems
- the number of objects to enumeratepublic SimpleEnumerator(Object[] aoItem, int ofStart, int cItems, boolean fForward, boolean fCopy)
aoItem
- array of objects to enumerateofStart
- the first object positioncItems
- the number of objects to enumeratefForward
- true to iterate forwards, false to iterate from the
end backwards to the beginningfCopy
- pass true to make a copy of the array or false if the
array's contents will not changepublic SimpleEnumerator(Enumeration enmr)
enmr
- the java.util.Enumeration to enumeratepublic SimpleEnumerator(Iterator iter)
iter
- the java.util.Iterator to enumeratepublic SimpleEnumerator(Collection col)
col
- the java.util.Collection to enumerateMethod Detail |
---|
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration
public Object nextElement()
nextElement
in interface Enumeration
public boolean hasNext()
hasNext
in interface Iterator
public Object next()
next
in interface Iterator
public void remove()
remove
in interface Iterator
public static Object[] toArray(Enumeration enmr)
enmr
- the enumerator
public static Object[] toArray(Enumeration enmr, Object[] ao)
toArray(Enumeration)
method in the same way
that the Collection.toArray(Object[])
method differs from the
Collection.toArray()
method.
enmr
- the enumeratorao
- the array into which the elements of the Enumeration are
to be stored, if it is big enough; otherwise, a new array
of the same runtime type is allocated for this purpose
public static Object[] toArray(Iterator iter)
iter
- the Iterator
public static Object[] toArray(Iterator iter, Object[] ao)
toArray(Iterator)
method in the same way that
the Collection.toArray(Object[])
method differs from the
Collection.toArray()
method.
iter
- the Iteratorao
- the array into which the elements of the Iterator are
to be stored, if it is big enough; otherwise, a new array
of the same runtime type is allocated for this purpose
public Object[] toArray()
public Object[] toArray(Object[] ao)
Collection.toArray(Object[])
method.
ao
- the array into which the elements of the Enumeration are
to be stored, if it is big enough; otherwise, a new array
of the same runtime type is allocated for this purpose
ArrayStoreException
- if the runtime type of the specified array
is not a supertype of the runtime type of every element in this
collection
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |