org.geotools.data.vpf
Class VPFColumn

java.lang.Object
  extended byorg.geotools.data.vpf.VPFColumn
All Implemented Interfaces:
AttributeType, DataTypesDefinition

public class VPFColumn
extends java.lang.Object
implements AttributeType, DataTypesDefinition

A column in a VPF File.

Author:
Jeff Yutzler

Field Summary
 
Fields inherited from interface org.geotools.feature.AttributeType
UNBOUNDED
 
Fields inherited from interface org.geotools.data.vpf.ifc.DataTypesDefinition
BIG_ENDIAN_ORDER, CHAR_NULL_VALUE, DATA_2_COORD_F, DATA_2_COORD_F_LEN, DATA_2_COORD_R, DATA_2_COORD_R_LEN, DATA_3_COORD_F, DATA_3_COORD_F_LEN, DATA_3_COORD_R, DATA_3_COORD_R_LEN, DATA_DATE_TIME, DATA_DATE_TIME_LEN, DATA_LEVEL1_TEXT, DATA_LEVEL2_TEXT, DATA_LEVEL3_TEXT, DATA_LONG_FLOAT, DATA_LONG_FLOAT_LEN, DATA_LONG_INTEGER, DATA_LONG_INTEGER_LEN, DATA_NULL_FIELD, DATA_NULL_FIELD_LEN, DATA_SHORT_FLOAT, DATA_SHORT_FLOAT_LEN, DATA_SHORT_INTEGER, DATA_SHORT_INTEGER_LEN, DATA_TEXT, DATA_TRIPLET_ID, DATA_TRIPLET_ID_LEN, LEAST_SIGNIF_FIRST, LITTLE_ENDIAN_ORDER, MOST_SIGNIF_FIRST, STRING_NULL_VALUE, STRING_NULL_VALUES
 
Constructor Summary
VPFColumn(java.lang.String name, char type, int elementsNumber, char keyType, java.lang.String colDesc, java.lang.String valDescTableName, java.lang.String thematicIdx, java.lang.String narrTable)
          Constructor with all of the elements of a VPF column
 
Method Summary
 java.lang.Object createDefaultValue()
          Create a default value for this AttributeType.
 java.lang.Object duplicate(java.lang.Object src)
          Create a duplicate value of the passed Object.
 boolean equals(java.lang.Object obj)
           
 java.lang.Class getColumnClass()
          Retrieves the class for the column, based on a char value.
 int getElementsNumber()
          Returns the elementsNumber field
 GeometryAttributeType getGeometryAttributeType()
          Identifies and returns the GeometryAttributeType, or null if none exists.
 int getMaxOccurs()
          Returns the Max number of occurences ...
 int getMinOccurs()
          Returns the Min number of occurences ...
 java.lang.String getName()
          Gets the name of this attribute.
 java.lang.String getNarrTable()
          Gets the value of narrTable
 Filter getRestriction()
          This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string.
 java.lang.String getThematicIdx()
          Gets the value of thematicIdx
 java.lang.Class getType()
          Gets the type of this attribute.
 char getTypeChar()
          Returns the typeChar field
 java.lang.String getValDescTableName()
          Gets the value of valDescTableName
 int hashCode()
           
 boolean isAttemptLookup()
           
 boolean isGeometry()
           
 boolean isNillable()
          Returns whether nulls are allowed for this attribute.
 java.lang.Object parse(java.lang.Object value)
          Allows this AttributeType to convert an argument to its prefered storage type.
 void validate(java.lang.Object obj)
          Whether the tested object passes the validity constraints of this AttributeType.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VPFColumn

public VPFColumn(java.lang.String name,
                 char type,
                 int elementsNumber,
                 char keyType,
                 java.lang.String colDesc,
                 java.lang.String valDescTableName,
                 java.lang.String thematicIdx,
                 java.lang.String narrTable)
Constructor with all of the elements of a VPF column

Parameters:
name -
type -
elementsNumber -
keyType -
colDesc -
valDescTableName -
thematicIdx -
narrTable -
Method Detail

getColumnClass

public java.lang.Class getColumnClass()
Retrieves the class for the column, based on a char value.

