The Octet Molecular Representation Framework v0.8.2

net.sf.octet.util
Interface Sequence

All Known Implementing Classes:
ArraySequence

public interface Sequence

A Sequence is an ordered, immutable group of objects of the same class in which null is not permitted. For convenience, Sequence uses the method naming convention in java.util.List, although Sequence does not inherit that interface.

Author:
Richard Apodaca

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.
 

Method Detail

contains

public boolean contains(java.lang.Object o)
Returns true if the Object can be found in this Sequence.

Parameters:
o - the Object to find
Returns:
true if o can be found, or false otherwise

size

public int size()
Returns the number of objects in this Sequence.

Returns:
the number of objects in this Sequence

indexOf

public int indexOf(java.lang.Object o)
Returns the index of the specified Object, or -1 if it could not be found.

Parameters:
o - the Object to find
Returns:
true if o could be found, or false otherwise

get

public java.lang.Object get(int index)
Returns the Object at the specified position in this Sequence.

Parameters:
index - the index to query
Returns:
the Object at index
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())

iterator

public java.util.Iterator iterator()
Returns an Iterator over the objects in this Sequence.

Returns:
an Iterator over the objects in this Sequence

toArray

public java.lang.Object[] toArray()
Returns the Objects 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().

Returns:
the Objects of this sequence as an array

getElementClass

public java.lang.Class getElementClass()
Returns the Class of the Objects contained in this Sequence.

Returns:
the Class of the Objects contained in this Sequence

objectsImplement

public boolean objectsImplement(java.lang.Class classInterface)
Returns true if the Objects in this Sequence implement classInterface, or false otherwise.

Parameters:
classInterface - the interface to query Objects against
Returns:
true if the Objects in this Sequence implement classInterface, or false otherwise

The Octet Molecular Representation Framework v0.8.2