|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.richtext.textlayout.attributes.AttributeMap
AttributeMap is an immutable Map. Additionally, there are several methods for common operations (union, remove, intersect); these methods return new AttributeMap instances.
Although any non-null Object can be a key or value in an AttributeMap, typically the keys are fields of TextAttribute.
TextAttribute
, Serialized FormInner classes inherited from class java.util.Map |
java.util.Map.Entry |
Field Summary | |
static AttributeMap |
EMPTY_ATTRIBUTE_MAP
An empty AttributeMap. |
Fields inherited from interface com.ibm.richtext.textlayout.attributes.Map |
COPYRIGHT |
Constructor Summary | |
AttributeMap()
Create a new, empty AttributeMap. |
|
AttributeMap(java.util.Hashtable hashtable)
Create an AttributeMap with the same key-value entries as the given Hashtable. |
|
AttributeMap(java.util.Map map)
Create an AttributeMap with the same key-value entries as the given Map. |
|
AttributeMap(java.lang.Object key,
java.lang.Object value)
Create an AttributeMap with a single entry of {attribute, value} . |
Method Summary | |
AttributeMap |
addAttribute(java.lang.Object key,
java.lang.Object value)
Return a AttributeMap which contains entries in this AttributeMap, along with an entry for |
AttributeMap |
addAttributes(AttributeMap rhs)
Return a AttributeMap which contains entries in this AttributeMap and in rhs. |
AttributeMap |
addAttributes(java.util.Map rhs)
Return a AttributeMap which contains entries in this AttributeMap and in rhs. |
void |
clear()
Throws UnsupportedOperationException. |
boolean |
containsKey(java.lang.Object key)
Return true if the given key is in this AttributeMap. |
boolean |
containsValue(java.lang.Object value)
Return true if the given value is in this AttributeMap. |
java.util.Set |
entrySet()
Return a Set containing all entries in this AttributeMap. |
boolean |
equals(java.lang.Object rhs)
|
java.lang.Object |
get(java.lang.Object key)
Return the value associated with the given key. |
AttributeSet |
getKeySet()
Return an AttributeSet containing every key in this AttributeMap. |
int |
hashCode()
|
AttributeMap |
intersectWith(AttributeSet attributes)
Return a AttributeMap with the keys of this AttributeMap which are also in the Set. |
AttributeMap |
intersectWith(java.util.Set attributes)
Return a AttributeMap with the keys of this AttributeMap which are also in the Set. |
boolean |
isEmpty()
Return true if the number of entries in the AttributeMap is 0. |
java.util.Set |
keySet()
Return an AttributeSet containing every key in this AttributeMap. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Throws UnsupportedOperationException. |
void |
putAll(java.util.Map t)
Throws UnsupportedOperationException. |
void |
putAllInto(java.util.Map rhs)
Put all entries in this AttributeMap into the given Map. |
void |
readExternal(java.io.ObjectInput in)
|
java.lang.Object |
remove(java.lang.Object key)
Throws UnsupportedOperationException. |
AttributeMap |
removeAttribute(java.lang.Object attribute)
Return a AttributeMap with the entries in this AttributeMap, but without attribute as a key. |
AttributeMap |
removeAttributes(AttributeSet attributes)
Return a AttributeMap with the entries of this AttributeMap whose attributes are not in the Set. |
AttributeMap |
removeAttributes(java.util.Set attributes)
Return a AttributeMap with the entries of this AttributeMap whose attributes are not in the Set. |
int |
size()
Return the number of entries in the AttributeMap. |
java.lang.String |
toString()
|
java.util.Collection |
values()
Return a Collection containing every value in this AttributeMap. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final AttributeMap EMPTY_ATTRIBUTE_MAP
Constructor Detail |
public AttributeMap()
public AttributeMap(java.util.Map map)
map
- a Map whose key-value entries will
become the entries for this AttributeMap. map
is not modified, and must not contain null keys or values.public AttributeMap(java.util.Hashtable hashtable)
table
- a Hashtable whose key-value entries will
become the entries for this AttributeMap. table
is not modified.public AttributeMap(java.lang.Object key, java.lang.Object value)
{attribute, value}
.attribute
- the key in this AttributeMap's single entryvalue
- the value in this AttributeMap's single entryMethod Detail |
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
key
- the key to testkey
is in this AttributeMappublic boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
key
- the value to testvalue
is in this AttributeMappublic java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
key
- the key to look upkey
, or
null if key
is not in this AttributeMappublic java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
UnsupportedOperationException
- addAttribute(java.lang.Object, java.lang.Object)
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
UnsupportedOperationException
- removeAttributes(com.ibm.richtext.textlayout.attributes.AttributeSet)
public void putAll(java.util.Map t)
putAll
in interface java.util.Map
UnsupportedOperationException
- addAttributes(com.ibm.richtext.textlayout.attributes.AttributeMap)
public void clear()
clear
in interface java.util.Map
UnsupportedOperationException
- EMPTY_ATTRIBUTE_MAP
public java.util.Set keySet()
keySet
in interface java.util.Map
public AttributeSet getKeySet()
public java.util.Collection values()
values
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public boolean equals(java.lang.Object rhs)
equals
in interface java.util.Map
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Map
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public AttributeMap addAttribute(java.lang.Object key, java.lang.Object value)
public AttributeMap addAttributes(AttributeMap rhs)
public AttributeMap addAttributes(java.util.Map rhs)
public AttributeMap removeAttribute(java.lang.Object attribute)
public AttributeMap removeAttributes(AttributeSet attributes)
public AttributeMap removeAttributes(java.util.Set attributes)
public AttributeMap intersectWith(AttributeSet attributes)
public AttributeMap intersectWith(java.util.Set attributes)
public void putAllInto(java.util.Map rhs)
rhs
- the Map into which entries are placed
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |