org.refcodes.mixin.DelimiterAccessor
, org.refcodes.mixin.Dumpable
, org.refcodes.mixin.TypeAccessor<String>
, CanonicalMap
, Containable
, Dictionary<String,T>
, Keys<String,T>
, PathMap<String>
, PropertiesAccessorMixin
public class CanonicalMapImpl extends Object implements CanonicalMap
CanonicalMap.CanonicalMapBuilder, CanonicalMap.MutableCanonicalMap
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
Dictionary.MutableDictionary<K,V>
Keys.MutableKeys<K,V>, Keys.MutableValues<K,V>
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
PropertiesAccessorMixin.PropertiesBuilderMixin<T>, PropertiesAccessorMixin.PropertiesMixin, PropertiesAccessorMixin.PropertiesMutatorMixin
Modifier and Type | Field | Description |
---|---|---|
protected CanonicalMap.CanonicalMapBuilder |
_canonicalMap |
DEFAULT_COMMENT
Constructor | Description |
---|---|
CanonicalMapImpl(Object aObject) |
Instantiates a new canonical map impl.
|
CanonicalMapImpl(Map<?,?> aProperties) |
Instantiates a new canonical map impl.
|
Modifier and Type | Method | Description |
---|---|---|
CanonicalMap |
childrenOf(String aParentPath) |
Gets the children elements of the provided parent's path, excluding the
parent's path.
|
boolean |
containsKey(Object aKey) |
Tests whether there is an element with the given key.
|
String |
get(Object aKey) |
Retrieves the element assigned to the given key.
|
char |
getDelimiter() |
|
Class<String> |
getType() |
|
boolean |
isEmpty() |
Tests whether the accumulation is empty or not.
|
Set<String> |
keySet() |
Retrieves a collection containing all the keys found in the elements of
this collection.
|
CanonicalMap |
retrieveFrom(String aFromPath) |
|
CanonicalMap |
retrieveTo(String aToPath) |
|
int |
size() |
Returns the number of data elements contained in the collection.
|
Object |
toDataStructure(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. |
Collection<String> |
values() |
Returns a
Collection view of the values related to the contained
keys. |
containsValue, retrieve, toInstance, toInstance, toType, toType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
directories, directories, entries, entries, fromExternalKey, getArray, getArray, getRootPath, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toExternalKey, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath
containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
protected CanonicalMap.CanonicalMapBuilder _canonicalMap
public CanonicalMapImpl(Object aObject)
aObject
- the objectpublic CanonicalMapImpl(Map<?,?> aProperties)
aProperties
- the propertiespublic boolean containsKey(Object aKey)
containsKey
in interface Keys<String,T>
aKey
- The key for which to test whether there is an element.public Set<String> keySet()
public Collection<String> values()
Collection
view of the values related to the contained
keys.values
in interface Keys<String,T>
Collection
view of the values related to the contained
keys.public int size()
size
in interface Containable
public boolean isEmpty()
isEmpty
in interface Containable
public CanonicalMap retrieveFrom(String aFromPath)
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.retrieveFrom
in interface CanonicalMap
retrieveFrom
in interface PathMap<String>
aFromPath
- The path from where to start extracting the paths.PathMap
with the elements below the provided path
which are root elements in the new PathMap
.public CanonicalMap retrieveTo(String aToPath)
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.retrieveTo
in interface CanonicalMap
retrieveTo
in interface PathMap<String>
aToPath
- The path where to relocate the paths of this
PathMap
to.PathMap
with the elements from the provided
PathMap
with accordingly relocated paths.public CanonicalMap childrenOf(String aParentPath)
childrenOf
in interface CanonicalMap
childrenOf
in interface PathMap<String>
aParentPath
- The path from where to retrieve the children.public char getDelimiter()
getDelimiter
in interface org.refcodes.mixin.DelimiterAccessor
public Class<String> getType()
getType
in interface org.refcodes.mixin.TypeAccessor<String>
public Object toDataStructure(String aFromPath)
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.toDataStructure
in interface PathMap<String>
aFromPath
- The path below which the PathMap
to be converted
into a data structure.Map
instances and
arrays representing the data below the given path.Copyright © 2018. All rights reserved.