Methods Summary |
---|
public void | add(int index, java.lang.Object element)
this.getDelegate().add(index, element);
raiseAddChangeEvent(element);
|
public synchronized boolean | add(java.lang.Object o)
this.getDelegate().add(o);
raiseAddChangeEvent(o);
return true;
|
public synchronized boolean | addAll(java.util.Collection c)
// Must trigger add events if tracked or uow.
if (hasBeenRegistered()) {
Iterator objects = c.iterator();
while (objects.hasNext()) {
this.add(objects.next());
}
return true;
}
return getDelegate().addAll(c);
|
public synchronized boolean | addAll(int index, java.util.Collection c)
Iterator objects = c.iterator();
// Must trigger add events if tracked or uow.
if (hasBeenRegistered()) {
while (objects.hasNext()) {
this.add(index, objects.next());
index++;
}
return true;
}
return this.getDelegate().addAll(index, c);
|
public synchronized void | addElement(java.lang.Object obj)
this.add(obj);
|
protected java.util.Vector | buildDelegate()PUBLIC:
Return the freshly-built delegate.
In jdk1.1, the delegate may not be a Vector (in which case, it better be another IndirectList).
In jdk1.2, IndirectList is a subclass of Vector, so there is no need to check.
return (Vector)getValueHolder().getValue();
|
public int | capacity()
return this.getDelegate().capacity();
|
public void | clear()
if (hasBeenRegistered()) {
Iterator objects = this.iterator();
while (objects.hasNext()) {
Object o = objects.next();
objects.remove();
this.raiseRemoveChangeEvent(o);
}
} else {
this.getDelegate().clear();
}
|
public synchronized java.lang.Object | clone()PUBLIC:
IndirectList result = (IndirectList)super.clone();
result.delegate = (Vector)this.getDelegate().clone();
result.attributeName = null;
return result;
|
public boolean | contains(java.lang.Object elem)PUBLIC:
return this.getDelegate().contains(elem);
|
public synchronized boolean | containsAll(java.util.Collection c)
return this.getDelegate().containsAll(c);
|
public synchronized void | copyInto(java.lang.Object[] anArray)
this.getDelegate().copyInto(anArray);
|
public synchronized java.lang.Object | elementAt(int index)
return this.getDelegate().elementAt(index);
|
public java.util.Enumeration | elements()
return this.getDelegate().elements();
|
public synchronized void | ensureCapacity(int minCapacity)
this.getDelegate().ensureCapacity(minCapacity);
|
public synchronized boolean | equals(java.lang.Object o)
return this.getDelegate().equals(o);
|
public synchronized java.lang.Object | firstElement()
return this.getDelegate().firstElement();
|
public synchronized java.lang.Object | get(int index)
return this.getDelegate().get(index);
|
protected synchronized java.util.Vector | getDelegate()PUBLIC:
Check whether the contents have been read from the database.
If they have not, read them and set the delegate.
if (delegate == null) {
delegate = this.buildDelegate();
}
return delegate;
|
public java.lang.String | getTopLinkAttributeName()Return the mapping attribute name, used to raise change events.
return attributeName;
|
public synchronized oracle.toplink.essentials.indirection.ValueHolderInterface | getValueHolder()PUBLIC:
Return the valueHolder.
// PERF: lazy initialize value holder and vector as are normally set after creation.
if (valueHolder == null) {
valueHolder = new ValueHolder(new Vector(this.initialCapacity, this.capacityIncrement));
}
return valueHolder;
|
public boolean | hasBeenRegistered()INTERNAL:
return whether this IndirectList has been registered with the UnitOfWork
return getValueHolder() instanceof oracle.toplink.essentials.internal.indirection.UnitOfWorkQueryValueHolder;
|
public synchronized int | hashCode()INTERNAL:
return this.getDelegate().hashCode();
|
public int | indexOf(java.lang.Object elem)
return this.getDelegate().indexOf(elem);
|
public synchronized int | indexOf(java.lang.Object elem, int index)
return this.getDelegate().indexOf(elem, index);
|
protected void | initialize(int initialCapacity, int capacityIncrement)Initialize the instance.
this.initialCapacity = initialCapacity;
this.capacityIncrement = capacityIncrement;
this.delegate = null;
this.valueHolder = null;
|
protected void | initialize(java.util.Collection c)Initialize the instance.
this.delegate = null;
Vector temp = new Vector(c);
this.valueHolder = new ValueHolder(temp);
|
public synchronized void | insertElementAt(java.lang.Object obj, int index)
this.getDelegate().insertElementAt(obj, index);
this.raiseAddChangeEvent(obj);
|
public boolean | isEmpty()
return this.getDelegate().isEmpty();
|
public boolean | isInstantiated()PUBLIC:
Return whether the contents have been read from the database.
return this.getValueHolder().isInstantiated();
|
public java.util.Iterator | iterator()
// Must wrap the interator to raise the remove event.
return new Iterator() {
Iterator delegateIterator = IndirectList.this.getDelegate().iterator();
Object currentObject;
public boolean hasNext() {
return this.delegateIterator.hasNext();
}
public Object next() {
this.currentObject = this.delegateIterator.next();
return this.currentObject;
}
public void remove() {
this.delegateIterator.remove();
IndirectList.this.raiseRemoveChangeEvent(this.currentObject);
}
};
|
public synchronized java.lang.Object | lastElement()
return this.getDelegate().lastElement();
|
public int | lastIndexOf(java.lang.Object elem)
return this.getDelegate().lastIndexOf(elem);
|
public synchronized int | lastIndexOf(java.lang.Object elem, int index)
return this.getDelegate().lastIndexOf(elem, index);
|
public java.util.ListIterator | listIterator()
return this.listIterator(0);
|
public java.util.ListIterator | listIterator(int index)
// Must wrap the interator to raise the remove event.
return new ListIterator() {
ListIterator delegateIterator = IndirectList.this.getDelegate().listIterator(index);
Object currentObject;
public boolean hasNext() {
return this.delegateIterator.hasNext();
}
public boolean hasPrevious() {
return this.delegateIterator.hasPrevious();
}
public int previousIndex() {
return this.delegateIterator.previousIndex();
}
public int nextIndex() {
return this.delegateIterator.nextIndex();
}
public Object next() {
this.currentObject = this.delegateIterator.next();
return this.currentObject;
}
public Object previous() {
this.currentObject = this.delegateIterator.previous();
return this.currentObject;
}
public void remove() {
this.delegateIterator.remove();
IndirectList.this.raiseRemoveChangeEvent(this.currentObject);
}
public void set(Object object) {
this.delegateIterator.set(object);
IndirectList.this.raiseRemoveChangeEvent(this.currentObject);
IndirectList.this.raiseAddChangeEvent(object);
}
public void add(Object object) {
this.delegateIterator.add(object);
IndirectList.this.raiseAddChangeEvent(object);
}
};
|
protected void | raiseAddChangeEvent(java.lang.Object element)Raise the add change event and relationship maintainence.
if (hasBeenRegistered()) {
((UnitOfWorkQueryValueHolder)getValueHolder()).updateForeignReferenceSet(element, null);
}
|
protected void | raiseRemoveChangeEvent(java.lang.Object element)Raise the remove change event.
if (hasBeenRegistered()) {
((UnitOfWorkQueryValueHolder)getValueHolder()).updateForeignReferenceRemove(element);
}
|
public synchronized java.lang.Object | remove(int index)
Object value = this.getDelegate().remove(index);
this.raiseRemoveChangeEvent(value);
return value;
|
public boolean | remove(java.lang.Object o)
if (this.getDelegate().remove(o)) {
this.raiseRemoveChangeEvent(o);
return true;
}
return false;
|
public synchronized boolean | removeAll(java.util.Collection c)
// Must trigger remove events if tracked or uow.
if (hasBeenRegistered()) {
Iterator objects = c.iterator();
while (objects.hasNext()) {
this.remove(objects.next());
}
return true;
}
return this.getDelegate().removeAll(c);
|
public synchronized void | removeAllElements()
// Must trigger remove events if tracked or uow.
if (hasBeenRegistered()) {
Iterator objects = this.iterator();
while (objects.hasNext()) {
Object object = objects.next();
objects.remove();
this.raiseRemoveChangeEvent(object);
}
return;
}
this.getDelegate().removeAllElements();
|
public synchronized boolean | removeElement(java.lang.Object obj)
return this.remove(obj);
|
public synchronized void | removeElementAt(int index)
this.remove(index);
|
public synchronized boolean | retainAll(java.util.Collection c)
// Must trigger remove events if tracked or uow.
if (hasBeenRegistered()) {
Iterator objects = getDelegate().iterator();
while (objects.hasNext()) {
Object object = objects.next();
if (!c.contains(object)) {
objects.remove();
this.raiseRemoveChangeEvent(object);
}
}
return true;
}
return this.getDelegate().retainAll(c);
|
public synchronized java.lang.Object | set(int index, java.lang.Object element)
Object oldValue = this.getDelegate().set(index, element);
this.raiseRemoveChangeEvent(oldValue);
this.raiseAddChangeEvent(element);
return oldValue;
|
public synchronized void | setElementAt(java.lang.Object obj, int index)
this.set(index, obj);
|
public synchronized void | setSize(int newSize)
// Must trigger remove events if tracked or uow.
if (hasBeenRegistered()) {
if (newSize > this.size()) {
for (int index = size(); index > newSize; index--) {
this.remove(index - 1);
}
}
}
this.getDelegate().setSize(newSize);
|
public void | setTopLinkAttributeName(java.lang.String attributeName)Set the mapping attribute name, used to raise change events.
This is required if the change listener is set.
this.attributeName = attributeName;
|
public void | setValueHolder(oracle.toplink.essentials.indirection.ValueHolderInterface valueHolder)PUBLIC:
Set the value holder.
this.delegate = null;
this.valueHolder = valueHolder;
|
public int | size()
return this.getDelegate().size();
|
public java.util.List | subList(int fromIndex, int toIndex)
return this.getDelegate().subList(fromIndex, toIndex);
|
public synchronized java.lang.Object[] | toArray()
return this.getDelegate().toArray();
|
public synchronized java.lang.Object[] | toArray(java.lang.Object[] a)
return this.getDelegate().toArray(a);
|
public java.lang.String | toString()PUBLIC:
Use the java.util.Vector#toString(); but wrap it with braces to indicate
there is a bit of indirection.
Don't allow this method to trigger a database read.
if (ValueHolderInterface.shouldToStringInstantiate) {
return this.getDelegate().toString();
}
if (this.isInstantiated()) {
return "{" + this.getDelegate().toString() + "}";
} else {
return "{" + oracle.toplink.essentials.internal.helper.Helper.getShortClassName(this.getClass()) + ": not instantiated}";
}
|
public synchronized void | trimToSize()
this.getDelegate().trimToSize();
|