| java.lang.Object org.cougaar.util.ArrayMap
All known Subclasses: org.cougaar.util.PropertyTree,
ArrayMap | public class ArrayMap implements Map,Cloneable,java.io.Serializable(Code) | | An implementation of Map that maintains the elements in
the order they were added, as opposed to the random order of a
HashMap .
An ArrayMap is a Map, and can be used exactly like a typical Map.
The most significant differences are that
- The elements are kept in the order that they are added.
- One can restrict the (key, value) types by overriding
createEntry(Object key, Object value).
- There are index-based "getters", such as getKey(int).
See Also: java.util.Map |
ArrayMap | public ArrayMap(int initialCapacity)(Code) | | |
ArrayMap | public ArrayMap()(Code) | | |
clear | public void clear()(Code) | | |
containsValue | public boolean containsValue(Object value)(Code) | | |
get | public Map.Entry get(int index)(Code) | | Get the Map.Entry at the specifed offset of the
entrySet().iterator().
Map s typically don't define an indexable ordering.
However, an ArrayMap is defined to be sorted in the
order that the elements were added, so let's make this function
available.
|
isEmpty | public boolean isEmpty()(Code) | | |
isWrappedPrimitive | final public static boolean isWrappedPrimitive(Object o)(Code) | | Helper utility for createEntry to see if an
Object represents a wrapped Java primitive:
Boolean
Character
Byte
Short
Integer
Long
Float
Double
Void
.
true if the given Object is a wrapped Java primitive |
trimToSize | public void trimToSize()(Code) | | |
|
|