The Octet Molecular Representation Framework v0.8.2

net.sf.octet.model
Class BasicHalfPlane

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

public class BasicHalfPlane
extends java.lang.Object
implements HalfPlane

A default implementation of the HalfPlane interface.

Author:
Richard Apodaca

Constructor Summary
BasicHalfPlane(AtomCollection atoms, int[] positions)
          Constructs a BasicHalfPlane from atoms and positions.
 
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.
static HalfPlane getNullInstance()
           
 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

BasicHalfPlane

public BasicHalfPlane(AtomCollection atoms,
                      int[] positions)
Constructs a BasicHalfPlane from atoms and positions. The integer located at index i of positions will specify the position of the ith Atom of atoms. Positive values specify the upper part of the plane. Negative values specify the lower part of the plane. Zero specifies the midpoint.

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

getNullInstance

public static HalfPlane getNullInstance()

The Octet Molecular Representation Framework v0.8.2