@ThreadSafe public class MapBasedAttributeContainerThreadSafe extends MapBasedAttributeContainer
MapBasedAttributeContainer!| Modifier and Type | Field and Description |
|---|---|
protected ReadWriteLock |
m_aRWLock |
| Constructor and Description |
|---|
MapBasedAttributeContainerThreadSafe() |
MapBasedAttributeContainerThreadSafe(IReadonlyAttributeContainer aCont) |
MapBasedAttributeContainerThreadSafe(Map<String,?> aMap) |
| Modifier and Type | Method and Description |
|---|---|
EChange |
clear()
Reset the contents of the element to the after-construction state.
|
boolean |
containsAttribute(String sName)
Check if an attribute of the given name is contained.
|
boolean |
containsNoAttribute() |
boolean |
equals(Object o) |
Set<String> |
getAllAttributeNames() |
Map<String,Object> |
getAllAttributes() |
Collection<Object> |
getAllAttributeValues() |
boolean |
getAndSetAttributeFlag(String sName)
Atomic operation to set a flag to
true if it was previously
set to false (meaning not existing). |
int |
getAttributeCount() |
Enumeration<String> |
getAttributeNames()
Get an enumerator over all contained attribute names.
|
Object |
getAttributeObject(String sName)
Get the attribute value associated to the given attribute name.
|
MapBasedAttributeContainerThreadSafe |
getClone() |
int |
hashCode() |
EChange |
removeAttribute(String sName)
Remove the specified attribute from the container.
|
EChange |
setAttribute(String sName,
Object aValue)
Set/overwrite an attribute value.
|
String |
toString() |
onBeforeRemoveAttribute, onBeforeSetAttributeValue, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributesgetAsBoolean, getAsDouble, getAsInt, getAsLong, getAsString, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeprotected final ReadWriteLock m_aRWLock
public MapBasedAttributeContainerThreadSafe()
public MapBasedAttributeContainerThreadSafe(@Nonnull Map<String,?> aMap)
public MapBasedAttributeContainerThreadSafe(@Nonnull IReadonlyAttributeContainer aCont)
public boolean containsAttribute(@Nullable String sName)
IReadonlyAttributeContainercontainsAttribute in interface IReadonlyAttributeContainercontainsAttribute in class MapBasedAttributeContainersName - name of the attribute to checktrue if the attribute is contained, false
otherwise@Nonnull @ReturnsMutableCopy public Map<String,Object> getAllAttributes()
getAllAttributes in interface IReadonlyAttributeContainergetAllAttributes in class MapBasedAttributeContainernull map with all contained attributes.@Nullable public Object getAttributeObject(@Nullable String sName)
IReadonlyAttributeContainergetAttributeObject in interface IReadonlyAttributeContainergetAttributeObject in class MapBasedAttributeContainersName - the attribute namenull if no such value exists@Nonnull public EChange setAttribute(@Nonnull String sName, @Nullable Object aValue)
IAttributeContainersetAttribute in interface IAttributeContainersetAttribute in class MapBasedAttributeContainersName - The name of the attribute. May not be null.aValue - The value of the attribute. If it is null, the value
will be removed.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.IAttributeContainer.removeAttribute(String)@Nonnull public EChange removeAttribute(@Nullable String sName)
IAttributeContainerremoveAttribute in interface IAttributeContainerremoveAttribute in class MapBasedAttributeContainersName - The attribute name to be removed. If it is null nothing
happens.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.@Nonnull @ReturnsMutableCopy public Enumeration<String> getAttributeNames()
IReadonlyAttributeContainergetAttributeNames in interface IReadonlyAttributeContainergetAttributeNames in class MapBasedAttributeContainer@Nonnull @ReturnsMutableCopy public Set<String> getAllAttributeNames()
getAllAttributeNames in interface IReadonlyAttributeContainergetAllAttributeNames in class MapBasedAttributeContainer@Nonnull @ReturnsMutableCopy public Collection<Object> getAllAttributeValues()
getAllAttributeValues in interface IReadonlyAttributeContainergetAllAttributeValues in class MapBasedAttributeContainer@Nonnegative public int getAttributeCount()
getAttributeCount in interface IReadonlyAttributeContainergetAttributeCount in class MapBasedAttributeContainerpublic boolean containsNoAttribute()
containsNoAttribute in interface IReadonlyAttributeContainercontainsNoAttribute in class MapBasedAttributeContainertrue if this attribute container does not contain any
attribute at all, false if at least one attribute is
contained.@Nonnull public EChange clear()
IClearableclear in interface IClearableclear in class MapBasedAttributeContainerEChange.CHANGED if at least one element was cleared,
EChange.UNCHANGED otherwise.public boolean getAndSetAttributeFlag(@Nonnull String sName)
IAttributeContainertrue if it was previously
set to false (meaning not existing). There is no possibility
to define a value for this flag. The value used is Boolean.TRUE.
IReadonlyAttributeContainer.containsAttribute(String) can be used to check if the attribute is
already present.getAndSetAttributeFlag in interface IAttributeContainergetAndSetAttributeFlag in class MapBasedAttributeContainersName - The name of the flag to set.false is returned, whereas if the flag was
already present, true is returned. Any other than the
first call for the same flag is always returning true.@Nonnull public MapBasedAttributeContainerThreadSafe getClone()
getClone in interface ICloneable<MapBasedAttributeContainer>getClone in class MapBasedAttributeContainerpublic boolean equals(Object o)
equals in class MapBasedAttributeContainerpublic int hashCode()
hashCode in class MapBasedAttributeContainerpublic String toString()
toString in class MapBasedAttributeContainerCopyright © 2006–2014 phloc systems. All rights reserved.