Class CanonicalMapImpl

    • Constructor Detail

      • CanonicalMapImpl

        public CanonicalMapImpl​(java.lang.Object aObject)
        Instantiates a new canonical map impl.
        Parameters:
        aObject - the object
      • CanonicalMapImpl

        public CanonicalMapImpl​(java.util.Map<?,?> aProperties)
        Instantiates a new canonical map impl.
        Parameters:
        aProperties - the properties
    • Method Detail

      • containsKey

        public boolean containsKey​(java.lang.Object aKey)
        Tests whether there is an element with the given key.
        Specified by:
        containsKey in interface Keys<java.lang.String,T>
        Parameters:
        aKey - The key for which to test whether there is an element.
        Returns:
        True in case there is an element for the given key.
      • get

        public java.lang.String get​(java.lang.Object aKey)
        Retrieves the element assigned to the given key.
        Specified by:
        get in interface Keys<java.lang.String,T>
        Parameters:
        aKey - The key for which to get the element.
        Returns:
        The column in question or null if there is none such column.
      • keySet

        public java.util.Set<java.lang.String> keySet​()
        Retrieves a collection containing all the keys found in the elements of this collection.
        Specified by:
        keySet in interface Keys<java.lang.String,T>
        Returns:
        A collection with key objects being the keys of all elements in this collection.
      • values

        public java.util.Collection<java.lang.String> values​()
        Returns a Collection view of the values related to the contained keys.
        Specified by:
        values in interface Keys<java.lang.String,T>
        Returns:
        A Collection view of the values related to the contained keys.
      • size

        public int size​()
        Returns the number of data elements contained in the collection.
        Specified by:
        size in interface Containable
        Returns:
        An integer representing the number of items stored in the accumulation.
      • isEmpty

        public boolean isEmpty​()
        Tests whether the accumulation is empty or not. Returns true if the accumulation is empty, else false is returned.
        Specified by:
        isEmpty in interface Containable
        Returns:
        True if no element is contained in the accumulation - else false is returned.
      • retrieveFrom

        public CanonicalMap retrieveFrom​(java.lang.String aFromPath)
        Extracts a new PathMap from the elements of this PathMap found below the "from-path". The sub-paths will be the root paths for the new PathMap. Given we have a value for path "/dog/cat" in the PathMap and we call PathMap.retrieveFrom(String) with "/dog", then the resulting PathMap will contain the path "/cat" for that value.
        Specified by:
        retrieveFrom in interface CanonicalMap
        Specified by:
        retrieveFrom in interface PathMap<java.lang.String>
        Parameters:
        aFromPath - The path from where to start extracting the paths.
        Returns:
        The PathMap with the elements below the provided path which are root elements in the new PathMap.
      • retrieveTo

        public CanonicalMap retrieveTo​(java.lang.String aToPath)
        Extracts a new PathMap from this PathMap's elements with the paths relocated to the provided "to-path". Given we have a value for path "/dog/cat" in the PathMap and we call PathMap.retrieveTo(String) with "/animals", then the resulting PathMap will contain the path "/animals/dog/cat" for that value.
        Specified by:
        retrieveTo in interface CanonicalMap
        Specified by:
        retrieveTo in interface PathMap<java.lang.String>
        Parameters:
        aToPath - The path where to relocate the paths of this PathMap to.
        Returns:
        The PathMap with the elements from the provided PathMap with accordingly relocated paths.
      • getDelimiter

        public char getDelimiter​()
        Specified by:
        getDelimiter in interface org.refcodes.mixin.DelimiterAccessor
      • getType

        public java.lang.Class<java.lang.String> getType​()
        Specified by:
        getType in interface org.refcodes.mixin.TypeAccessor<java.lang.String>
      • toDataStructure

        public java.lang.Object toDataStructure​(java.lang.String aFromPath)
        Similar to the PathMap.toMap(String) method, though in case all the keys of a nested Map instance (applicable to the root Map as well) represent an array (as of PathMap.getArray( String)), then an array is generated where the index of each value in the Map is represented by the number representation of the Map's key for that value. The result is a data structure consisting of Map instances and arrays.
        Specified by:
        toDataStructure in interface PathMap<java.lang.String>
        Parameters:
        aFromPath - The path below which the PathMap to be converted into a data structure.
        Returns:
        A data structure being a mixture of Map instances and arrays representing the data below the given path.