cct.modelling
Class BondsArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by cct.modelling.BondsArray
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class BondsArray
extends java.util.ArrayList

Title: BondsArray

Description:

Copyright: Copyright (c) 2006

Company: ANU

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BondsArray()
           
BondsArray(BondsArray ab)
          Copy constructor
 
Method Summary
 void append(BondInterface b)
          Append an atom to the end of vector
 boolean equals(BondsArray av)
          Compares this AtomVector with another
 BondInterface firstBond()
          Returns first atom in AtomVector
 BondInterface getBond(int i)
          Returns atom at specified index
 void insert(BondInterface a, int i)
          Insert an atom at specified index; other atoms are shifted over
 BondInterface lastBond()
          Returns last atom in AtomVector
 void removeAllBonds()
          Remove all atoms
 boolean removeBond(BondInterface a)
          Remove an atom; other atoms are shifted down
 BondInterface removeBond(int i)
          Remove atom at specified index; other atoms are shifted down
 void replace(BondInterface a, int i)
          Set an atom at specified index; atom at index is replaced
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

BondsArray

public BondsArray()

BondsArray

public BondsArray(BondsArray ab)
Copy constructor

Method Detail

append

public void append(BondInterface b)
Append an atom to the end of vector


getBond

public BondInterface getBond(int i)
                      throws java.lang.ArrayIndexOutOfBoundsException
Returns atom at specified index

Throws:
java.lang.ArrayIndexOutOfBoundsException - if index >= capacity()

replace

public void replace(BondInterface a,
                    int i)
Set an atom at specified index; atom at index is replaced


insert

public void insert(BondInterface a,
                   int i)
Insert an atom at specified index; other atoms are shifted over


removeBond

public boolean removeBond(BondInterface a)
Remove an atom; other atoms are shifted down


removeBond

public BondInterface removeBond(int i)
                         throws java.lang.ArrayIndexOutOfBoundsException
Remove atom at specified index; other atoms are shifted down

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

removeAllBonds

public void removeAllBonds()
                    throws java.lang.ArrayIndexOutOfBoundsException
Remove all atoms

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

firstBond

public BondInterface firstBond()
                        throws java.util.NoSuchElementException
Returns first atom in AtomVector

Throws:
java.util.NoSuchElementException - if size() == 0

lastBond

public BondInterface lastBond()
                       throws java.util.NoSuchElementException
Returns last atom in AtomVector

Throws:
java.util.NoSuchElementException - if size() == 0

equals

public boolean equals(BondsArray av)
Compares this AtomVector with another

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