|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dasein.util.PseudoMap<String,Object>
org.dasein.attributes.AttributeMap
public class AttributeMap
An immutable mapping of attribute names to values. The main value of this
class over a straight Map is that it is immutable and that it constrains
keys as strings. It is therefore very useful as storage for object attributes so that
you may return the full mapping from method calls without doing any copying.
This class was originally developed for the Simplicis Content Management System in 2003 and moved into an Open Source library in 2006.
Last modified: $Date: 2006/05/03 05:12:49 $
| Nested Class Summary | |
|---|---|
static class |
AttributeMap.AmapEntry
|
static class |
AttributeMap.AttributeWrapper<T>
|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
AttributeMap()
Constructs an empty attribute map. |
|
AttributeMap(Map<String,? extends Object> map)
Constructs an attribute map that is copied from the specified mapping. |
|
AttributeMap(Map<String,? extends Object> map1,
Map<String,? extends Object> map2)
Constructs an attribute map that is copied from two different mappings. |
|
| Method Summary | |
|---|---|
Iterator<String> |
attributes()
|
boolean |
containsKey(Object attr)
|
boolean |
containsValue(Object val)
|
Set<Map.Entry<String,Object>> |
entrySet()
|
boolean |
equals(Object ob)
Compares the selected object. |
Object |
get(Object attr)
|
Object |
getAttribute(String attr)
Deprecated. this is an old method, not sure why it had to be added |
int |
hashCode()
|
boolean |
isEmpty()
|
Set<String> |
keySet()
|
int |
size()
|
String |
toString()
Converts this mapping into a human-readable string. |
Collection<Object> |
values()
|
| Methods inherited from class org.dasein.util.PseudoMap |
|---|
clear, put, putAll, remove |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AttributeMap()
public AttributeMap(Map<String,? extends Object> map)
map - the mapping to copy
public AttributeMap(Map<String,? extends Object> map1,
Map<String,? extends Object> map2)
map1 - the existing mapping valuesmap2 - the new values you wish to add to the original| Method Detail |
|---|
public Iterator<String> attributes()
public boolean containsKey(Object attr)
containsKey in interface Map<String,Object>attr - the name of the attribute being validated
public boolean containsValue(Object val)
containsValue in interface Map<String,Object>val - the name of the value being checked
public Set<Map.Entry<String,Object>> entrySet()
entrySet in interface Map<String,Object>public boolean equals(Object ob)
equals in interface Map<String,Object>equals in class Objectpublic Object get(Object attr)
get in interface Map<String,Object>attr - the name of the attribute to retrieve
public Object getAttribute(String attr)
get(Object).
attr - the name of the desired attribute
public int hashCode()
hashCode in interface Map<String,Object>hashCode in class Objectpublic boolean isEmpty()
isEmpty in interface Map<String,Object>public Set<String> keySet()
keySet in interface Map<String,Object>public int size()
size in interface Map<String,Object>public Collection<Object> values()
values in interface Map<String,Object>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||