serp.util
Class MapSet
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractSet
|
+--serp.util.MapSet
- All Implemented Interfaces:
- Collection, Set
- public class MapSet
- extends AbstractSet
Set implementation that uses any given map for internal storage. The
set will take on all the properties of the given map. For example,
if given an IdentityMap
, the set will allow two elements
that are the same according to their Object.equals(java.lang.Object)
method but have
different JVM identities. Or if a LinkedHashMap
is used, elements
will be kept in insertion order. The map used must be able to take
null values.
Field Summary |
(package private) Map |
_map
|
Constructor Summary |
MapSet()
Equivalent to MapSet (new HashMap ()) . |
MapSet(Map map)
Construct a MapSet with the given interal map. |
_map
Map _map
MapSet
public MapSet()
- Equivalent to
MapSet (new HashMap ())
.
- See Also:
MapSet(Map)
MapSet
public MapSet(Map map)
- Construct a MapSet with the given interal map. The internal
map will be cleared. It should not be accessed in any way after being
given to this constructor; this set will 'inherit' its behavior,
however. For example, if the given map is a
LinkedHashMap
,
the iterator()
of this set will return values in
insertion order.
size
public int size()
- Overrides:
size
in class AbstractCollection
add
public boolean add(Object obj)
- Overrides:
add
in class AbstractCollection
remove
public boolean remove(Object obj)
- Overrides:
remove
in class AbstractCollection
contains
public boolean contains(Object obj)
- Overrides:
contains
in class AbstractCollection
iterator
public Iterator iterator()
- Overrides:
iterator
in class AbstractCollection
isIdentity
boolean isIdentity()
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.