org.jrdf.graph.local.mem
Class AbstractUnorderedContainer
java.lang.Object
org.jrdf.graph.local.mem.AbstractUnorderedContainer
- All Implemented Interfaces:
- Iterable<ObjectNode>, Collection<ObjectNode>, Container
- Direct Known Subclasses:
- AlternativeImpl, BagImpl
public abstract class AbstractUnorderedContainer
- extends Object
- implements Container
The base class for the implementation of Bag and Alternative.
- Version:
- $Revision: 1804 $
- Author:
- Andrew Newman
Field Summary |
protected Map<Long,ObjectNode> |
elements
The hashmap containing the elements. |
protected long |
key
Counter used to generate keys to add to the hashmap. |
elements
protected final Map<Long,ObjectNode> elements
- The hashmap containing the elements.
key
protected long key
- Counter used to generate keys to add to the hashmap.
AbstractUnorderedContainer
public AbstractUnorderedContainer()
add
public boolean add(ObjectNode o)
- Specified by:
add
in interface Collection<ObjectNode>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<ObjectNode>
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection<ObjectNode>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interface Collection<ObjectNode>
addAll
public boolean addAll(Collection<? extends ObjectNode> c)
throws IllegalArgumentException
- Specified by:
addAll
in interface Collection<ObjectNode>
- Throws:
IllegalArgumentException
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interface Collection<ObjectNode>
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interface Collection<ObjectNode>
iterator
public Iterator<ObjectNode> iterator()
- Specified by:
iterator
in interface Iterable<ObjectNode>
- Specified by:
iterator
in interface Collection<ObjectNode>
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection<ObjectNode>
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interface Collection<ObjectNode>
size
public int size()
- Specified by:
size
in interface Collection<ObjectNode>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection<ObjectNode>
clear
public void clear()
- Specified by:
clear
in interface Collection<ObjectNode>
hashCode
public int hashCode()
- Specified by:
hashCode
in interface Collection<ObjectNode>
- Overrides:
hashCode
in class Object