RePast
v. 2.0

uchicago.src.sim.gis
Class PointAdapter

java.lang.Object
  |
  +--uchicago.src.sim.network.DefaultNode
        |
        +--uchicago.src.sim.gis.PointAdapter
All Implemented Interfaces:
Node, RepastGisFeature, SpatialNode

public class PointAdapter
extends DefaultNode
implements RepastGisFeature, SpatialNode


Nested Class Summary
 
Nested classes inherited from class uchicago.src.sim.network.DefaultNode
DefaultNode.OrderedHashMap
 
Field Summary
protected  Hashtable attributes
           
protected  com.vividsolutions.jts.geom.Geometry geo
           
protected  boolean multi
           
 
Fields inherited from class uchicago.src.sim.network.DefaultNode
inEdges, inMap, label, outEdges, outMap
 
Constructor Summary
PointAdapter()
          create an empty Adapter, not very useful.
PointAdapter(org.geotools.feature.Feature f)
          create an adapter from a Geotools feature
PointAdapter(com.vividsolutions.jts.geom.Point p)
          Create a new feature with no attributes.
 
Method Summary
 void addAttribute(String key, Object value)
          Add an attribute to the Fature.
 boolean crosses(RepastGisFeature g)
          Defined in the openGis SimpleFeatureSpecification.
 boolean disjoint(RepastGisFeature g)
          Defined in the openGis SimpleFeatureSpecification.
 Object getAttribute(String key)
          Get the value of the Attribute with given name.
 String[] getAttributeNames()
          Return an array with the attribute names for this feature.
 com.vividsolutions.jts.geom.Coordinate getCoordinates()
           
 com.vividsolutions.jts.geom.Geometry getGeometry()
          Gets the geometry that defines this feature.
 double getX()
           
 double getY()
           
 double getZ()
           
 boolean intersects(RepastGisFeature g)
          Defined in the openGis SimpleFeatureSpecification.
 boolean isMulti()
          Returns true if the feature is a "multi" type.
 boolean overlaps(RepastGisFeature g)
          Defined in the openGis SimpleFeatureSpecification.
 void setAttributes(Hashtable attr)
          Set the attributes for the feature.
 void setFeature(org.geotools.feature.Feature f)
          set the feature for this adapter
 void setGeometry(com.vividsolutions.jts.geom.Geometry geo)
          Add a jts geometry to this Adapter.
 void setX(double x)
           
 void setY(double y)
           
 void setZ(double z)
           
 boolean touches(RepastGisFeature g)
          Defined in the openGis SimpleFeatureSpecification.
 boolean within(RepastGisFeature g)
          Defined in the openGis SimpleFeatureSpecification.
 
Methods inherited from class uchicago.src.sim.network.DefaultNode
addInEdge, addInEdges, addOutEdge, addOutEdges, clearInEdges, clearOutEdges, getEdgesFrom, getEdgesTo, getFromNodes, getId, getInDegree, getInEdges, getInNodes, getNode, getNodeLabel, getNumInEdges, getNumOutEdges, getOutDegree, getOutEdges, getOutNodes, getRandomFromNode, getRandomNodeIn, getRandomNodeOut, getRandomToNode, getToNodes, hasEdgeFrom, hasEdgeTo, hasEdgeToOrFrom, makeRandomInEdge, makeRandomOutEdge, removeEdgesFrom, removeEdgesTo, removeInEdge, removeOutEdge, setNodeLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uchicago.src.sim.network.Node
addInEdge, addOutEdge, clearInEdges, clearOutEdges, getId, getInEdges, getNodeLabel, getOutEdges, hasEdgeFrom, hasEdgeTo, removeInEdge, removeOutEdge, setNodeLabel
 

Field Detail

attributes

protected Hashtable attributes

geo

protected com.vividsolutions.jts.geom.Geometry geo

multi

protected boolean multi
Constructor Detail

PointAdapter

public PointAdapter()
create an empty Adapter, not very useful.


