|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.core.foundation.PersistentObject
org.exolab.core.database.recman.PMDTreeMap
public class PMDTreeMap
This is an implementation of the TreeMapIfc for the PMD datastore. The implementation currently uses java.util.TreeMap but this will be changed in a subsequent release to provide a more concurrent capable container and take advantages of this database's features.
TreeMapIfc
,
PersistentObject
,
Serialized FormConstructor Summary | |
---|---|
PMDTreeMap()
Default constructor simply instantiates an instance of a TreeMap |
|
PMDTreeMap(java.util.Comparator comparator)
Construct an instance of a TreeMap with the specified comparator. |
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this TreeMap. |
java.util.Comparator |
comparator()
Returns the comparator used to order this map or null if this map uses natural ordering |
boolean |
containsKey(java.lang.Object key)
Test whether a particular key is mapped to an object in the container. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value. |
java.util.Collection |
elements()
Return an enumeration of all the elements in the map |
java.lang.Object |
firstKey()
Returns the first (lowest) key currently in this sorted map.It throws NoSuchElementException if the element does not exist. |
java.lang.Object |
get(java.lang.Object key)
Returns the value associated with the specified key. |
boolean |
isEmpty()
Test is the map is empty |
java.util.Set |
keySet()
Returns a Set view of the keys contained in this map. |
java.lang.Object |
lastKey()
Returns the last (highest) key currently in this sorted map.It throws NoSuchElementException if the element does not exist. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map. |
void |
readExternal(java.io.ObjectInput stream)
|
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this TreeMap if present.If the key cannot be compared to other values in the map then thorw the Class- castExcpetion. |
int |
size()
Returns the number of key-value mappings in this map. |
java.util.SortedMap |
sortedMap()
Returns the internal TreeMap |
java.util.SortedMap |
tailMap(java.lang.Object key)
Returns a view of the portion of this map whose keys are greater than or equal to fromKey. |
void |
writeExternal(java.io.ObjectOutput stream)
|
Methods inherited from class org.exolab.core.foundation.PersistentObject |
---|
clone, equals, getId, getMinimumObjectSize, getObjectId, getObjectVersion, getVersion, setId, setMinimumObjectSize, setObjectId, setObjectVersion, setVersion |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.exolab.core.foundation.PersistentCapableIfc |
---|
getMinimumObjectSize, getObjectId, getObjectVersion, setMinimumObjectSize |
Constructor Detail |
---|
public PMDTreeMap()
public PMDTreeMap(java.util.Comparator comparator)
comparator
- used for orderingMethod Detail |
---|
public int size()
size
in interface TreeMapIfc
public boolean containsKey(java.lang.Object key)
containsKey
in interface TreeMapIfc
key
- key whose value to find
java.lang.ClassCastException
java.lang.NullPointerException
public boolean containsValue(java.lang.Object value)
containsValue
in interface TreeMapIfc
value
- test for this value
public java.lang.Object get(java.lang.Object key)
get
in interface TreeMapIfc
key
- key whose value to find
java.lang.ClassCastException
java.lang.NullPointerException
public java.util.Comparator comparator()
comparator
in interface TreeMapIfc
public java.lang.Object firstKey()
firstKey
in interface TreeMapIfc
NoSuchElementException
public java.lang.Object lastKey()
lastKey
in interface TreeMapIfc
NoSuchElementException
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
If the key cannot be compared with other keys in the map it will throw the ClassCastException. Similarly, if the key is null and the map uses natural ordering or its comparator cannot tolerate null keys throw the NullPointerException
put
in interface TreeMapIfc
key
- key objectvalue
- value object
java.lang.ClassCastException
java.lang.NullPointerException
public java.lang.Object remove(java.lang.Object key)
remove
in interface TreeMapIfc
key
- key whose value to remove
ClassCastEzception
java.lang.NullPointerException
public void clear()
clear
in interface TreeMapIfc
public java.util.Set keySet()
keySet
in interface TreeMapIfc
public boolean isEmpty()
isEmpty
in interface TreeMapIfc
public java.util.Collection elements()
elements
in interface TreeMapIfc
public java.util.SortedMap tailMap(java.lang.Object key)
tailMap
in interface TreeMapIfc
id
- The key to compare to.
public java.util.SortedMap sortedMap()
sortedMap
in interface TreeMapIfc
public void writeExternal(java.io.ObjectOutput stream) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class PersistentObject
java.io.IOException
public void readExternal(java.io.ObjectInput stream) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class PersistentObject
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |