|
The Octet Molecular Representation Framework v0.8.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.octet.util.ArraySequence
A default implementation of the Sequence interface backed by an
array.
| Constructor Summary | |
ArraySequence()
Constructs an empty ArraySequence that will return
null for getObjectClass(). |
|
ArraySequence(java.util.Collection collection,
java.lang.Class objectClass)
Constructs an ArraySequence from the elements of
collection by enforcing the constraint that all of its
members are of type objectClass. |
|
ArraySequence(java.lang.Object[] array,
java.lang.Class objectClass)
Constructs an ArraySequence from the elements of
array by enforcing the constraint that all of its
members are of type objectClass. |
|
| Method Summary | |
boolean |
contains(java.lang.Object o)
Returns true if the Object can be found in this
Sequence. |
java.lang.Object |
get(int index)
Returns the Object at the specified position in this
Sequence. |
java.lang.Class |
getElementClass()
Returns the Class of the Objects contained in this
Sequence. |
int |
indexOf(java.lang.Object o)
Returns the index of the specified Object, or -1 if it could not
be found. |
java.util.Iterator |
iterator()
Returns an Iterator over the objects in this Sequence. |
boolean |
objectsImplement(java.lang.Class classInterface)
Returns true if the Objects in this Sequence
implement classInterface, or false otherwise. |
int |
size()
Returns the number of objects in this Sequence. |
java.lang.Object[] |
toArray()
Returns the Objects of this sequence as an array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ArraySequence()
ArraySequence that will return
null for getObjectClass().
public ArraySequence(java.util.Collection collection,
java.lang.Class objectClass)
ArraySequence from the elements of
collection by enforcing the constraint that all of its
members are of type objectClass.
collection - the collectionobjectClass - the type of all Objects in collection
java.lang.NullPointerException - if collection contains null,
or if objectClass is null
java.lang.IllegalArgumentException - if collection contains elements
of mixed class, or if Objects of type other than objectClass are
found in collection
public ArraySequence(java.lang.Object[] array,
java.lang.Class objectClass)
ArraySequence from the elements of
array by enforcing the constraint that all of its
members are of type objectClass.
array - the arrayobjectClass - the type of all Objects in array
java.lang.NullPointerException - if array contains null,
or if objectClass is null
java.lang.IllegalArgumentException - if array contains elements
of mixed class, or if Objects of type other than objectClass are
found in collection| Method Detail |
public boolean contains(java.lang.Object o)
Sequencetrue if the Object can be found in this
Sequence.
contains in interface Sequenceo - the Object to find
true if o can be found, or false
otherwisepublic int size()
SequenceSequence.
size in interface SequenceSequencepublic int indexOf(java.lang.Object o)
SequenceObject, or -1 if it could not
be found.
indexOf in interface Sequenceo - the Object to find
true if o could be found, or false
otherwisepublic java.lang.Object get(int index)
SequenceObject at the specified position in this
Sequence.
get in interface Sequenceindex - the index to query
indexpublic java.util.Iterator iterator()
SequenceIterator over the objects in this Sequence.
iterator in interface SequenceIterator over the objects in this Sequence
public java.lang.Object[] toArray()
SequenceObjects of this sequence as an array. This array
can be modified without changing the state of this Sequence.
The ordering in the returned array is identical to the ordering in
iterator().
toArray in interface SequenceObjects of this sequence as an arraypublic java.lang.Class getElementClass()
SequenceClass of the Objects contained in this
Sequence.
getElementClass in interface SequenceClass of the Objects contained in this
Sequencepublic boolean objectsImplement(java.lang.Class classInterface)
Sequencetrue if the Objects in this Sequence
implement classInterface, or false otherwise.
objectsImplement in interface SequenceclassInterface - the interface to query Objects against
true if the Objects in this Sequence
implement classInterface, or false otherwise
|
The Octet Molecular Representation Framework v0.8.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||