SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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.
 
Method Summary
 boolean add(Object obj)
           
 boolean contains(Object obj)
           
(package private)  boolean isIdentity()
           
 Iterator iterator()
           
 boolean remove(Object obj)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray
 

Field Detail

_map

Map _map
Constructor Detail

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.
Method Detail

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()

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.