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

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.RingVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class RingVector
extends java.util.Vector

Tripos RingVector class

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
RingVector()
          Default constructor
RingVector(int cap)
          Capacity constructor
RingVector(int cap, int inc)
          Capacity & increment constructor
RingVector(RingVector rv)
          Copy constructor.
 
Method Summary
 void append(Ring r)
          Append a ring to the end of vector
 boolean equals(RingVector rv)
          Compares this RingVector with another
 Ring firstRing()
          Returns first ring in RingVector
 Ring getRing(int i)
          Returns ring at specified index
 void insert(Ring r, int i)
          Insert a ring at specified index; other rings are shifted over
 Ring lastRing()
          Returns last ring in RingVector
 boolean remove(Ring r)
          Remove a ring; other rings are shifted down
 void removeRing(int i)
          Remove ring at specified index; other rings are shifted down
 void set(Ring r, int i)
          Set a ring at specified index; ring 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

RingVector

public RingVector()
Default constructor


RingVector

public RingVector(int cap)
Capacity constructor

Parameters:
cap - initial capacity of vector

RingVector

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

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

RingVector

public RingVector(RingVector rv)
Copy constructor.

Parameters:
rv - RingVector to be copied
Method Detail

append

public final void append(Ring r)
Append a ring to the end of vector

Parameters:
r - ring to be appended

getRing

public final Ring getRing(int i)
                   throws java.lang.ArrayIndexOutOfBoundsException
Returns ring at specified index

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

set

public final void set(Ring r,
                      int i)
Set a ring at specified index; ring at index is replaced

Parameters:
r - ring to be set
i - index to place ring

insert

public final void insert(Ring r,
                         int i)
Insert a ring at specified index; other rings are shifted over

Parameters:
r - ring to be inserted
i - index of insertion

remove

public final boolean remove(Ring r)
Remove a ring; other rings are shifted down

Parameters:
r - ring to be removed
Returns:
true if ring was removed, else false

removeRing

public final void removeRing(int i)
                      throws java.lang.ArrayIndexOutOfBoundsException
Remove ring at specified index; other rings are shifted down

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

firstRing

public final Ring firstRing()
                     throws java.util.NoSuchElementException
Returns first ring in RingVector

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

lastRing

public final Ring lastRing()
                    throws java.util.NoSuchElementException
Returns last ring in RingVector

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

equals

public boolean equals(RingVector rv)
Compares this RingVector with another

Parameters:
rv - RingVector to compare with
Returns:
true if they are equal, else false