|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.util.PropertiesMap
PropertiesMap -- a Map that loads from a Properties file, but unlike Properties, preserves the ordering of the original file.
Written mainly as a demonstration of building a simple Map implementation from scratch, but useful when order matters and yet you want the convenience of Map acccess.
Nested Class Summary |
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
Constructor Summary | |
PropertiesMap()
|
Method Summary | |
void |
clear()
Discard all object references held in the collection, i.e., reset to its initial state. |
boolean |
containsKey(java.lang.Object obj)
Return true if the given object is contained as a Key |
boolean |
containsValue(java.lang.Object obj)
Return true if the given object is contained as a Value |
java.util.Set |
entrySet()
EntrySet (not implemented, returns null) |
java.lang.Object |
get(java.lang.Object obj)
Get a given object |
boolean |
isEmpty()
Return true if the Map is empty |
java.util.Set |
keySet()
Return the set of keys |
void |
load(java.lang.String fileName)
|
java.lang.Object |
put(java.lang.Object n,
java.lang.Object v)
Add a given object into this Map. |
void |
putAll(java.util.Map map)
Merge all the values from another map into this map. |
java.lang.Object |
remove(java.lang.Object obj)
Remove a given object |
int |
size()
Return the number of entries in the Map |
java.util.Collection |
values()
Return a Collection containing the values |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Constructor Detail |
public PropertiesMap()
Method Detail |
public void load(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean containsKey(java.lang.Object obj)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object obj)
containsValue
in interface java.util.Map
public java.lang.Object get(java.lang.Object obj)
get
in interface java.util.Map
public java.lang.Object put(java.lang.Object n, java.lang.Object v)
put
in interface java.util.Map
public java.lang.Object remove(java.lang.Object obj)
remove
in interface java.util.Map
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |