Package org.geotools.api.util
Interface Record
-
public interface Record
A list of logically related elements as (name, value) pairs in a dictionary. A record may be used as an implementation representation for features.This class can be think as the equivalent of the Java
Object
class.- Since:
- GeoAPI 2.1
- Author:
- Bryce Nordgren (USDA), Martin Desruisseaux (IRD)
- See Also:
RecordType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<MemberName,Object>
getAttributes()
Returns the dictionary of all (name, value) pairs in this record.RecordType
getRecordType()
Returns the type definition of record.Object
locate(MemberName name)
Returns the value for an attribute of the specified name.void
set(MemberName name, Object value)
Set the value for the attribute of the specified name.
-
-
-
Method Detail
-
getRecordType
RecordType getRecordType()
Returns the type definition of record. All attributes named in this record must be defined in the returned record type. In other words, the following relationship must holds:getRecordType().getAttributeTypes().keySet().containsAll(getAttributes().keySet())
This method can be think as the equivalent of the Java
Object.getClass()
method.
-
getAttributes
Map<MemberName,Object> getAttributes()
Returns the dictionary of all (name, value) pairs in this record. The returned map shall not allows key addition. It may allows the replacement of existing keys only.- See Also:
RecordType.getAttributeTypes()
-
locate
Object locate(MemberName name)
Returns the value for an attribute of the specified name. This is functionnaly equivalent togetAttributes().get(name)
. The type of the returned object is given bygetRecordType().locate(name)
.
-
set
void set(MemberName name, Object value) throws UnsupportedOperationException
Set the value for the attribute of the specified name. This is functionally equivalent togetAttributes().put(name,value)
. Remind thatname
keys are constrained to record type members only.- Parameters:
name
- The name of the attribute to modify.value
- The new value for the attribute.- Throws:
UnsupportedOperationException
- if this record is not modifiable.
-
-