Methods Summary |
---|
public void | add(java.lang.Object obj)
if ( DEBUG ){
list.add( new Object[]{ obj.getClass(), new WeakReference( obj )});
}else{
list.add( obj );
}
|
public boolean | contains(java.lang.Object obj)
if ( DEBUG ){
Iterator it = list.iterator();
while( it.hasNext()){
Object[] entry = (Object[])it.next();
WeakReference wr = (WeakReference)entry[1];
Object target = wr.get();
if ( target == null ){
it.remove();
logRemoved((Class)entry[0]);
}else if ( target == obj ){
return( true );
}
}
return( false );
}else{
return( list.contains( obj ));
}
|
public int | estimatedSize()
return( list.size());
|
public java.util.Iterator | iterator()
if ( DEBUG ){
return( new WeakListIterator());
}else{
return( list.iterator());
}
|
protected void | logRemoved(java.lang.Class cla)
Debug.out( "Object '" + cla + "' was not removed correctly from " + name );
|
public void | remove(java.lang.Object obj)
if ( DEBUG ){
Iterator it = list.iterator();
while( it.hasNext()){
Object[] entry = (Object[])it.next();
WeakReference wr = (WeakReference)entry[1];
Object target = wr.get();
if ( target == null ){
it.remove();
logRemoved((Class)entry[0]);
}else if ( target == obj ){
it.remove();
return;
}
}
}else{
list.remove( obj );
}
|