Class XAbstractAttributeMapBufferedImpl

  • All Implemented Interfaces:
    java.lang.Cloneable, java.util.Map<java.lang.String,​XAttribute>, XAttributeMap
    Direct Known Subclasses:
    XAttributeMapBufferedImpl

    public abstract class XAbstractAttributeMapBufferedImpl
    extends java.lang.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)
    • 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 java.io.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:
        java.io.IOException
      • serialize

        protected void serialize​(XAttributeMap map)
                          throws java.io.IOException
        Serializes the given attribute map to a disk-buffered representation.
        Parameters:
        map - Attribute map to be serialized.
        Throws:
        java.io.IOException
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<java.lang.String,​XAttribute>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​XAttribute>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<java.lang.String,​XAttribute>
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​XAttribute>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​XAttribute>
      • get

        public XAttribute get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​XAttribute>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​XAttribute>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.util.Map<java.lang.String,​XAttribute>
      • put

        public XAttribute put​(java.lang.String key,
                              XAttribute value)
        Specified by:
        put in interface java.util.Map<java.lang.String,​XAttribute>
      • putAll

        public void putAll​(java.util.Map<? extends java.lang.String,​? extends XAttribute> t)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​XAttribute>
      • remove

        public XAttribute remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​XAttribute>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​XAttribute>
      • values

        public java.util.Collection<XAttribute> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​XAttribute>
      • clone

        public java.lang.Object clone()
        Creates a clone, i.e. deep copy, of this attribute map.
        Specified by:
        clone in interface XAttributeMap
        Overrides:
        clone in class java.lang.Object
        Returns:
        An identical clone of the attribute map.
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Map<java.lang.String,​XAttribute>
        Overrides:
        equals in class java.lang.Object
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​XAttribute>
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object