PointAdapter

public PointAdapter(com.vividsolutions.jts.geom.Point p)
Create a new feature with no attributes.

Parameters:
p -

PointAdapter

public PointAdapter(org.geotools.feature.Feature f)
             throws Exception
create an adapter from a Geotools feature

Parameters:
f -
Throws:
Exception
Method Detail

setFeature

public void setFeature(org.geotools.feature.Feature f)
                throws Exception
set the feature for this adapter

Specified by:
setFeature in interface RepastGisFeature
Parameters:
f -
Throws:
Exception

setGeometry

public void setGeometry(com.vividsolutions.jts.geom.Geometry geo)
                 throws IllegalArgumentException
Add a jts geometry to this Adapter. This needs to be a com.vividsolutions.jts.geom.Point

Specified by:
setGeometry in interface RepastGisFeature
Parameters:
geo -
IllegalArgumentException

setAttributes

public void setAttributes(Hashtable attr)
Description copied from interface: RepastGisFeature
Set the attributes for the feature.

Specified by:
setAttributes in interface RepastGisFeature
Parameters:
attr -

getAttributeNames

public String[] getAttributeNames()
Return an array with the attribute names for this feature.

Specified by:
getAttributeNames in interface RepastGisFeature
Returns:

getGeometry

public com.vividsolutions.jts.geom.Geometry getGeometry()
Description copied from interface: RepastGisFeature
Gets the geometry that defines this feature.

Specified by:
getGeometry in interface RepastGisFeature
Returns:

getX

public double getX()
Specified by:
getX in interface SpatialNode

getY

public double getY()
Specified by:
getY in interface SpatialNode

getZ

public double getZ()
Specified by:
getZ in interface SpatialNode

setX

public void setX(double x)
Specified by:
setX in interface SpatialNode

setY

public void setY(double y)
Specified by:
setY in interface SpatialNode

setZ

public void setZ(double z)
Specified by:
setZ in interface SpatialNode

getCoordinates

public com.vividsolutions.jts.geom.Coordinate getCoordinates()

addAttribute

public void addAttribute(String key,
                         Object value)
Description copied from interface: RepastGisFeature
Add an attribute to the Fature.

Specified by:
addAttribute in interface RepastGisFeature
Parameters:
key -
value -

getAttribute

public Object getAttribute(String key)
Description copied from interface: RepastGisFeature
Get the value of the Attribute with given name.

Specified by:
getAttribute in interface RepastGisFeature
Parameters:
key -
Returns:
Value of Attribute.

isMulti

public boolean isMulti()
Returns true if the feature is a "multi" type.

Specified by:
isMulti in interface RepastGisFeature
Returns:
multi

intersects

public boolean intersects(RepastGisFeature g)
Defined in the openGis SimpleFeatureSpecification.

Specified by:
intersects in interface RepastGisFeature
Parameters:
g -
Returns:

touches

public boolean touches(RepastGisFeature g)
Defined in the openGis SimpleFeatureSpecification.

Specified by:
touches in interface RepastGisFeature
Parameters:
g -
Returns:

within

public boolean within(RepastGisFeature g)
Defined in the openGis SimpleFeatureSpecification.

Specified by:
within in interface RepastGisFeature
Parameters:
g -
Returns:

crosses

public boolean crosses(RepastGisFeature g)
Defined in the openGis SimpleFeatureSpecification.

Specified by:
crosses in interface RepastGisFeature
Parameters:
g -
Returns:

overlaps

public boolean overlaps(RepastGisFeature g)
Defined in the openGis SimpleFeatureSpecification.

Specified by:
overlaps in interface RepastGisFeature
Parameters:
g -
Returns:

disjoint

public boolean disjoint(RepastGisFeature g)
Defined in the openGis SimpleFeatureSpecification.

Specified by:
disjoint in interface RepastGisFeature
Parameters:
g -
Returns:

RePast
v. 2.0

Bug reports and feature requests to RePast