T
- the generic typepublic class PathMapImpl<T> extends Object implements PathMap<T>
PathMap.MutablePathMap<T>, PathMap.PathMapBuilder<T>
Dictionary.MutableDictionary<K,V>
Keys.MutableKeys<K,V>, Keys.MutableValues<K,V>
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
Constructor and Description |
---|
PathMapImpl(char aDelimiter,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(Object aObj,
char aDelimiter,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(Object aObj,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(Object aObj,
String aFromPath,
char aDelimiter,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(Object aObj,
String aFromPath,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(PathMap<T> aPathMap)
Instantiates a new path map impl.
|
PathMapImpl(String aToPath,
Object aObj,
char aDelimiter,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(String aToPath,
Object aObj,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(String aToPath,
Object aObj,
String aFromPath,
char aDelimiter,
Class<T> aType)
Instantiates a new path map impl.
|
PathMapImpl(String aToPath,
Object aObj,
String aFromPath,
Class<T> aType)
Instantiates a new path map impl.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object aKey)
Tests whether there is an element with the given key.
|
boolean |
containsValue(Object aValue)
This method is defined for the sake of
Map conformity, especially
regarding the Properties.MutableProperties . |
T |
get(Object aKey)
Retrieves the element assigned to the given key.
|
char |
getDelimiter() |
Class<T> |
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.
|
PathMap<T> |
retrieveFrom(String aFromPath)
|
PathMap<T> |
retrieveTo(String aToPath)
|
int |
size()
Returns the number of data elements contained in the collection.
|
Object |
toDataStructure(String aPath)
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<T> |
values()
Returns a
Collection view of the values related to the contained
keys. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
directories, directories, entries, entries, getArray, getArray, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, retrieve, toDataStructure, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toRootPath
public PathMapImpl(char aDelimiter, Class<T> aType)
aDelimiter
- the a delimiteraType
- the a typepublic PathMapImpl(Object aObj, Class<T> aType)
aObj
- the a objaType
- the a typepublic PathMapImpl(Object aObj, char aDelimiter, Class<T> aType)
aObj
- the a objaDelimiter
- the a delimiteraType
- the a typepublic PathMapImpl(String aToPath, Object aObj, char aDelimiter, Class<T> aType)
aToPath
- the a to pathaObj
- the a objaDelimiter
- the a delimiteraType
- the a typepublic PathMapImpl(Object aObj, String aFromPath, char aDelimiter, Class<T> aType)
aObj
- the a objaFromPath
- the a from pathaDelimiter
- the a delimiteraType
- the a typepublic PathMapImpl(String aToPath, Object aObj, Class<T> aType)
aToPath
- the a to pathaObj
- the a objaType
- the a typepublic PathMapImpl(Object aObj, String aFromPath, Class<T> aType)
aObj
- the a objaFromPath
- the a from pathaType
- the a typepublic PathMapImpl(String aToPath, Object aObj, String aFromPath, Class<T> aType)
aToPath
- the a to pathaObj
- the a objaFromPath
- the a from pathaType
- the a typepublic PathMapImpl(String aToPath, Object aObj, String aFromPath, char aDelimiter, Class<T> aType)
aToPath
- the a to pathaObj
- the a objaFromPath
- the a from pathaDelimiter
- the a delimiteraType
- the a typepublic boolean containsKey(Object aKey)
Keys
containsKey
in interface Keys<String,T>
aKey
- The key for which to test whether there is an element.public boolean containsValue(Object aValue)
Keys
Map
conformity, especially
regarding the Properties.MutableProperties
.
Tests whether the provided value has a key assigned.containsValue
in interface Keys<String,T>
aValue
- The value to test if a key references this value.public T get(Object aKey)
Keys
public Set<String> keySet()
Keys
public Collection<T> values()
Keys
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()
Containable
size
in interface Containable
public boolean isEmpty()
Containable
isEmpty
in interface Containable
public char getDelimiter()
getDelimiter
in interface org.refcodes.mixin.DelimiterAccessor
public PathMap<T> retrieveFrom(String aFromPath)
PathMap
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 PathMap<T>
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 PathMap<T> retrieveTo(String aToPath)
PathMap
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.public Class<T> getType()
getType
in interface org.refcodes.mixin.TypeAccessor<T>
public Object toDataStructure(String aPath)
PathMap
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<T>
aPath
- 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 © 2017. All rights reserved.