The Octet Molecular Representation Framework v0.8.2

net.sf.octet.model
Class SimpleHalfPlane

java.lang.Object
  extended bynet.sf.octet.model.SimpleHalfPlane
All Implemented Interfaces:
HalfPlane

public class SimpleHalfPlane
extends java.lang.Object
implements HalfPlane

An implementation of the HalfPlane interface that is optimized for those cases in which a HalfPlane contains only one Atom. Aside from cis-alkenes, there is no common molecular stereochemical feature that uses multi-Atom HalfPlanes, so this class can afford considerable savings in access time and memory allocation over BasicHalfPlane.

Author:
Richard Apodaca

Constructor Summary
SimpleHalfPlane(Atom atom, int position)
          Constructs a SimpleHalfPlane that contains atom at the indicated position.
 
Method Summary
 int countAtoms()
          Returns the number of Atoms contained by this HalfPlane.
 int countLowerAtoms()
          Returns the number of Atoms contained in the lower region of this HalfPlane.
 int countUpperAtoms()
          Returns the number of Atoms contained in the upper region of this HalfPlane.
 Atom getIntersectionAtom()
          Returns the Atom located at the bisector of this HalfPlane, or null if none exists.
 boolean hasIntersectionAtom()
          Returns true if this HalfPlane has an Atom located on the bisector, or false otherwise.
 AtomIterator iterateLowerAtoms()
          Returns an iterator over all Atoms appearing in the lower region of this HalfPlane.
 AtomIterator iterateUpperAtoms()
          Returns an iterator over all Atoms appearing in the upper region of this HalfPlane.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHalfPlane

public SimpleHalfPlane(Atom atom,
                       int position)
Constructs a SimpleHalfPlane that contains atom at the indicated position. Positive values of position indicate the upper region, negative values indicate the lower region, and zero indicates the intersection position.

Method Detail

countAtoms

public int countAtoms()
Description copied from interface: HalfPlane
Returns the number of Atoms contained by this HalfPlane.

Specified by:
countAtoms in interface HalfPlane
Returns:
the number of Atoms contained by this HalfPlane

iterateLowerAtoms

public AtomIterator iterateLowerAtoms()
Description copied from interface: HalfPlane
Returns an iterator over all Atoms appearing in the lower region of this HalfPlane.

Specified by:
iterateLowerAtoms in interface HalfPlane
Returns:
an iterator over all Atoms appearing in the lower region of this HalfPlane

countLowerAtoms

public int countLowerAtoms()
Description copied from interface: HalfPlane
Returns the number of Atoms contained in the lower region of this HalfPlane.

Specified by:
countLowerAtoms in interface HalfPlane
Returns:
the number of Atoms contained in the lower region of this HalfPlane

iterateUpperAtoms

public AtomIterator iterateUpperAtoms()
Description copied from interface: HalfPlane
Returns an iterator over all Atoms appearing in the upper region of this HalfPlane.

Specified by:
iterateUpperAtoms in interface HalfPlane
Returns:
an iterator over all Atoms appearing in the upper region of this HalfPlane

countUpperAtoms

public int countUpperAtoms()
Description copied from interface: HalfPlane
Returns the number of Atoms contained in the upper region of this HalfPlane.

Specified by:
countUpperAtoms in interface HalfPlane
Returns:
the number of Atoms contained in the upper region of this HalfPlane

getIntersectionAtom

public Atom getIntersectionAtom()
Description copied from interface: HalfPlane
Returns the Atom located at the bisector of this HalfPlane, or null if none exists. This is an optional operation. Implementors may throw an UnsupportedOperationException to indicate this.

Specified by:
getIntersectionAtom in interface HalfPlane
Returns:
the Atom located at the bisector of this HalfPlane, or null if none exists

hasIntersectionAtom

public boolean hasIntersectionAtom()
Description copied from interface: HalfPlane
Returns true if this HalfPlane has an Atom located on the bisector, or false otherwise. This is an optional operation. Implementors may throw an UnsupportedOperationException to indicate this.

Specified by:
hasIntersectionAtom in interface HalfPlane
Returns:
code>true if this HalfPlane has an Atom located on the bisector, or false otherwise

The Octet Molecular Representation Framework v0.8.2