Methods Summary |
---|
public boolean | add(java.lang.Object object)
if ( !isOperationQueueEnabled() ) {
write();
return list.add(object);
}
else {
queueOperation( new SimpleAdd(object) );
return true;
}
|
public void | add(int index, java.lang.Object value)
if (index<0) {
throw new ArrayIndexOutOfBoundsException("negative index");
}
if ( !isOperationQueueEnabled() ) {
write();
list.add(index, value);
}
else {
queueOperation( new Add(index, value) );
}
|
public boolean | addAll(java.util.Collection values)
if ( values.size()==0 ) {
return false;
}
if ( !isOperationQueueEnabled() ) {
write();
return list.addAll(values);
}
else {
Iterator iter = values.iterator();
while ( iter.hasNext() ) {
queueOperation( new SimpleAdd( iter.next() ) );
}
return values.size()>0;
}
|
public boolean | addAll(int index, java.util.Collection coll)
if ( coll.size()>0 ) {
write();
return list.addAll(index, coll);
}
else {
return false;
}
|
public void | beforeInitialize(org.hibernate.persister.collection.CollectionPersister persister, int anticipatedSize)
this.list = ( List ) persister.getCollectionType().instantiate( anticipatedSize );
|
public void | clear()
if ( isClearQueueEnabled() ) {
queueOperation( new Clear() );
}
else {
initialize( true );
if ( ! list.isEmpty() ) {
list.clear();
dirty();
}
}
|
public boolean | contains(java.lang.Object object)
Boolean exists = readElementExistence(object);
return exists==null ?
list.contains(object) :
exists.booleanValue();
|
public boolean | containsAll(java.util.Collection coll)
read();
return list.containsAll(coll);
|
public java.io.Serializable | disassemble(org.hibernate.persister.collection.CollectionPersister persister)
int length = list.size();
Serializable[] result = new Serializable[length];
for ( int i=0; i<length; i++ ) {
result[i] = persister.getElementType().disassemble( list.get(i), getSession(), null );
}
return result;
|
public boolean | empty()
return list.isEmpty();
|
public java.util.Iterator | entries(org.hibernate.persister.collection.CollectionPersister persister)
return list.iterator();
|
public boolean | entryExists(java.lang.Object entry, int i)
return entry!=null;
|
public boolean | equals(java.lang.Object other)
read();
return list.equals(other);
|
public boolean | equalsSnapshot(org.hibernate.persister.collection.CollectionPersister persister)
Type elementType = persister.getElementType();
List sn = (List) getSnapshot();
if ( sn.size()!=this.list.size() ) return false;
Iterator iter = list.iterator();
Iterator sniter = sn.iterator();
while ( iter.hasNext() ) {
if ( elementType.isDirty( iter.next(), sniter.next(), getSession() ) ) return false;
}
return true;
|
public java.lang.Object | get(int index)
if (index<0) {
throw new ArrayIndexOutOfBoundsException("negative index");
}
Object result = readElementByIndex( new Integer(index) );
return result==UNKNOWN ? list.get(index) : result;
|
public java.util.Iterator | getDeletes(org.hibernate.persister.collection.CollectionPersister persister, boolean indexIsFormula)
List deletes = new ArrayList();
List sn = (List) getSnapshot();
int end;
if ( sn.size() > list.size() ) {
for ( int i=list.size(); i<sn.size(); i++ ) {
deletes.add( indexIsFormula ? sn.get(i) : new Integer(i) );
}
end = list.size();
}
else {
end = sn.size();
}
for ( int i=0; i<end; i++ ) {
if ( list.get(i)==null && sn.get(i)!=null ) {
deletes.add( indexIsFormula ? sn.get(i) : new Integer(i) );
}
}
return deletes.iterator();
|
public java.lang.Object | getElement(java.lang.Object entry)
return entry;
|
public java.lang.Object | getIndex(java.lang.Object entry, int i, org.hibernate.persister.collection.CollectionPersister persister)
return new Integer(i);
|
public java.util.Collection | getOrphans(java.io.Serializable snapshot, java.lang.String entityName)
List sn = (List) snapshot;
return getOrphans( sn, list, entityName, getSession() );
|
public java.io.Serializable | getSnapshot(org.hibernate.persister.collection.CollectionPersister persister)
EntityMode entityMode = getSession().getEntityMode();
ArrayList clonedList = new ArrayList( list.size() );
Iterator iter = list.iterator();
while ( iter.hasNext() ) {
Object deepCopy = persister.getElementType()
.deepCopy( iter.next(), entityMode, persister.getFactory() );
clonedList.add( deepCopy );
}
return clonedList;
|
public java.lang.Object | getSnapshotElement(java.lang.Object entry, int i)
final List sn = (List) getSnapshot();
return sn.get(i);
|
public int | hashCode()
read();
return list.hashCode();
|
public int | indexOf(java.lang.Object value)
read();
return list.indexOf(value);
|
public void | initializeFromCache(org.hibernate.persister.collection.CollectionPersister persister, java.io.Serializable disassembled, java.lang.Object owner)
Serializable[] array = ( Serializable[] ) disassembled;
int size = array.length;
beforeInitialize( persister, size );
for ( int i = 0; i < size; i++ ) {
list.add( persister.getElementType().assemble( array[i], getSession(), owner ) );
}
|
public boolean | isEmpty()
return readSize() ? getCachedSize()==0 : list.isEmpty();
|
public boolean | isSnapshotEmpty(java.io.Serializable snapshot)
return ( (Collection) snapshot ).isEmpty();
|
public boolean | isWrapper(java.lang.Object collection)
return list==collection;
|
public java.util.Iterator | iterator()
read();
return new IteratorProxy( list.iterator() );
|
public int | lastIndexOf(java.lang.Object value)
read();
return list.lastIndexOf(value);
|
public java.util.ListIterator | listIterator()
read();
return new ListIteratorProxy( list.listIterator() );
|
public java.util.ListIterator | listIterator(int index)
read();
return new ListIteratorProxy( list.listIterator(index) );
|
public boolean | needsInserting(java.lang.Object entry, int i, org.hibernate.type.Type elemType)
final List sn = (List) getSnapshot();
return list.get(i)!=null && ( i >= sn.size() || sn.get(i)==null );
|
public boolean | needsUpdating(java.lang.Object entry, int i, org.hibernate.type.Type elemType)
final List sn = (List) getSnapshot();
return i<sn.size() && sn.get(i)!=null && list.get(i)!=null &&
elemType.isDirty( list.get(i), sn.get(i), getSession() );
|
public java.lang.Object | readFrom(java.sql.ResultSet rs, org.hibernate.persister.collection.CollectionPersister persister, org.hibernate.loader.CollectionAliases descriptor, java.lang.Object owner)
Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() ) ;
int index = ( (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() ) ).intValue();
//pad with nulls from the current last element up to the new index
for ( int i = list.size(); i<=index; i++) {
list.add(i, null);
}
list.set(index, element);
return element;
|
public boolean | remove(java.lang.Object value)
Boolean exists = isPutQueueEnabled() ? readElementExistence(value) : null;
if ( exists == null ) {
initialize( true );
if ( list.remove( value ) ) {
dirty();
return true;
}
else {
return false;
}
}
else if ( exists.booleanValue() ) {
queueOperation( new SimpleRemove(value) );
return true;
}
else {
return false;
}
|
public java.lang.Object | remove(int index)
if (index<0) {
throw new ArrayIndexOutOfBoundsException("negative index");
}
Object old = isPutQueueEnabled() ?
readElementByIndex( new Integer(index) ) : UNKNOWN;
if ( old==UNKNOWN ) {
write();
return list.remove(index);
}
else {
queueOperation( new Remove(index, old) );
return old;
}
|
public boolean | removeAll(java.util.Collection coll)
if ( coll.size()>0 ) {
initialize( true );
if ( list.removeAll( coll ) ) {
dirty();
return true;
}
else {
return false;
}
}
else {
return false;
}
|
public boolean | retainAll(java.util.Collection coll)
initialize( true );
if ( list.retainAll( coll ) ) {
dirty();
return true;
}
else {
return false;
}
|
public java.lang.Object | set(int index, java.lang.Object value)
if (index<0) {
throw new ArrayIndexOutOfBoundsException("negative index");
}
Object old = isPutQueueEnabled() ? readElementByIndex( new Integer(index) ) : UNKNOWN;
if ( old==UNKNOWN ) {
write();
return list.set(index, value);
}
else {
queueOperation( new Set(index, value, old) );
return old;
}
|
public int | size()
return readSize() ? getCachedSize() : list.size();
|
public java.util.List | subList(int from, int to)
read();
return new ListProxy( list.subList(from, to) );
|
public java.lang.Object[] | toArray()
read();
return list.toArray();
|
public java.lang.Object[] | toArray(java.lang.Object[] array)
read();
return list.toArray(array);
|
public java.lang.String | toString()
read();
return list.toString();
|