com.languagecomputer.api.text
Class DefaultSpatialSpan

java.lang.Object
  extended by com.languagecomputer.api.text.DefaultText
      extended by com.languagecomputer.api.text.DefaultSpatialSpan
All Implemented Interfaces:
SpatialSpan, Text

public class DefaultSpatialSpan
extends DefaultText
implements SpatialSpan

Default implementation of a SpatialSpan.

Since:
1.0
Author:
Kirk Roberts
See Also:
DefaultText

Field Summary
 
Fields inherited from interface com.languagecomputer.api.text.SpatialSpan
TYPE
 
Constructor Summary
DefaultSpatialSpan()
          Creates a new DefaultSpatialSpan.
 
Method Summary
 Double getLatitude()
          Returns the latitude of the geographic object (optional).
 Double getLongitude()
          Returns the longitude of the geographic object (optional).
 List<String> getParents()
          Returns the list of geographic objects that contain this one in increasing order (optional).
 Integer getPopulation()
          Returns the human population of the geographic object (optional).
 void setAnnotationType(AnnotationType annType)
          Not necessary: defaults to SpatialSpan.TYPE.
 void setLatitude(Double latitude)
          Sets the latitude.
 void setLongitude(Double longitude)
          Sets the longitude.
 void setParents(List<String> parents)
          Sets the parents.
 void setPopulation(Integer population)
          Sets the population.
 String toString()
          Returns a String representation of a DefaultSpatialSpan.
 
Methods inherited from class com.languagecomputer.api.text.DefaultText
getAnnotationType, getCongruentAnnotations, getDocument, getDocumentID, getEndCharOffset, getIntersectingAnnotations, getRawString, getStartCharOffset, getSubAnnotations, getSuperAnnotations, setDocument, setEndCharOffset, setRawString, setStartCharOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.languagecomputer.api.text.Text
getAnnotationType, getCongruentAnnotations, getDocument, getDocumentID, getEndCharOffset, getIntersectingAnnotations, getRawString, getStartCharOffset, getSubAnnotations, getSuperAnnotations
 

Constructor Detail

DefaultSpatialSpan

public DefaultSpatialSpan()
Creates a new DefaultSpatialSpan.

Method Detail

setAnnotationType

public void setAnnotationType(AnnotationType annType)
Not necessary: defaults to SpatialSpan.TYPE.

Overrides:
setAnnotationType in class DefaultText
Parameters:
annType - AnnotationType to use for this DefaultSpatialSpan.
See Also:
Text.getAnnotationType(), AnnotationType

setLatitude

public void setLatitude(Double latitude)
Sets the latitude.

Parameters:
latitude - The latitude to use, where null represents an unknown value.
See Also:
SpatialSpan.getLatitude()

getLatitude

public Double getLatitude()
Returns the latitude of the geographic object (optional). Implementors that choose not to provide the latitude should return null.

Specified by:
getLatitude in interface SpatialSpan
Returns:
The latitude, or null if this functionality isn't implemented.

setLongitude

public void setLongitude(Double longitude)
Sets the longitude.

Parameters:
longitude - The longitude to use, where null represents an unknown value.
See Also:
SpatialSpan.getLongitude()

getLongitude

public Double getLongitude()
Returns the longitude of the geographic object (optional). Implementors that choose not to provide the longitude should return null.

Specified by:
getLongitude in interface SpatialSpan
Returns:
The longitude, or null if this functionality isn't implemented.

setParents

public void setParents(List<String> parents)
Sets the parents.

Parameters:
parents - The parents to use, where null represents an unknown value.
See Also:
SpatialSpant#getParents

getParents

public List<String> getParents()
Returns the list of geographic objects that contain this one in increasing order (optional). For example, if a SpatialSpan covers the text Dallas, then the parents could be Texas, United States, North America, and Earth. Implementors that choose not to provide the geographic parents should return null.

Specified by:
getParents in interface SpatialSpan
Returns:
A List of the geographic parents of this SpatialSpan, or null if this functionality isn't implemented.

setPopulation

public void setPopulation(Integer population)
Sets the population.

Parameters:
population - The population to use, where null represents an unknown value.
See Also:
SpatialSpan.getPopulation()

getPopulation

public Integer getPopulation()
Returns the human population of the geographic object (optional). Implementors that choose not to provide the population should return null.

Specified by:
getPopulation in interface SpatialSpan
Returns:
The population, or null if this functionality isn't implemented.

toString

public String toString()
Returns a String representation of a DefaultSpatialSpan.

Overrides:
toString in class DefaultText


Copyright © 2009. All Rights Reserved.