no.uio.edd.model.geo.map
Class GeoRelationship

java.lang.Object
  extended by no.uio.edd.model.geo.map.GeoRelationship

public class GeoRelationship
extends java.lang.Object

Author:
oeide A class used to store a relationship between places in a map model There can only be one relationship between any set of places, thus, a number of URLs can exist as there can be multiple relationships in the RDF model.

Constructor Summary
GeoRelationship(java.lang.String id, GeoPlace source, GeoPlace target)
          Create a new relationship between two places.
 
Method Summary
 java.lang.String addUrl(java.lang.String newUrl)
           
 double getDirection()
           
 double getDistance()
           
 GeoPlace getDomain()
           
 java.lang.String getId()
           
 double getPartOfDirection()
           
 GeoPlace getRange()
           
 boolean interpretDirAndDist()
           
 boolean isBetween()
           
 boolean isPartOf()
          That is, domain is part of range.
 void setBetween(boolean isBetween)
           
 void setDirection(double direction)
           
 void setDistance(double distance)
           
 void setPartOf(boolean isPartOf)
          That is, domain is part of range.
 void setPartOfDirection(double partOfDirection)
           
static GeoRelationship[] toGeoRelArr(ExtendableObjectList objList)
          Convert an ExtendableObjectList containing GeoRelationship objects to a GeoRelationship array, removing null elements.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeoRelationship

public GeoRelationship(java.lang.String id,
                       GeoPlace source,
                       GeoPlace target)
Create a new relationship between two places.

Parameters:
id - The ID to set.
source - Source place.
target - Target place.
Method Detail

getDirection

public double getDirection()
Returns:
the direction

setDirection

public void setDirection(double direction)
Parameters:
direction - the direction to set

getDistance

public double getDistance()
Returns:
the distance

setDistance

public void setDistance(double distance)
Parameters:
distance - the distance to set

isPartOf

public boolean isPartOf()
That is, domain is part of range.

Returns:
the isPartOf

setPartOf

public void setPartOf(boolean isPartOf)
That is, domain is part of range.

Parameters:
isPartOf - the isPartOf to set

isBetween

public boolean isBetween()
Returns:
the isBetween

setBetween

public void setBetween(boolean isBetween)
Parameters:
isBetween - the isBetween to set

getId

public java.lang.String getId()
Returns:
the id

getDomain

public GeoPlace getDomain()
Returns:
the source

getRange

public GeoPlace getRange()
Returns:
the target

addUrl

public java.lang.String addUrl(java.lang.String newUrl)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toGeoRelArr

public static GeoRelationship[] toGeoRelArr(ExtendableObjectList objList)
Convert an ExtendableObjectList containing GeoRelationship objects to a GeoRelationship array, removing null elements.

Parameters:
objList - The object list.
Returns:
The array.

interpretDirAndDist

public boolean interpretDirAndDist()

getPartOfDirection

public double getPartOfDirection()
Returns:
the partOfDirection

setPartOfDirection

public void setPartOfDirection(double partOfDirection)
Parameters:
partOfDirection - the partOfDirection to set