skrueger.geotools
Class AttributeMetadataMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.TreeMap<Name,AttributeMetadata>
skrueger.geotools.AttributeMetadataMap
- All Implemented Interfaces:
- Serializable, Cloneable, Map<Name,AttributeMetadata>, NavigableMap<Name,AttributeMetadata>, SortedMap<Name,AttributeMetadata>, Copyable<AttributeMetadataMap>
public class AttributeMetadataMap
- extends TreeMap<Name,AttributeMetadata>
- implements Copyable<AttributeMetadataMap>
The AttributeMetadataMap
is a Map
holding
AttributeMetadata
object for Name
keys. It's an extension of
a TreeMap
. It's copyable in the sense of the Copyable
interface.
The get(Name)
and #get(String)
methods will never return
null
, but rather create a default AttributeMetadata
on-the-fly.
- See Also:
- Serialized Form
Methods inherited from class java.util.TreeMap |
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values |
AttributeMetadataMap
public AttributeMetadataMap()
AttributeMetadataMap
public AttributeMetadataMap(List<String> defLanguages)
- Creates an
AttributeMetadataMap
and sets the list of default
languages.
AttributeMetadataMap
public AttributeMetadataMap(String[] strings)
- Creates an
AttributeMetadataMap
and sets the list of default
languages.
copy
public AttributeMetadataMap copy()
- Returns a deep-copy. @see
Copyable
interface
- Specified by:
copy
in interface Copyable<AttributeMetadataMap>
copyTo
public AttributeMetadataMap copyTo(AttributeMetadataMap amdMap)
- Copies all its values to another
AttributeMetadataMap
. @see
Copyable
interface.
- Specified by:
copyTo
in interface Copyable<AttributeMetadataMap>
get
public AttributeMetadata get(Name name)
- Returns the
AttributeMetadata
for a given Name
. Never
returns null
, but rather creates a default
AttributeMetadata
on the fly.
- Specified by:
get
in interface Map<Name,AttributeMetadata>
- Overrides:
get
in class TreeMap<Name,AttributeMetadata>
getLanguages
public List<String> getLanguages()
getQuality
public double getQuality(List<String> languages)
- Returns:
- a number between 0. (bad) and 1. (good) that is calculated from
the amount of translation available in the visible attributes
sortedValues
public List<AttributeMetadata> sortedValues()
- Returns:
- List of
AttributeMetadata
objects ordered by their
weight. (heavier => further down)
sortedValuesVisibleOnly
public List<AttributeMetadata> sortedValuesVisibleOnly()
- Returns:
- List of only the visible
AttributeMetadata
objects
ordered by their weight. (heavier => further down)