Package gov.nih.mipav.view
Class ViewVOIVector
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<VOI>,Collection<VOI>,List<VOI>,RandomAccess,SequencedCollection<VOI>
- Direct Known Subclasses:
VOIVector
A simple class that extends Vector mostly to clean-up syntax access to VOI info. in ViewComponentEditImage
((VOI)(VOIs.elementAt(i))).isActive() would be a good example can be re-written as as:
VOIs.VOIAt(i).isActive()- Version:
- Feb 2, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
$Logfile: /mipav/src/gov/nih/mipav/view/ViewVOIVector.java $ $Revision: 10 $ $Date: 3/31/03 3:57p $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longUse serialVersionUID for interoperability.Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.ViewVOIVector(int initialsize) Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(VOI newVOI) Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.protected StringBuilds a new voi name by incrementing the given name.intfinal VOIVOIAt(int i) Returns the VOI at the index.Methods inherited from class java.util.Vector
add, add, addAll, addAll, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
-
Constructor Details
-
ViewVOIVector
public ViewVOIVector()Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.Copied from the definition of
java.util.Vector -
ViewVOIVector
public ViewVOIVector(int initialsize) Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero.- Parameters:
initialsize- initial capacity of the vector
-
-
Method Details
-
addElement
Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.- Overrides:
addElementin classVector<VOI>- Parameters:
o- index of the VOI- Throws:
IllegalArgumentException- for any argumentowhich is not an instance ofgov.nih.mipav.model.structures.VOI
-
VOIAt
Returns the VOI at the index.- Parameters:
i- index of the VOI- Returns:
- the VOI at the index
-
buildName
Builds a new voi name by incrementing the given name.- Parameters:
name- current name- Returns:
- the new name
-
getUniqueID
public int getUniqueID()
-