org.jscience.chemistry.gui.extended.molecule
Class BondVector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.jscience.chemistry.gui.extended.molecule.BondVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class BondVector
extends java.util.Vector

Tripos BondVector class

See Also:
Bond, Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BondVector()
          Default constructor
BondVector(BondVector bv)
          Copy constructor.
BondVector(int cap)
          Capacity constructor
BondVector(int cap, int inc)
          Capacity & increment constructor
 
Method Summary
 void append(Bond a)
          Append a bond to the end of vector
 boolean equals(BondVector av)
          Compares this BondVector with another
 Bond firstBond()
          Returns first bond in BondVector
 Bond getBond(int i)
          Returns bond at specified index
 void insert(Bond a, int i)
          Insert a bond at specified index; other bonds are shifted over
 Bond lastBond()
          Returns last bond in BondVector
 boolean removeBond(Bond a)
          Remove a bond; other bonds are shifted down
 void removeBond(int i)
          Remove bond at specified index; other bonds are shifted down
 void set(Bond a, int i)
          Set a bond at specified index; bond at index is replaced
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

BondVector

public BondVector()
Default constructor


BondVector

public BondVector(int cap)
Capacity constructor

Parameters:
cap - initial capacity of vector

BondVector

public BondVector(int cap,
                  int inc)
Capacity & increment constructor

Parameters:
cap - initial capacity of vector
inc - increment factor

BondVector

public BondVector(BondVector bv)
Copy constructor.

Parameters:
bv - BondVector to be copied
Method Detail

append

public final void append(Bond a)
Append a bond to the end of vector

Parameters:
a - bond to be appended

getBond

public final Bond getBond(int i)
                   throws java.lang.ArrayIndexOutOfBoundsException
Returns bond at specified index

Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index >= capacity()

set

public final void set(Bond a,
                      int i)
Set a bond at specified index; bond at index is replaced

Parameters:
a - bond to be set
i - index to place bond

insert

public final void insert(Bond a,
                         int i)
Insert a bond at specified index; other bonds are shifted over

Parameters:
a - bond to be inserted
i - index of insertion

removeBond

public final boolean removeBond(Bond a)
Remove a bond; other bonds are shifted down

Parameters:
a - bond to be removed
Returns:
true if bond was removed, else false

removeBond

public final void removeBond(int i)
                      throws java.lang.ArrayIndexOutOfBoundsException
Remove bond at specified index; other bonds are shifted down

Parameters:
i - index of bond
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index >= capacity()

firstBond

public final Bond firstBond()
                     throws java.util.NoSuchElementException
Returns first bond in BondVector

Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - if size() == 0

lastBond

public final Bond lastBond()
                    throws java.util.NoSuchElementException
Returns last bond in BondVector

Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - if size() == 0

equals

public boolean equals(BondVector av)
Compares this BondVector with another

Parameters:
av - BondVector to compare with
Returns:
true if they are equal, else false