Package org.openjump.util.metaData
Class MetaInformationHandler
- java.lang.Object
-
- org.openjump.util.metaData.MetaInformationHandler
-
- All Implemented Interfaces:
HandlerToMakeYourLifeEasier
public class MetaInformationHandler extends Object implements HandlerToMakeYourLifeEasier
Tool class for easier handling of meta information on a layer basis.
- objects will be created, if neccessary
- you don't need to access the properties map of the data source (where the meta information is stored) yourself- Version:
- $Rev: 1559 $
- Author:
- Ole Rahn
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
-
-
Field Summary
Fields Modifier and Type Field Description protected PersonalLoggerloggerprotected ObjectContainingMetaInformationobjectWithMetaInformation
-
Constructor Summary
Constructors Constructor Description MetaInformationHandler(Layer layerWithMetaInformation)MetaInformationHandler(ObjectContainingMetaInformation objectWithMetaInformation)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetaInformation(String key, Object value)Adds a new meta information key-value-pair to the meta information map, replaces an existing pair with the same key.voidclear()booleancontainsAttribute2UnitMap()booleancontainsKey(String key)booleancontainsMetaInformation()booleancontainsValue(Object value)static PirolFeatureCollectioncreatePirolFeatureCollection(FeatureCollection fc)creates a PirolFeatureCollection out of a regular FeatureCollectionstatic PirolFeatureCollectioncreatePirolFeatureCollection(FeatureCollection fc, FeatureCollectionRole role)creates a PirolFeatureCollection out of a regular FeatureCollectionAttribute2UnitMapgetAttribute2UnitMap()MetaDataMapgetExistentMetaInformationMap()Retrieve the existent meta information map.HashMapgetMetaData()ObjectgetMetaInformation(String key)MetaDataMapgetMetaInformationMap()Retrieve the existent meta information map or create one.SetkeySet()voidputAttribute2UnitMap(Attribute2UnitMap attribute2UnitMap)Objectremove(String key)voidsetMetaData(HashMap<Object,Object> metaData)
-
-
-
Field Detail
-
objectWithMetaInformation
protected ObjectContainingMetaInformation objectWithMetaInformation
-
logger
protected PersonalLogger logger
-
-
Constructor Detail
-
MetaInformationHandler
public MetaInformationHandler(Layer layerWithMetaInformation)
- Parameters:
layerWithMetaInformation- the layer you want the meta information of (has to have a DataSource!!)
-
MetaInformationHandler
public MetaInformationHandler(ObjectContainingMetaInformation objectWithMetaInformation)
- Parameters:
objectWithMetaInformation- the object you want the meta information of
-
-
Method Detail
-
createPirolFeatureCollection
public static PirolFeatureCollection createPirolFeatureCollection(FeatureCollection fc)
creates a PirolFeatureCollection out of a regular FeatureCollection- Parameters:
fc- regular FeatureCollection- Returns:
- PirolFeatureCollection
-
createPirolFeatureCollection
public static PirolFeatureCollection createPirolFeatureCollection(FeatureCollection fc, FeatureCollectionRole role)
creates a PirolFeatureCollection out of a regular FeatureCollection- Parameters:
fc- regular FeatureCollection- Returns:
- PirolFeatureCollection
-
getExistentMetaInformationMap
public MetaDataMap getExistentMetaInformationMap()
Retrieve the existent meta information map.- Returns:
- the existent meta information map or null, if there is none
-
getMetaInformationMap
public MetaDataMap getMetaInformationMap()
Retrieve the existent meta information map or create one.- Returns:
- the existent meta information map or an empty meta information map (that is now attached to the DataSource)
-
containsMetaInformation
public boolean containsMetaInformation()
- Returns:
- true if the given layer already contains meta information, false if not
-
addMetaInformation
public void addMetaInformation(String key, Object value)
Adds a new meta information key-value-pair to the meta information map, replaces an existing pair with the same key.- Parameters:
key- key of the metadata to addvalue- value of the metadata to add
-
getMetaData
public HashMap getMetaData()
-
clear
public void clear()
-
containsKey
public boolean containsKey(String key)
-
containsValue
public boolean containsValue(Object value)
-
keySet
public Set keySet()
-
getAttribute2UnitMap
public Attribute2UnitMap getAttribute2UnitMap()
- Returns:
- the Attribute2UnitMap of the given DataSource or null, if there is none
-
putAttribute2UnitMap
public void putAttribute2UnitMap(Attribute2UnitMap attribute2UnitMap)
-
containsAttribute2UnitMap
public boolean containsAttribute2UnitMap()
-
-