|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.util.PropertiesMap
public class 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/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
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<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entrySet()
EntrySet (not implemented, returns null) |
java.lang.String |
get(java.lang.Object obj)
Get a given object |
boolean |
isEmpty()
Return true if the Map is empty |
java.util.Set<java.lang.String> |
keySet()
Return the set of keys |
void |
load(java.lang.String fileName)
|
java.lang.String |
put(java.lang.String n,
java.lang.String 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.String |
remove(java.lang.Object obj)
Remove a given object |
int |
size()
Return the number of entries in the Map |
java.util.Collection<java.lang.String> |
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<java.lang.String,java.lang.String>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,java.lang.String>
public boolean containsKey(java.lang.Object obj)
containsKey
in interface java.util.Map<java.lang.String,java.lang.String>
public boolean containsValue(java.lang.Object obj)
containsValue
in interface java.util.Map<java.lang.String,java.lang.String>
public java.lang.String get(java.lang.Object obj)
get
in interface java.util.Map<java.lang.String,java.lang.String>
public java.lang.String put(java.lang.String n, java.lang.String v)
put
in interface java.util.Map<java.lang.String,java.lang.String>
public java.lang.String remove(java.lang.Object obj)
remove
in interface java.util.Map<java.lang.String,java.lang.String>
public void putAll(java.util.Map map)
putAll
in interface java.util.Map<java.lang.String,java.lang.String>
public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.String>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,java.lang.String>
public java.util.Collection<java.lang.String> values()
values
in interface java.util.Map<java.lang.String,java.lang.String>
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.String>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |