Package org.deckfour.xes.model.impl
Class XAttributeMapLazyImpl<T extends XAttributeMap>
- java.lang.Object
-
- org.deckfour.xes.model.impl.XAttributeMapLazyImpl<T>
-
- All Implemented Interfaces:
java.lang.Cloneable,java.util.Map<java.lang.String,XAttribute>,XAttributeMap
public class XAttributeMapLazyImpl<T extends XAttributeMap> extends java.lang.Object implements XAttributeMap
Lazy implementation of the XAttributeMap interface. This implementation serves as a proxy for an XAttributeMapImpl instance, which is initially not present. Once the attribute map is to be filled with values, the true backing XAttributeMapImpl instance will be created on the fly, and used for storing and accessing data transparently. This lazy instantiation prevents lots of initializations of real attribute maps, since a large amount of attributes do not have any meta-attributes. This class is a generic, and can be parametrized with the actual implementation for the backing storage, which will then be instantiated on demand. Note that you will also have to pass the Class object of this implementation to the constructor, since this is required for instantiation (by Java).- Author:
- Christian W. Guenther (christian@deckfour.org)
-
-
Constructor Summary
Constructors Constructor Description XAttributeMapLazyImpl(java.lang.Class<T> implementingClass)Creates a new lazy attribute map instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()java.lang.Objectclone()Creates a clone, i.e.booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<java.lang.String,XAttribute>>entrySet()XAttributeget(java.lang.Object key)java.lang.Class<T>getBackingStoreClass()Returns the class used for implementing the backing store.booleanisEmpty()java.util.Set<java.lang.String>keySet()XAttributeput(java.lang.String key, XAttribute value)voidputAll(java.util.Map<? extends java.lang.String,? extends XAttribute> t)XAttributeremove(java.lang.Object key)intsize()java.util.Collection<XAttribute>values()
-
-
-
Constructor Detail
-
XAttributeMapLazyImpl
public XAttributeMapLazyImpl(java.lang.Class<T> implementingClass)
Creates a new lazy attribute map instance.- Parameters:
implementingClass- Class which should be used for instantiating the backing storage.
-
-
Method Detail
-
getBackingStoreClass
public java.lang.Class<T> getBackingStoreClass()
Returns the class used for implementing the backing store.- Returns:
- The class used for implementing the backing store.
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map<java.lang.String,XAttribute>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfacejava.util.Map<java.lang.String,XAttribute>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map<java.lang.String,XAttribute>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,XAttribute>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map<java.lang.String,XAttribute>
-
get
public XAttribute get(java.lang.Object key)
- Specified by:
getin interfacejava.util.Map<java.lang.String,XAttribute>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map<java.lang.String,XAttribute>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySetin interfacejava.util.Map<java.lang.String,XAttribute>
-
put
public XAttribute put(java.lang.String key, XAttribute value)
- Specified by:
putin interfacejava.util.Map<java.lang.String,XAttribute>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends XAttribute> t)
- Specified by:
putAllin interfacejava.util.Map<java.lang.String,XAttribute>
-
remove
public XAttribute remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map<java.lang.String,XAttribute>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map<java.lang.String,XAttribute>
-
values
public java.util.Collection<XAttribute> values()
- Specified by:
valuesin interfacejava.util.Map<java.lang.String,XAttribute>
-
clone
public java.lang.Object clone()
Creates a clone, i.e. deep copy, of this lazy attribute map.- Specified by:
clonein interfaceXAttributeMap- Overrides:
clonein classjava.lang.Object- Returns:
- An identical clone of the attribute map.
-
-