public class IlvGraphicVector extends Object implements Cloneable, Serializable
IlvGraphicVector
is an expandable array of graphic objects.
Note that the implementation is not synchronized. If multiple threads access
an IlvGraphicVector
concurrently, and at least one of the
threads modifies the list structurally, it must be synchronized externally.Modifier and Type | Field and Description |
---|---|
protected int |
capacityIncrement
The size of the increment.
|
static boolean |
checkConcurrentModification
If this flag is true, the graphic vector throws concurrent modification
exceptions if the vector is changed while enumerating its elements.
|
static boolean |
DEBUG
Allows you to debug ConcurrentModificationException thrown by
IlvGraphicEnumeration.
|
protected int |
elementCount
The number of elements in the buffer.
|
protected IlvGraphic[] |
elementData
The buffer in which elements are stored.
|
Constructor and Description |
---|
IlvGraphicVector()
Constructs an empty vector.
|
IlvGraphicVector(int initialCapacity)
Constructs an empty vector with the specified storage capacity.
|
IlvGraphicVector(int initialCapacity,
int capacityIncrement)
Constructs an empty vector with the specified storage capacity and the
specified capacityIncrement.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(IlvGraphic object)
Adds the specified object as the last element of the vector.
|
int |
capacity()
Returns the current capacity of the vector.
|
Object |
clone()
Clones this vector.
|
boolean |
contains(IlvGraphic object)
Returns true if the specified element is a value of the vector.
|
void |
copyInto(IlvGraphic[] objects)
Copies the elements of this vector into the specified array.
|
IlvGraphic |
elementAt(int location)
Returns the element at the specified index.
|
IlvGraphicEnumeration |
elements()
Returns an enumeration of the elements.
|
void |
ensureCapacity(int minimumCapacity)
Ensures that the vector has at least the specified capacity.
|
IlvGraphic |
firstElement()
Returns the first element of the sequence.
|
int |
indexOf(IlvGraphic object)
Searches for the specified element starting from the first position.
|
int |
indexOf(IlvGraphic object,
int location)
Searches for the specified element starting from the specified position.
|
void |
insertElementAt(IlvGraphic object,
int location)
Inserts the specified object as an element at the specified index.
|
boolean |
isEmpty()
Returns the number of elements in the vector.
|
IlvGraphic |
lastElement()
Returns the last element of the sequence.
|
int |
lastIndexOf(IlvGraphic object)
Searches backwards for the specified element, starting from the last
position.
|
int |
lastIndexOf(IlvGraphic object,
int location)
Searches backwards for the specified element, starting from the specified
position.
|
void |
removeAllElements()
Removes all elements of the vector.
|
boolean |
removeElement(IlvGraphic object)
Removes the element from the vector.
|
void |
removeElementAt(int location)
Deletes the element at the specified index.
|
IlvGraphic |
setElementAt(IlvGraphic object,
int location)
Sets the element at the specified location to be the specified object.
|
void |
setSize(int length)
Sets the size of the vector.
|
int |
size()
Returns the number of elements in the vector.
|
String |
toString()
Returns a comma separated list of elements embraced in "[" and "]" as a
String object.
|
void |
trimToSize()
Optimizes the capacity of the vector.
|
protected int capacityIncrement
public static boolean checkConcurrentModification
public static boolean DEBUG
protected int elementCount
protected IlvGraphic[] elementData
public IlvGraphicVector()
public IlvGraphicVector(int initialCapacity)
initialCapacity
- The initial storage capacity of the vector.public IlvGraphicVector(int initialCapacity, int capacityIncrement)
initialCapacity
- The initial storage capacity of the vector.capacityIncrement
- How much to increase the size of the element by.public final boolean contains(IlvGraphic object)
object
- The desired element.indexOf(IlvGraphic)
,
indexOf(IlvGraphic, int)
public final boolean isEmpty()
IlvGraphic
objects in this vector.elementCount
public boolean removeElement(IlvGraphic object)
object
- The element to be removed.public IlvGraphic elementAt(int location)
location
- The index of the desired element.public IlvGraphicEnumeration elements()
public final IlvGraphic firstElement()
NoSuchElementException
- If the sequence is empty.elementAt(int)
,
lastElement()
,
size()
public final IlvGraphic lastElement()
NoSuchElementException
- If the sequence is empty.elementAt(int)
,
firstElement()
,
size()
public final IlvGraphic setElementAt(IlvGraphic object, int location)
object
- What the element is to be set to.location
- The specified locationArrayIndexOutOfBoundsException
- If the location was not valid.size()
public final int capacity()
ensureCapacity(int)
,
size()
public int indexOf(IlvGraphic object)
object
- The desired element.indexOf(IlvGraphic, int)
public final int indexOf(IlvGraphic object, int location)
object
- The desired element.location
- The index where the search should be started.ArrayIndexOutOfBoundsException
- If location is less than zero.indexOf(IlvGraphic)
public final int lastIndexOf(IlvGraphic object)
object
- The desired element.contains(ilog.views.IlvGraphic)
,
indexOf(IlvGraphic)
,
indexOf(IlvGraphic, int)
,
lastIndexOf(IlvGraphic, int)
public final int lastIndexOf(IlvGraphic object, int location)
object
- The desired element.location
- The location where the search should be started.ArrayIndexOutOfBoundsException
- If location is greater than or equal
to the size of the graphic vector.contains(ilog.views.IlvGraphic)
,
indexOf(IlvGraphic)
,
indexOf(IlvGraphic, int)
,
lastIndexOf(IlvGraphic)
public final int size()
elementCount
,
lastElement()
public final String toString()
public void addElement(IlvGraphic object)
object
- The element to be added.public final void copyInto(IlvGraphic[] objects)
objects
- The array which elements are copied into.ArrayIndexOutOfBoundsException
- If passed array is not large enough
to hold all elements in this Vector.clone()
public void ensureCapacity(int minimumCapacity)
minimumCapacity
- The desired minimum capacity.capacity()
public void insertElementAt(IlvGraphic object, int location)
object
- The element to be inserted.location
- Where the new element should be inserted.ArrayIndexOutOfBoundsException
- If the index was not valid.addElement(ilog.views.IlvGraphic)
,
size()
public final void removeAllElements()
public void removeElementAt(int location)
location
- The location of the element to be removed.ArrayIndexOutOfBoundsException
- If the index was not valid.public final void setSize(int length)
length
- The new vector size.public final void trimToSize()
capacity()
,
ensureCapacity(int)
,
size()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.