Package gov.nih.mipav.model.structures
Class VOIVector
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<VOI>,Collection<VOI>,List<VOI>,RandomAccess,SequencedCollection<VOI>
Class extends ViewVOIVector to finish cleaning up access syntax to the volumes of interest vector.
In addition, it contains a listener, and permits interested parties to request to be notified when list of Volumes of Interest change. That could be when:
- a VOI is added
- a VOI is removed
- et cetera
VOIVectorListener to enforce that listeners handle that change.
Notice none of the methods using java.util.Collection are implemented here.
- Version:
- Aug 2002
- Author:
- David Parsons
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate EventListenerListholds all interfaces listening to this vector.private static final longUse serialVersionUID for interoperability.private VOIVectorEventan instnace of the VOI update event.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.VOIVector(int initialsize) Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero. -
Method Summary
Modifier and TypeMethodDescriptionbooleanOverride the Vector method to ensure that object is a voi, and that the new voi's name is unique.voidaddElement(VOI o) Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.voidaddVectorListener(VOIVectorListener listener) adds the update listener.booleanAdds voi to the voi vectorprotected voidfireVOIadded(VOI voi) Fires a VOI event based on the VOI. calls the listener'saddedVOI()method.protected voidfireVOIremoved(VOI voi) Fires a VOI event based on the VOI. calls the listener'sremovedVOI()method.voidinsertElementAt(VOI o, int index) Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.remove(int index) OveridesVector.remove().voidDOCUMENT ME!voidvoidremoveElementAt(int index) OveridesVector.remove().voidremoveRange(int first, int last) OveridesVector.removeRange().voidremoveVectorListener(VOIVectorListener listener) removes the update listener.Methods inherited from class gov.nih.mipav.view.ViewVOIVector
buildName, getUniqueID, VOIAtMethods inherited from class java.util.Vector
add, addAll, addAll, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, removeAll, removeElement, removeIf, 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:
-
listenerList
holds all interfaces listening to this vector. -
voiUpdate
an instnace of the VOI update event.
-
-
Constructor Details
-
VOIVector
public VOIVector()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 -
VOIVector
public VOIVector(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
-
VOIVector
-
-
Method Details
-
add
Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.- Specified by:
addin interfaceCollection<VOI>- Specified by:
addin interfaceList<VOI>- Overrides:
addin classVector<VOI>- Parameters:
o- index of the VOI- Returns:
- the VOI at the index
- Throws:
IllegalArgumentException- for any argumentowhich is not an instance ofgov.nih.mipav.model.structures.VOI
-
addElement
Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.- Overrides:
addElementin classViewVOIVector- Parameters:
o- index of the VOI
-
addVectorListener
adds the update listener.- Parameters:
listener- DOCUMENT ME!- Throws:
IllegalArgumentException- DOCUMENT ME!
-
addVOI
Adds voi to the voi vector- Parameters:
voi- DOCUMENT ME!- Returns:
- true if successful, false if not
-
insertElementAt
Override the Vector method to ensure that object is a voi, and that the new voi's name is unique.- Overrides:
insertElementAtin classVector<VOI>- Parameters:
o- index of the VOIindex- DOCUMENT ME!- Throws:
IllegalArgumentException- for any argumentowhich is not an instance ofgov.nih.mipav.model.structures.VOI
-
remove
OveridesVector.remove().successful removal of the element results in the VOI listeners being notified.
-
removeAllElements
public void removeAllElements()DOCUMENT ME!- Overrides:
removeAllElementsin classVector<VOI>
-
removeAllVectorListeners
public void removeAllVectorListeners() -
removeElementAt
public void removeElementAt(int index) OveridesVector.remove().successful removal of the element results in the VOI listeners being notified.
- Overrides:
removeElementAtin classVector<VOI>- Parameters:
index- DOCUMENT ME!
-
removeRange
public void removeRange(int first, int last) OveridesVector.removeRange().successfull removal of the range of elements results in the VOI listeners being notified.
- Overrides:
removeRangein classVector<VOI>- Parameters:
first- DOCUMENT ME!last- DOCUMENT ME!
-
removeVectorListener
removes the update listener.- Parameters:
listener- DOCUMENT ME!- Throws:
IllegalArgumentException- DOCUMENT ME!
-
fireVOIadded
Fires a VOI event based on the VOI. calls the listener'saddedVOI()method.- Parameters:
voi- DOCUMENT ME!
-
fireVOIremoved
Fires a VOI event based on the VOI. calls the listener'sremovedVOI()method.- Parameters:
voi- DOCUMENT ME!
-