com.moximedia.ows
Class Feature

java.lang.Object
  extended bycom.moximedia.ows.Feature
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Feature
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The Feature class is used to store a record associated with a recordset.

See Also:
Serialized Form

Constructor Summary
Feature()
          Create a new Feature object
 
Method Summary
 java.lang.Object clone()
          Creates a clone of this object.
 Feature getCopy()
          Creates a copy of this object.
 java.lang.String getFeatureId()
          Returns the feature ID, if there is one.
 Geometry getFieldGeometry(java.lang.String fieldName)
          Gets the value of the specified field.
 java.lang.String[] getFieldNames()
          Returns an array of field names contained in the feature.
 java.util.ArrayList getFields()
          Returns the array of field objects associated to this feature.
 java.lang.String getFieldValue(java.lang.String fieldName)
          Gets the value of the specified field.
 Geometry getGeometry()
          Gets the geometry of this feature.
 boolean hasField(java.lang.String fieldName)
          Returns an indicator of whether the field exists.
 void initFieldGeometry(java.lang.String name, Geometry geom)
          Sets the value of the specified field.
 void initFieldValue(java.lang.String name, Geometry geom)
          Sets the value of the specified field.
 void initFieldValue(java.lang.String name, java.lang.String value)
          Sets the value of the specified field.
 void setFeatureId(java.lang.String fid)
          Sets the feature ID.
 void setFieldGeometry(java.lang.String name, Geometry geom)
          Sets the value of the specified field.
 void setFieldNames(java.util.ArrayList fieldNames)
          Sets the field names.
 void setFieldValue(java.lang.String name, java.lang.String value)
          Sets the value of the specified field.
 void setGeometry(Geometry geom)
          Sets the feature geometry.
 void setXmlAttribute(java.lang.String element, java.lang.String name, java.lang.String value)
          Sets one of the attributes of this object using a string value.
 int size()
          Returns a count of the number of fields in the feature.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Feature

public Feature()
Create a new Feature object

Method Detail

clone

public java.lang.Object clone()
Creates a clone of this object. Must be cast back to the correct object type before using. Consider using getCopy() instead.

Returns:
The clone of this object.

getCopy

public Feature getCopy()
Creates a copy of this object.

Returns:
The copy of this object.

getGeometry

public Geometry getGeometry()
Gets the geometry of this feature. If this feature contains more than one geometry, the first geometry will be returned.

Returns:
The geometry, or null if there is no geometry.

setGeometry

public void setGeometry(Geometry geom)
Sets the feature geometry.

Parameters:
geom - The feature geometry.

size

public int size()
Returns a count of the number of fields in the feature.

Returns:
The number of fields.

getFieldNames

public java.lang.String[] getFieldNames()
Returns an array of field names contained in the feature.

Returns:
An array of Strings that are the field names.

setFieldNames

public void setFieldNames(java.util.ArrayList fieldNames)
Sets the field names.

Parameters:
fieldNames - An array of String objects containing the field names.

getFeatureId

public java.lang.String getFeatureId()
Returns the feature ID, if there is one.

Returns:
The feature ID, or null if there isn't one.

setFeatureId

public void setFeatureId(java.lang.String fid)
Sets the feature ID.

Parameters:
fid - The feature id.

getFieldGeometry

public Geometry getFieldGeometry(java.lang.String fieldName)
Gets the value of the specified field.

Parameters:
fieldName - The field name to get.
Returns:
The value, or null if the value or field is not found.

getFieldValue

public java.lang.String getFieldValue(java.lang.String fieldName)
Gets the value of the specified field.

Parameters:
fieldName - The field name to get.
Returns:
The value, or null if the value or field is not found.

setFieldValue

public void setFieldValue(java.lang.String name,
                          java.lang.String value)
Sets the value of the specified field. Adds the field if not already present.

Parameters:
name - The name of the field.
value - The field value.

setFieldGeometry

public void setFieldGeometry(java.lang.String name,
                             Geometry geom)
Sets the value of the specified field. Adds the field if not already present.

Parameters:
name - The name of the field.
geom - The field geometry.

initFieldValue

public void initFieldValue(java.lang.String name,
                           java.lang.String value)
Sets the value of the specified field. Adds the field if not already present.

Parameters:
name - The name of the field.
value - The field value.

initFieldValue

public void initFieldValue(java.lang.String name,
                           Geometry geom)
Sets the value of the specified field. Adds the field if not already present.

Parameters:
name - The name of the field.
geom - The field geometry.

initFieldGeometry

public void initFieldGeometry(java.lang.String name,
                              Geometry geom)
Sets the value of the specified field. Adds the field if not already present.

Parameters:
name - The name of the field.
geom - The field geometry.

setXmlAttribute

public void setXmlAttribute(java.lang.String element,
                            java.lang.String name,
                            java.lang.String value)
Sets one of the attributes of this object using a string value. This method is usually called from the SAX event handler.

Parameters:
element - The XML element tag containing this attribute.
name - The XML attribute name.
value - The XML attribute value.

getFields

public java.util.ArrayList getFields()
Returns the array of field objects associated to this feature.

Returns:
The array of field objects.

hasField

public boolean hasField(java.lang.String fieldName)
Returns an indicator of whether the field exists.

Parameters:
fieldName - The field name to test.
Returns:
True if the field is found, otherwise false.


Internet Mapping Framework for OpenGIS Java Object Model API (v1.3.007)
Copyright © 2005 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.