org.graffiti.plugins.ios.gml.attributemapping
Class AbstractAttributeMapping

java.lang.Object
  extended by org.graffiti.plugins.ios.gml.attributemapping.AbstractAttributeMapping
All Implemented Interfaces:
AttributeMapping
Direct Known Subclasses:
GraphAttributeMapping, GraphElementAttributeMapping

public abstract class AbstractAttributeMapping
extends Object
implements AttributeMapping

This class provides an abstract implementation of a mapping from GML keys paths to Gravisto attribute paths and vice versa. We have to consider whole paths in order to take into account the fact that a key may appear at different places (namespaces). Two maps are provided which contain the two mappings. Therefore upon creation there is some overhead creating the second mapping from the first. However, this will only have to be done once. Getting the corresponding path then only takes O(1) in both cases.

Author:
ruediger

Constructor Summary
AbstractAttributeMapping()
          Constructs a new AbstractAttributeMapping.
 
Method Summary
 void addIgnorableGML(String gmlPath)
          Adds a GML attribute path that is ignorable when writing a GML file.
 void addIgnorableGravisto(String gravistoPath)
          Adds a Gravisto attribute path that is ignorable.
 void addMapping(String gmlPath, String gravistoPath, boolean requiresSpecialTreatment)
          Adds a mapping from a GML key path to a Gravisto attribute path indicating whether a transformation requires some extra work as opposed to just changing the path.
 String getGMLPath(String gravistoPath)
          Returns the GML key path corresponding to the given Gravisto attribute path.
 String getGravistoPath(String gmlPath)
          Returns the Gravisto attribute path corresponding to the given GML key path.
 boolean isIgnorableGML(String gmlPath)
          Returns true if the attribute at the specified GML attribute path is ignorable, false otherwise.
 boolean isIgnorableGravisto(String gravistoPath)
          Returns true if the attribute at the specified Gravisto attribute path is ignorable, false otherwise.
 boolean requiresSpecialTreatment(String gmlPath)
          Indicates whether some specific transformation work needs to be done when transforming from one representation to the other.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAttributeMapping

public AbstractAttributeMapping()
Constructs a new AbstractAttributeMapping.

Method Detail

getGMLPath

public String getGMLPath(String gravistoPath)
Returns the GML key path corresponding to the given Gravisto attribute path. If there is no mapping, null will be returned.

Specified by:
getGMLPath in interface AttributeMapping
Parameters:
gravistoPath - the Gravisto attribute path.
Returns:
the corresponding GML key path.

getGravistoPath

public String getGravistoPath(String gmlPath)
Returns the Gravisto attribute path corresponding to the given GML key path. If there is no mapping, null will be returned.

Specified by:
getGravistoPath in interface AttributeMapping
Parameters:
gmlPath - the GML key path.
Returns:
the corresponding Gravisto path.

isIgnorableGML

public boolean isIgnorableGML(String gmlPath)
Returns true if the attribute at the specified GML attribute path is ignorable, false otherwise.

Specified by:
isIgnorableGML in interface AttributeMapping
Parameters:
gmlPath - the GML attribute path for which to check whether the attribute is ignorable.
Returns:
true if the attribute at the specified GML attribute path is ignorable, false otherwise.

isIgnorableGravisto

public boolean isIgnorableGravisto(String gravistoPath)
Returns true if the attribute at the specified Gravisto attribute path is ignorable, false otherwise.

Specified by:
isIgnorableGravisto in interface AttributeMapping
Parameters:
gravistoPath - the Gravisto attribute path for which to check whether the attribute is ignorable.
Returns:
true if the attribute at the specified Gravisto attribute path is ignorable, false otherwise.

addIgnorableGML

public void addIgnorableGML(String gmlPath)
Adds a GML attribute path that is ignorable when writing a GML file.

Specified by:
addIgnorableGML in interface AttributeMapping
Parameters:
gmlPath - GML attribute path to be added.

addIgnorableGravisto

public void addIgnorableGravisto(String gravistoPath)
Adds a Gravisto attribute path that is ignorable.

Specified by:
addIgnorableGravisto in interface AttributeMapping
Parameters:
gravistoPath - the Gravisto attribute path to be added.

addMapping

public void addMapping(String gmlPath,
                       String gravistoPath,
                       boolean requiresSpecialTreatment)
Adds a mapping from a GML key path to a Gravisto attribute path indicating whether a transformation requires some extra work as opposed to just changing the path.

Specified by:
addMapping in interface AttributeMapping
Parameters:
gmlPath - the GML key path.
gravistoPath - the Gravisto attribute path.
requiresSpecialTreatment - the transformation flag.

requiresSpecialTreatment

public boolean requiresSpecialTreatment(String gmlPath)
Indicates whether some specific transformation work needs to be done when transforming from one representation to the other.

Specified by:
requiresSpecialTreatment in interface AttributeMapping
Parameters:
gmlPath - the GML key path for which to check the necessity of extra work.
Returns:
true some specific transformation work needs to be done when transforming from one representation to the other, false otherwise.


Generated at 2012-05-30 11:01:25 PM CEST