| java.lang.Object org.apache.commons.collections.bidimap.AbstractDualBidiMap
All known Subclasses: org.apache.commons.collections.bidimap.DualHashBidiMap, org.apache.commons.collections.bidimap.DualTreeBidiMap,
AbstractDualBidiMap | abstract public class AbstractDualBidiMap implements BidiMap(Code) | | Abstract BidiMap implemented using two maps.
An implementation can be written simply by implementing the
createMap method.
See Also: DualHashBidiMap See Also: DualTreeBidiMap since: Commons Collections 3.0 version: $Id: AbstractDualBidiMap.java 155406 2005-02-26 12:55:26Z dirkv $ author: Matthew Hawthorne author: Stephen Colebourne |
Inner Class :protected static class KeySet extends View implements Set | |
Inner Class :protected static class Values extends View implements Set | |
Inner Class :protected static class EntrySet extends View implements Set | |
Constructor Summary | |
protected | AbstractDualBidiMap() Creates an empty map, initialised by createMap . | protected | AbstractDualBidiMap(Map normalMap, Map reverseMap) Creates an empty map using the two maps specified as storage. | protected | AbstractDualBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap) Constructs a map that decorates the specified maps,
used by the subclass createBidiMap implementation. |
entrySet | protected transient Set entrySet(Code) | | View of the entries.
|
inverseBidiMap | protected transient BidiMap inverseBidiMap(Code) | | Inverse view of this map.
|
keySet | protected transient Set keySet(Code) | | View of the keys.
|
maps | final protected transient Map[] maps(Code) | | Delegate map array. The first map contains standard entries, and the
second contains inverses.
|
AbstractDualBidiMap | protected AbstractDualBidiMap(Map normalMap, Map reverseMap)(Code) | | Creates an empty map using the two maps specified as storage.
The two maps must be a matching pair, normal and reverse.
They will typically both be empty.
Neither map is validated, so nulls may be passed in.
If you choose to do this then the subclass constructor must populate
the maps[] instance variable itself.
Parameters: normalMap - the normal direction map Parameters: reverseMap - the reverse direction map since: Commons Collections 3.1 |
AbstractDualBidiMap | protected AbstractDualBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap)(Code) | | Constructs a map that decorates the specified maps,
used by the subclass createBidiMap implementation.
Parameters: normalMap - the normal direction map Parameters: reverseMap - the reverse direction map Parameters: inverseBidiMap - the inverse BidiMap |
clear | public void clear()(Code) | | |
containsValue | public boolean containsValue(Object value)(Code) | | |
createBidiMap | abstract protected BidiMap createBidiMap(Map normalMap, Map reverseMap, BidiMap inverseMap)(Code) | | Creates a new instance of the subclass.
Parameters: normalMap - the normal direction map Parameters: reverseMap - the reverse direction map Parameters: inverseMap - this map, which is the inverse in the new map the inverse map |
createEntrySetIterator | protected Iterator createEntrySetIterator(Iterator iterator)(Code) | | Creates an entry set iterator.
Subclasses can override this to return iterators with different properties.
Parameters: iterator - the iterator to decorate the entrySet iterator |
createKeySetIterator | protected Iterator createKeySetIterator(Iterator iterator)(Code) | | Creates a key set iterator.
Subclasses can override this to return iterators with different properties.
Parameters: iterator - the iterator to decorate the keySet iterator |
createMap | protected Map createMap()(Code) | | Creates a new instance of the map used by the subclass to store data.
This design is deeply flawed and has been deprecated.
It relied on subclass data being used during a superclass constructor.
the map to be used for internal storage |
createValuesIterator | protected Iterator createValuesIterator(Iterator iterator)(Code) | | Creates a values iterator.
Subclasses can override this to return iterators with different properties.
Parameters: iterator - the iterator to decorate the values iterator |
entrySet | public Set entrySet()(Code) | | Gets an entrySet view of the map.
Changes made on the set are reflected in the map.
The set supports remove and clear but not add.
The Map Entry setValue() method only allow a new value to be set.
If the value being set is already in the map, an IllegalArgumentException
is thrown (as setValue cannot change the size of the map).
the entrySet view |
hashCode | public int hashCode()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | |
keySet | public Set keySet()(Code) | | Gets a keySet view of the map.
Changes made on the view are reflected in the map.
The set supports remove and clear but not add.
the keySet view |
mapIterator | public MapIterator mapIterator()(Code) | | Obtains a MapIterator over the map.
The iterator implements ResetableMapIterator .
This implementation relies on the entrySet iterator.
The setValue() methods only allow a new value to be set.
If the value being set is already in the map, an IllegalArgumentException
is thrown (as setValue cannot change the size of the map).
a map iterator |
values | public Collection values()(Code) | | Gets a values view of the map.
Changes made on the view are reflected in the map.
The set supports remove and clear but not add.
the values view |
|
|