org.apache.cayenne.util
Class CayenneMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap
          extended by org.apache.commons.collections.FastTreeMap
              extended by org.apache.cayenne.util.CayenneMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map, java.util.SortedMap

public class CayenneMap
extends org.apache.commons.collections.FastTreeMap

A CayenneMap is a specialized double-linked sorted map class. Attempts to add objects using an already existing keys will result in IllegalArgumentExceptions. Any added entries that implement CayenneMapEntry interface will have their parent set to the parent of this map.

CayenneMap is not subclassed directly, but is rather used as an instance variable within another class. Enclosing instance would set itself as a parent of this map.

Author:
Andrei Adamchik
See Also:
Serialized Form

Field Summary
protected  java.lang.Object parent
           
 
Fields inherited from class org.apache.commons.collections.FastTreeMap
fast, map
 
Constructor Summary
CayenneMap(java.lang.Object parent)
          Constructor for CayenneMap.
CayenneMap(java.lang.Object parent, java.util.Comparator c)
          Constructor for CayenneMap.
CayenneMap(java.lang.Object parent, java.util.Map m)
          Constructor for CayenneMap.
CayenneMap(java.lang.Object parent, java.util.SortedMap m)
          Constructor for CayenneMap.
 
Method Summary
 java.lang.Object getParent()
          Returns the parent.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Maps specified key-value pair.
 void putAll(java.util.Map t)
           
 void setParent(java.lang.Object mapParent)
           
 
Methods inherited from class org.apache.commons.collections.FastTreeMap
clear, clone, comparator, containsKey, containsValue, entrySet, equals, firstKey, get, getFast, hashCode, headMap, isEmpty, keySet, lastKey, remove, setFast, size, subMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected java.lang.Object parent
Constructor Detail

CayenneMap

public CayenneMap(java.lang.Object parent)
Constructor for CayenneMap.


CayenneMap

public CayenneMap(java.lang.Object parent,
                  java.util.Comparator c)
Constructor for CayenneMap.

Parameters:
c -

CayenneMap

public CayenneMap(java.lang.Object parent,
                  java.util.Map m)
Constructor for CayenneMap.

Parameters:
m -

CayenneMap

public CayenneMap(java.lang.Object parent,
                  java.util.SortedMap m)
Constructor for CayenneMap.

Parameters:
m -
Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Maps specified key-value pair. If value is a CayenneMapEntry, sets its parent to this map.

Specified by:
put in interface java.util.Map
Overrides:
put in class org.apache.commons.collections.FastTreeMap
See Also:
Map.put(Object, Object)

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class org.apache.commons.collections.FastTreeMap
See Also:
Map.putAll(Map)

getParent

public java.lang.Object getParent()
Returns the parent.

Returns:
Object

setParent

public void setParent(java.lang.Object mapParent)


Copyright © 2001-2006 Apache.org All Rights Reserved.