Returns:
the class

createDefaultValue

public java.lang.Object createDefaultValue()
Description copied from interface: AttributeType
Create a default value for this AttributeType. If the type is nillable, the Object may or may not be null.

Specified by:
createDefaultValue in interface AttributeType
Returns:
Default value, note may be null if isNillable is true

duplicate

public java.lang.Object duplicate(java.lang.Object src)
                           throws IllegalAttributeException
Description copied from interface: AttributeType
Create a duplicate value of the passed Object. For immutable Objects, it is not neccessary to create a new Object.

Specified by:
duplicate in interface AttributeType
Parameters:
src - The Object to duplicate.
Returns:
Duplicate of provided object
Throws:
IllegalAttributeException - If the src Object is not the correct type.

getName

public java.lang.String getName()
Description copied from interface: AttributeType
Gets the name of this attribute.

Specified by:
getName in interface AttributeType
Returns:
Name.

getNarrTable

public java.lang.String getNarrTable()
Gets the value of narrTable

Returns:
the value of narrTable

getThematicIdx

public java.lang.String getThematicIdx()
Gets the value of thematicIdx

Returns:
the value of thematicIdx

getType

public java.lang.Class getType()
Description copied from interface: AttributeType
Gets the type of this attribute.

Specified by:
getType in interface AttributeType
Returns:
Type.

getValDescTableName

public java.lang.String getValDescTableName()
Gets the value of valDescTableName

Returns:
the value of valDescTableName

isGeometry

public boolean isGeometry()

isNillable

public boolean isNillable()
Description copied from interface: AttributeType
Returns whether nulls are allowed for this attribute.

Specified by:
isNillable in interface AttributeType
Returns:
true if nulls are permitted, false otherwise.

parse

public java.lang.Object parse(java.lang.Object value)
                       throws java.lang.IllegalArgumentException
Description copied from interface: AttributeType
Allows this AttributeType to convert an argument to its prefered storage type. If no parsing is possible, returns the original value. If a parse is attempted, yet fails (i.e. a poor decimal format) throw the Exception. This is mostly for use internally in Features, but implementors should simply follow the rules to be safe.

Specified by:
parse in interface AttributeType
Parameters:
value - the object to attempt parsing of.
Returns:
value converted to the preferred storage of this AttributeType. If no parsing was possible then the same object is returned.
Throws:
java.lang.IllegalArgumentException - if parsing is attempted and is unsuccessful.

validate

public void validate(java.lang.Object obj)
              throws java.lang.IllegalArgumentException
Description copied from interface: AttributeType
Whether the tested object passes the validity constraints of this AttributeType. At a minimum it should be of the correct class specified by AttributeType.getType(), non-null if isNillable is false, and a geometry if isGeometry is true. If The object does not validate then an IllegalArgumentException reporting the error in validation should be thrown.

Specified by:
validate in interface AttributeType
Parameters:
obj - The object to be tested for validity.
Throws:
java.lang.IllegalArgumentException - if the object does not validate.

getTypeChar

public char getTypeChar()
Returns the typeChar field

Returns:
Returns the typeChar.

getElementsNumber

public int getElementsNumber()
Returns the elementsNumber field

Returns:
Returns the elementsNumber.

getGeometryAttributeType

public GeometryAttributeType getGeometryAttributeType()
Identifies and returns the GeometryAttributeType, or null if none exists.

Returns:
The GeometryAttributeType value

isAttemptLookup

public boolean isAttemptLookup()
Returns:
Returns the attemptLookup.

getRestriction

public Filter getRestriction()
Description copied from interface: AttributeType
This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string.

Specified by:
getRestriction in interface AttributeType
Returns:
Filter, or Filter.NONE if no restriction is needed.

getMinOccurs

public int getMinOccurs()
Description copied from interface: AttributeType
Returns the Min number of occurences ...

Specified by:
getMinOccurs in interface AttributeType
Returns:

getMaxOccurs

public int getMaxOccurs()
Description copied from interface: AttributeType
Returns the Max number of occurences ...

Specified by:
getMaxOccurs in interface AttributeType
Returns:

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()


Copyright © GeoTools. All Rights Reserved.