org.openjump.core.apitools
Class FeatureSchemaTools

java.lang.Object
  extended by org.openjump.core.apitools.ToolToMakeYourLifeEasier
      extended by org.openjump.core.apitools.FeatureSchemaTools

public class FeatureSchemaTools
extends ToolToMakeYourLifeEasier

Class for easier handling of featureSchema objects.

Version:
$Rev: 1245 $
Author:
Ole Rahn

FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement

Constructor Summary
FeatureSchemaTools()
           
 
Method Summary
static AttributeInfo getAttributesInfoFor(FeatureSchema fs, int attrIndex)
          Extracts information on the attribute at the given index from the feature schema.
static AttributeInfo getAttributesInfoFor(FeatureSchema fs, java.lang.String attrName)
          Extracts information on the attribute with the given name from the feature schema.
static AttributeInfo[] getAttributesWithTypes(FeatureSchema fs, AttributeType[] allowedTypes)
          Extracts information of all attributes with one of the given types from the given FeatureSchema
static boolean isAttributeTypeAllowed(AttributeType at, AttributeType[] allowedTypes)
          Checks if the given attribute type is contained in the given array of allowed attribute types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureSchemaTools

public FeatureSchemaTools()
Method Detail

getAttributesWithTypes

public static AttributeInfo[] getAttributesWithTypes(FeatureSchema fs,
                                                     AttributeType[] allowedTypes)
Extracts information of all attributes with one of the given types from the given FeatureSchema

Parameters:
fs - FeatureSchema to get information from
allowedTypes - array with AttributeTypes, that specify which attribute to get information about
Returns:
array with information on matching attributes

getAttributesInfoFor

public static AttributeInfo getAttributesInfoFor(FeatureSchema fs,
                                                 int attrIndex)
Extracts information on the attribute at the given index from the feature schema.

Parameters:
fs - FeatureSchema to get information from
attrIndex - index of the attribute in the given featureSchema to get information about
Returns:
information about the attribute

getAttributesInfoFor

public static AttributeInfo getAttributesInfoFor(FeatureSchema fs,
                                                 java.lang.String attrName)
Extracts information on the attribute with the given name from the feature schema.

Parameters:
fs - FeatureSchema to get information from
attrName - name of the attribute in the given featureSchema to get information about
Returns:
information about the attribute

isAttributeTypeAllowed

public static boolean isAttributeTypeAllowed(AttributeType at,
                                             AttributeType[] allowedTypes)
Checks if the given attribute type is contained in the given array of allowed attribute types.

Parameters:
at - attribute type to be checked
allowedTypes - array of allowed attribute types
Returns:
true if at is contained in allowedTypes, else false