|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
org.apache.jdo.impl.sco.Vector
public class Vector
A mutable 2nd class object that represents Vector.
Vector
,
Serialized FormField Summary |
---|
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
Vector(java.lang.Class elementType,
boolean allowNulls)
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero. |
|
Vector(java.lang.Class elementType,
boolean allowNulls,
int initialCapacity)
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero. |
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object element)
Inserts the specified element at the specified position in this Vector. |
boolean |
add(java.lang.Object o)
Appends the specified element to the end of this Vector. |
boolean |
addAll(java.util.Collection c)
Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator. |
boolean |
addAll(int index,
java.util.Collection c)
Inserts all of the elements in in the specified Collection into this Vector at the specified position. |
void |
addAllInternal(java.util.Collection c)
Adds objects of the given Collection to this Collection without recording the event. |
void |
addElement(java.lang.Object obj)
Adds the specified component to the end of this vector, increasing its size by one. |
void |
addInternal(java.lang.Object o)
Adds object to the Collection without recording the event. |
boolean |
allowNulls()
Returns whether nulls are permitted as elements. |
void |
clear()
Removes all of the elements from this Vector. |
void |
clearInternal()
Clears Collection without recording the event. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
java.util.Iterator |
eitherIterator()
Get an iterator regardless of whether the collection is frozen. |
java.util.Iterator |
frozenIterator()
Get an iterator over the frozen elements of this collection. |
java.util.Collection |
getAdded()
Returns the Collection of added elements |
java.lang.Class |
getElementType()
Returns the element type assignment compatible with all added elements of this collection. |
java.lang.String |
getFieldName()
Returns the field name |
java.lang.Object |
getOwner()
Returns the owner object of the SCO instance |
java.util.Collection |
getRemoved()
Returns the Collection of removed elements |
void |
insertElementAt(java.lang.Object obj,
int index)
Inserts the specified object as a component in this vector at the specified index . |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this Vector. |
boolean |
remove(java.lang.Object o)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged. |
boolean |
removeAll(java.util.Collection c)
Removes from this Vector all of its elements that are contained in the specified Collection. |
void |
removeAllElements()
Removes all components from this vector and sets its size to zero. |
boolean |
removeElement(java.lang.Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this vector. |
void |
removeElementAt(int index)
Deletes the component at the specified index. |
void |
removeInternal(java.lang.Object o)
Removes element from the Collection without recording the event. |
void |
reset()
Resets removed and added lists after flush |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in this Vector that are contained in the specified Collection. |
java.lang.Object |
set(int index,
java.lang.Object element)
Replaces the element at the specified position in this Vector with the specified element. |
void |
setElementAt(java.lang.Object obj,
int index)
Sets the component at the specified index of this
vector to be the specified object. |
void |
setFrozen(java.lang.Object[] elements)
Set the contents of this Collection from the frozen elements. |
void |
setOwner(java.lang.Object owner,
int fieldNumber)
Sets the owner and field number. |
void |
unsetOwner(java.lang.Object owner,
int fieldNumber)
Nullifies references to the owner Object iff the passed in owner and fieldNumber match. |
Methods inherited from class java.util.Vector |
---|
capacity, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeRange, 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.Collection |
---|
contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray |
Methods inherited from interface java.util.List |
---|
iterator, listIterator, listIterator |
Constructor Detail |
---|
public Vector(java.lang.Class elementType, boolean allowNulls)
elementType
- the element types allowedallowNulls
- true if nulls are allowedpublic Vector(java.lang.Class elementType, boolean allowNulls, int initialCapacity)
elementType
- the element types allowedallowNulls
- true if nulls are allowedinitialCapacity
- the initial capacity of the vector.
java.lang.IllegalArgumentException
- if the specified initial capacity
is negativeMethod Detail |
---|
public void setElementAt(java.lang.Object obj, int index)
index
of this
vector to be the specified object. The previous component at that
position is discarded.
setElementAt
in class java.util.Vector
obj
- what the component is to be set to.index
- the specified index.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.Vector
public void removeElementAt(int index)
removeElementAt
in class java.util.Vector
index
- the index of the object to remove.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.Vector
public void insertElementAt(java.lang.Object obj, int index)
index
.
insertElementAt
in class java.util.Vector
obj
- the component to insert.index
- where to insert the new component.
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.Vector
public void addElement(java.lang.Object obj)
addElement
in class java.util.Vector
obj
- the component to be added.Vector
public boolean removeElement(java.lang.Object obj)
removeElement
in class java.util.Vector
obj
- the component to be removed.
true
if the argument was a component of this
vector; false
otherwise.Vector
public void removeAllElements()
removeAllElements
in class java.util.Vector
Vector
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.Vector
index
- index of element to replace.element
- element to be stored at the specified position.
java.lang.ArrayIndexOutOfBoundsException
- index out of range
(index < 0 || index >= size()).
java.lang.IllegalArgumentException
- fromIndex > toIndex.Vector
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.Vector
o
- element to be appended to this Vector.
Vector
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.Vector
o
- element to be removed from this Vector, if present.
Vector
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.Vector
index
- index at which the specified element is to be inserted.element
- element to be inserted.
java.lang.ArrayIndexOutOfBoundsException
- index is out of range
(index < 0 || index > size()).Vector
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.Vector
index
- the index of the element to removed.
java.lang.ArrayIndexOutOfBoundsException
- index out of range (index
< 0 || index >= size()).Vector
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.Vector
Vector
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.Vector
c
- elements to be inserted into this Vector.Vector
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.Vector
Vector
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.Vector
index
- index at which to insert first element
from the specified collection.c
- elements to be inserted into this Vector.
java.lang.ArrayIndexOutOfBoundsException
- index out of range (index
< 0 || index > size()).Vector
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.Vector
Vector
public java.lang.Object clone()
Mutable Second Class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
clone
in interface SCO
clone
in class java.util.Vector
public void reset()
SCOCollection
reset
in interface SCOCollection
SCOCollection.reset()
public void addInternal(java.lang.Object o)
SCOCollection
addInternal
in interface SCOCollection
SCOCollection.addInternal(Object o)
public void addAllInternal(java.util.Collection c)
SCOCollection
addAllInternal
in interface SCOCollection
SCOCollection.addAllInternal(Collection c)
public java.util.Collection getAdded()
SCOCollection
getAdded
in interface SCOCollection
SCOCollection.getAdded()
public java.util.Collection getRemoved()
SCOCollection
getRemoved
in interface SCOCollection
SCOCollection.getRemoved()
public void clearInternal()
SCOCollection
clearInternal
in interface SCOCollection
SCOCollection.clearInternal()
public void removeInternal(java.lang.Object o)
SCOCollection
removeInternal
in interface SCOCollection
SCOCollection.removeInternal(Object o)
public void unsetOwner(java.lang.Object owner, int fieldNumber)
SCO
unsetOwner
in interface SCO
owner
- the existing owner object.fieldNumber
- the existing number of the field.SCO.unsetOwner(Object owner, int fieldNumber)
public void setOwner(java.lang.Object owner, int fieldNumber)
SCO
setOwner
in interface SCO
owner
- the owner object.fieldNumber
- the number of the field associated with this instance.(Object owner, int fieldNumber)
public java.lang.Object getOwner()
SCO
getOwner
in interface SCO
SCO.getOwner()
public java.lang.String getFieldName()
SCO
getFieldName
in interface SCO
SCO.getFieldName()
public java.lang.Class getElementType()
SCOCollection
getElementType
in interface SCOCollection
{
public boolean allowNulls()
SCOCollection
allowNulls
in interface SCOCollection
{
public java.util.Iterator frozenIterator()
frozenIterator
in interface SCOCollection
public void setFrozen(java.lang.Object[] elements)
setFrozen
in interface SCOCollection
elements
- not used.public java.util.Iterator eitherIterator()
eitherIterator
in interface SCOCollection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |