xxl.collections
Class DecoratorContainer

java.lang.Object
  |
  +--xxl.collections.Container
        |
        +--xxl.collections.DecoratorContainer
Direct Known Subclasses:
BufferedContainer, ConverterContainer, CounterContainer

public abstract class DecoratorContainer
extends Container

Abstract class following the Decorator design pattern.


Field Summary
protected  Container container
           
 
Fields inherited from class xxl.collections.Container
FACTORY_METHOD
 
Constructor Summary
DecoratorContainer(Container container)
           
 
Method Summary
 void clear()
          Removes all elements from the Container.
 void close()
          Closes the Container.
 boolean contains(java.lang.Object id)
          Returns true if the Continaer contains an object for the given Id.
 void flush()
          Flushes all buffered elements into the container
 java.lang.Object get(java.lang.Object id, boolean unfix)
          Returns the Object with the given Id.
 java.util.Iterator ids()
          Returns a Cursor pointing to the ids of this Container.
 java.lang.Object insert(java.lang.Object object, boolean unfix)
          Inserts an Object into this Container.
 void remove(java.lang.Object id)
          Removes the Object with the given Id.
 int size()
          Returns the number of elements of this Container.
 void unfix(java.lang.Object id)
          Unfixes the Object with the given Id.
 void update(java.lang.Object id, java.lang.Object object, boolean unfix)
          Updates an existing (id,*)-entry with (id,object).
 
Methods inherited from class xxl.collections.Container
flush, get, getAll, getAll, insert, insertAll, insertAll, objects, removeAll, unfixAll, update, updateAll, updateAll, updateAll, updateAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected Container container
Constructor Detail

DecoratorContainer

public DecoratorContainer(Container container)
Method Detail

clear

public void clear()
Removes all elements from the Container.
Overrides:
clear in class Container

close

public void close()
Closes the Container.
Overrides:
close in class Container

contains

public boolean contains(java.lang.Object id)
Returns true if the Continaer contains an object for the given Id.
Overrides:
contains in class Container

flush

public void flush()
Flushes all buffered elements into the container
Overrides:
flush in class Container

get

public java.lang.Object get(java.lang.Object id,
                            boolean unfix)
                     throws java.util.NoSuchElementException
Returns the Object with the given Id.
Overrides:
get in class Container

ids

public java.util.Iterator ids()
Returns a Cursor pointing to the ids of this Container.
Overrides:
ids in class Container

insert

public java.lang.Object insert(java.lang.Object object,
                               boolean unfix)
Inserts an Object into this Container.
Returns:
the Id of the Object is returned
Overrides:
insert in class Container

remove

public void remove(java.lang.Object id)
            throws java.util.NoSuchElementException
Removes the Object with the given Id.
Overrides:
remove in class Container

size

public int size()
Returns the number of elements of this Container.
Overrides:
size in class Container

unfix

public void unfix(java.lang.Object id)
           throws java.util.NoSuchElementException
Unfixes the Object with the given Id.
Overrides:
unfix in class Container

update

public void update(java.lang.Object id,
                   java.lang.Object object,
                   boolean unfix)
            throws java.util.NoSuchElementException
Updates an existing (id,*)-entry with (id,object).
Parameters:
id - the id of the entry
object - the new Object for that entry
Overrides:
update in class Container