Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.opengis.feature.simple
Interface SimpleFeature

All Superinterfaces:
  Attribute, ComplexAttribute, Feature, Property

    public interface SimpleFeature

extends Feature

Feature interface customised for Simple content.

This class has a different target audience then that of the rest of the Feature Model - the target user is a casual user of Shapefiles, if they can switch over to database tables without noticing so much the better.

Note this is extension of Feature, and thus it is complete with respect to the needs of XPath and GML generation. This represents a restriction as indicated by SimpleFeatureType, and this restriction has allowed us to unambiguously create helpful methods based in name and index.

We considered providing a helper method based on GenericName to this class or directly to Feature. There is no significant advantage over direct use of AttribtueType.

Method Summary
`List<Association>` | `associations()` Associations are not supported by SimpleFeature.
`List<Attribute>` | `attributes()` List of attributes in prescribed order.
`List<Attribute>` | `getAttributes()` List of attributes is in the same order as that defined by SimpleFeatureType.
`Object` | `getDefaultGeometryValue()` Returns the default geometry for the simple feature.
`int` | `getNumberOfAttributes()` Number of attributes in SimpleFeatureType.
`SimpleFeatureType` | `getType()` Restricted to SimpleFeatureType This restriction enabled client code to confidently assume that each attribute occurs in the perscribed order and that no super types are used.
`List<AttributeType>` | `getTypes()` AttributeTypes in the order defined by SimpleFeatureType.
`List<Property>` | `getValue()` List (since associations are not allowed).
`Object` | `getValue(int index)` Access attribute by "index" indicated by SimpleFeatureType.
`Object` | `getValue(String name)` Retrieve value by attribute name.
`List<Object>` | `getValues()` Value view of attributes, in a manner similar Map.values().
`void` | `setDefaultGeometryValue(Object geometry)` Sets the default geometry for the simple feature.
`void` | `setValue(int index, Object value)` Modify attribute at the "index" indicated by SimpleFeatureType.
`void` | `setValue(List<Property> values)` Update the feature with these attributes.
`void` | `setValue(String name, Object value)` Modify attribute with "name" indicated by SimpleFeatureType.
`void` | `setValues(List<Attribute> values)` Sets the values of the feautre.
`void` | `setValues(Object[] values)` Sets the values of the feautre.

Methods inherited from interface Feature
`getBounds, getCRS, getDefaultGeometry, getID, getUserData, putUserData, setCRS, setDefaultGeometry`

Methods inherited from interface ComplexAttribute
`get, getDescriptor, setValue`

Methods inherited from interface Attribute
`nillable, operation, setValue`

Methods inherited from interface Property
`descriptor, name`

Method Detail

### associations

    List<Association> associations()

  Associations are not supported by SimpleFeature.

  Specified by:
    `associations` in interface `ComplexAttribute`
  Returns:
    Collection.EMPTY_LIST

### attributes

    List<Attribute> attributes()

  List of attributes in prescribed order.

  Specified by:
    `attributes` in interface `ComplexAttribute`
  Returns:
    List of Attribute in order indicated by SimpleFeatureType

### getAttributes

    List<Attribute> getAttributes()

  List of attributes is in the same order as that defined by SimpleFeatureType.

### getTypes

    List<AttributeType> getTypes()

  AttributeTypes in the order defined by SimpleFeatureType.

  This method is not part of the data model and does not follow Java Bean naming conventions.

  Returns:
    List of AttribtueTypes in order defined by SimpleFeatureType

### getValue

    List<Property> getValue()

  List (since associations are not allowed).

  You may wish to use getValues() instead, in order to access feature contents directly.

  Specified by:
    `getValue` in interface `Attribute`
  Specified by:
    `getValue` in interface `ComplexAttribute`
  Returns:
    List of attribtues in the order defined by SimpleFeatureType

### setValue

    void setValue(List<Property> values)

  Update the feature with these attributes.

  You may wish to use setValues() instead, in order to access feature contents directly.

### getValues

    List<Object> getValues()

  Value view of attributes, in a manner similar Map.values().

  The content available through getTypes() and getvalues() are considered a view of getAttribtues(). Order is maintained, and removing content will result in a modification to all three lists.

### getType

    SimpleFeatureType getType()

  Restricted to SimpleFeatureType

  This restriction enabled client code to confidently assume that each attribute occurs in the perscribed order and that no super types are used.

  Specified by:
    `getType` in interface `Attribute`
  Specified by:
    `getType` in interface `ComplexAttribute`
  Specified by:
    `getType` in interface `Feature`
  Specified by:
    `getType` in interface `Property`
  Returns:
    AttributeType information describing allowable content

### getValue

    Object getValue(String name)

  Retrieve value by attribute name.

  Parameters:
    `name` -
  Returns:
    Attribute Value associated with name

### getValue

    Object getValue(int index)

  Access attribute by "index" indicated by SimpleFeatureType.

  Parameters:
    `index` -

### setValue

    void setValue(String name,
                  Object value)

  Modify attribute with "name" indicated by SimpleFeatureType.

  Parameters:
    `name` -
    `value` -

### setValue

    void setValue(int index,
                  Object value)

  Modify attribute at the "index" indicated by SimpleFeatureType.

  Parameters:
    `index` -
    `value` -

### setValues

    void setValues(List<Attribute> values)

  Sets the values of the feautre.

### setValues

    void setValues(Object[] values)

  Sets the values of the feautre.

### getNumberOfAttributes

    int getNumberOfAttributes()

  Number of attributes in SimpleFeatureType.

  This is identical to `types().size()`

  Returns:
    number of available attribtues

### getDefaultGeometryValue

    Object getDefaultGeometryValue()

  Returns the default geometry for the simple feature.

  This method is convenience for getDefaultGeometry().get();

  Returns:
    The default geometry, or null if none exists.

### setDefaultGeometryValue

    void setDefaultGeometryValue(Object geometry)

  Sets the default geometry for the simple feature.

  This method is convenience for getDefaultGeometry().set(geometry);

  Parameters:
    `geometry` - The new defautl geometry.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1994-2008 Open Geospatial Consortium. All Rights Reserved.