org.deckfour.xes.model.buffered
Class XAbstractAttributeMapBufferedImpl

java.lang.Object
  extended by org.deckfour.xes.model.buffered.XAbstractAttributeMapBufferedImpl
All Implemented Interfaces:
Cloneable, Map<String,XAttribute>, XAttributeMap
Direct Known Subclasses:
XAttributeMapBufferedImpl

public abstract class XAbstractAttributeMapBufferedImpl
extends Object
implements XAttributeMap

NikeFS2 virtual file system storage-based implementation for the XAttributeMap interface. Makes it possible to store maps of attributes on disk memory, transparent to the user and the using application.

Author:
Christian W. Guenther (christian@deckfour.org)

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
protected XAbstractAttributeMapBufferedImpl(NikeFS2StorageProvider provider, XAttributeMapSerializer serializer)
          Creates a new attribute map.
protected XAbstractAttributeMapBufferedImpl(XAttributeMapSerializer serializer)
          Creates a new attribute map.
 
Method Summary
 void clear()
           
 Object clone()
          Creates a clone, i.e.
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
protected  XAttributeMap deserialize()
          Retrieves a quick-access representation of this attribute map for actual usage.
 Set<Map.Entry<String,XAttribute>> entrySet()
           
 boolean equals(Object obj)
           
protected  void finalize()
           
 XAttribute get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 XAttribute put(String key, XAttribute value)
           
 void putAll(Map<? extends String,? extends XAttribute> t)
           
 XAttribute remove(Object key)
           
protected  void serialize(XAttributeMap map)
          Serializes the given attribute map to a disk-buffered representation.
 int size()
           
 String toString()
           
 Collection<XAttribute> values()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XAbstractAttributeMapBufferedImpl

protected XAbstractAttributeMapBufferedImpl(XAttributeMapSerializer serializer)
Creates a new attribute map.

Parameters:
serializer - The serializer used to serialize this attribute map.

XAbstractAttributeMapBufferedImpl

protected XAbstractAttributeMapBufferedImpl(NikeFS2StorageProvider provider,
                                            XAttributeMapSerializer serializer)
Creates a new attribute map.

Parameters:
provider - Storage provider to use for serialization.
serializer - The serializer used to serialize this attribute map.
Method Detail

deserialize

protected XAttributeMap deserialize()
                             throws IOException
Retrieves a quick-access representation of this attribute map for actual usage. De-buffers the attribute map and creates an in-memory representation which should be discarded after use to free memory.

Returns:
In-memory copy of this attribute map.
Throws:
IOException

serialize

protected void serialize(XAttributeMap map)
                  throws IOException
Serializes the given attribute map to a disk-buffered representation.

Parameters:
map - Attribute map to be serialized.
Throws:
IOException

clear

public void clear()
Specified by:
clear in interface Map<String,XAttribute>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,XAttribute>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,XAttribute>

entrySet

public Set<Map.Entry<String,XAttribute>> entrySet()
Specified by:
entrySet in interface Map<String,XAttribute>

get

public XAttribute get(Object key)
Specified by:
get in interface Map<String,XAttribute>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,XAttribute>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,XAttribute>

put

public XAttribute put(String key,
                      XAttribute value)
Specified by:
put in interface Map<String,XAttribute>

putAll

public void putAll(Map<? extends String,? extends XAttribute> t)
Specified by:
putAll in interface Map<String,XAttribute>

remove

public XAttribute remove(Object key)
Specified by:
remove in interface Map<String,XAttribute>

size

public int size()
Specified by:
size in interface Map<String,XAttribute>

values

public Collection<XAttribute> values()
Specified by:
values in interface Map<String,XAttribute>

clone

public Object clone()
Creates a clone, i.e. deep copy, of this attribute map.

Specified by:
clone in interface XAttributeMap
Overrides:
clone in class Object
Returns:
An identical clone of the attribute map.

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map<String,XAttribute>
Overrides:
equals in class Object

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<String,XAttribute>
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object