The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Interface AtomGraphCollection

All Known Implementing Classes:
BasicAtomGraphCollection

public interface AtomGraphCollection

AtomGraphCollection is an immutable group of AtomGraphs. Any AtomGraph may be present, but null is disallowed.

AtomGraph places the additional restriction on implementors that all methods are consistent - they can be assumed to return the same results throughout the AtomGraph's lifetime.

Author:
Richard Apodaca
See Also:
"Immutable Pattern (Grand98)"

Method Summary
 boolean containsAtomGraph(AtomGraph graph)
          Returns true if an AtomGraph matching graph, as determined by Object.equals, is contained in this collection.
 int countAtomGraphs()
          Returns the number of AtomGraphs contained in this collection.
 AtomGraph getAtomGraph(int index)
          Returns the AtomGraph contained at the specified zero-based index.
 int getAtomGraphIndex(AtomGraph graph)
          Returns the zero-based index of the specified AtomGraph as determined by Object.equals or -1 if no match is found.
 AtomGraphIterator iterateAtomGraphs()
          Returns an iterator over all AtomGraphs in this collection.
 AtomGraph[] toAtomGraphArray()
          Returns a copy of the AtomGraphs contained in this collection as an array.
 

Method Detail

containsAtomGraph

public boolean containsAtomGraph(AtomGraph graph)
Returns true if an AtomGraph matching graph, as determined by Object.equals, is contained in this collection.

Parameters:
graph - the AtomGraph to search for
Returns:
true if found, false otherwise

countAtomGraphs

public int countAtomGraphs()
Returns the number of AtomGraphs contained in this collection.

Returns:
the number of AtomGraphs contained in this collection.

iterateAtomGraphs

public AtomGraphIterator iterateAtomGraphs()
Returns an iterator over all AtomGraphs in this collection.

Returns:
an iterator over all AtomGraphs in this collection

getAtomGraphIndex

public int getAtomGraphIndex(AtomGraph graph)
Returns the zero-based index of the specified AtomGraph as determined by Object.equals or -1 if no match is found.

Parameters:
graph - the subgraph for which to find an index
Returns:
the index of graph, or -1 if no match is found

getAtomGraph

public AtomGraph getAtomGraph(int index)
Returns the AtomGraph contained at the specified zero-based index.

Parameters:
index - the index to search
Returns:
the AtomGraph at index

toAtomGraphArray

public AtomGraph[] toAtomGraphArray()
Returns a copy of the AtomGraphs contained in this collection as an array. The resulting array may be modified without changing the state of this collection.

Returns:
a copy of the AtomGraph array for this collection

The Octet Molecular Representation Framework v0.8.2