jcreek.representation
Class LocalRelationData

java.lang.Object
  extended byjcreek.representation.LocalRelationData
All Implemented Interfaces:
RelationData, java.io.Serializable

public class LocalRelationData
extends java.lang.Object
implements RelationData, java.io.Serializable

Implementation of RelationData that stores the relation data in memory or by serialization.

Version:
1.0
Author:
Frode Sørmo
See Also:
Serialized Form

Method Summary
 void addOverridenBy(Relation override)
          This relation is market as beeing overriden by another relation.
 void addOverriding(Relation override)
          This relation is market as overriding another relation.
 long getCreationTime()
          Returns the time of creation for this relation in the same format as System.getCurrentMillis();
 java.lang.String getDescription()
          Returns the description of this entity.
 double getExplanationStrength()
          Returns the explanation strength for this relation.
 Entity getFrom()
          Returns the entity from where the relation originates.
 java.lang.Object getID()
          Returns a unique ID for the entity this elationData represents.
 Relation getInverse()
          Returns the inverse of this relation.
 Relation[] getOverridenBy()
          Returns which relations this relation is overriden by.
 Relation[] getOverrides()
          Returns the relation (if any) this relation overrides.
 Entity getRelationType()
          Returns the instance of Entity describing this relation's type.
 Entity getValue()
          Returns the entity this relation is pointing at.
 boolean isOverridden()
          Returns true if there is at least one relation overriding this relation.
 boolean isOverriding()
          Returns true if this relation overrides another relation.
 void remove()
          Permanently removes the relation represented by this RelationData object.
 void removeOverriddenBy(Relation override)
          Removes a relation from beeing overriden by this relation.
 void removeOverriding(Relation override)
          Removes a relation from beeing overriden by this relation.
 void setCreationTime(long time)
          Sets the creation time.
 void setDescription(java.lang.String description)
          Sets the desciption of this relation.
 void setExplanationStrength(double value)
          Sets the strength variable contains the explanation strength for this relation.
 void setFrom(Entity from)
          Sets the from-entity (the origin) of the relation.
 void setInverse(Relation inverse)
          Sets the inverse of this relation to be the given relation.
 void setRelationType(Entity relationType)
          Sets this relation's type.
 void setValue(Entity value)
          Sets the value (the target) of the relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getID

public java.lang.Object getID()
Returns a unique ID for the entity this elationData represents.

Specified by:
getID in interface RelationData

setFrom

public void setFrom(Entity from)
Sets the from-entity (the origin) of the relation.

Specified by:
setFrom in interface RelationData
Parameters:
from - The new from-entity of the relation.

getFrom

public Entity getFrom()
Returns the entity from where the relation originates.

Specified by:
getFrom in interface RelationData

setValue

public void setValue(Entity value)
Sets the value (the target) of the relation.

Specified by:
setValue in interface RelationData
Parameters:
value - The new value of the relation.

getValue

public Entity getValue()
Returns the entity this relation is pointing at.

Specified by:
getValue in interface RelationData

getRelationType

public Entity getRelationType()
Returns the instance of Entity describing this relation's type.

Specified by:
getRelationType in interface RelationData

setRelationType

public void setRelationType(Entity relationType)
Sets this relation's type.

Specified by:
setRelationType in interface RelationData
Parameters:
relationType - The Entity describing this relation's type.

setDescription

public void setDescription(java.lang.String description)
Sets the desciption of this relation.

Specified by:
setDescription in interface RelationData
Parameters:
description - The String containing the description.

getDescription

public java.lang.String getDescription()
Returns the description of this entity.

Specified by:
getDescription in interface RelationData

getCreationTime

public long getCreationTime()
Returns the time of creation for this relation in the same format as System.getCurrentMillis();

Specified by:
getCreationTime in interface RelationData

setCreationTime

public void setCreationTime(long time)
Sets the creation time. T

Specified by:
setCreationTime in interface RelationData
Parameters:
time - The time in the format of System.getCurrentMillis() this relation was created.

setExplanationStrength

public void setExplanationStrength(double value)
Sets the strength variable contains the explanation strength for this relation.

Specified by:
setExplanationStrength in interface RelationData
Parameters:
value - The explanation strength.

getExplanationStrength

public double getExplanationStrength()
Returns the explanation strength for this relation.

Specified by:
getExplanationStrength in interface RelationData

addOverriding

public void addOverriding(Relation override)
This relation is market as overriding another relation.

Specified by:
addOverriding in interface RelationData
Parameters:
override - The relation to override

removeOverriding

public void removeOverriding(Relation override)
Removes a relation from beeing overriden by this relation.

Specified by:
removeOverriding in interface RelationData
Parameters:
override - The relation to remove from the overide list.

getOverrides

public Relation[] getOverrides()
Returns the relation (if any) this relation overrides. See setOverriding().

Specified by:
getOverrides in interface RelationData

isOverriding

public boolean isOverriding()
Returns true if this relation overrides another relation. See setOverriding().

Specified by:
isOverriding in interface RelationData

isOverridden

public boolean isOverridden()
Returns true if there is at least one relation overriding this relation. See setOverriding().

Specified by:
isOverridden in interface RelationData

addOverridenBy

public void addOverridenBy(Relation override)
This relation is market as beeing overriden by another relation.

Specified by:
addOverridenBy in interface RelationData
Parameters:
override - The relation to override

removeOverriddenBy

public void removeOverriddenBy(Relation override)
Removes a relation from beeing overriden by this relation.

Specified by:
removeOverriddenBy in interface RelationData
Parameters:
override - The relation to remove from the overide list.

getOverridenBy

public Relation[] getOverridenBy()
Returns which relations this relation is overriden by. See setOverriding().

Specified by:
getOverridenBy in interface RelationData

remove

public void remove()
Permanently removes the relation represented by this RelationData object.

Specified by:
remove in interface RelationData

setInverse

public void setInverse(Relation inverse)
Sets the inverse of this relation to be the given relation.

Specified by:
setInverse in interface RelationData

getInverse

public Relation getInverse()
Returns the inverse of this relation. If it has none, null is returned.

Specified by:
getInverse in interface RelationData


Created at IDI, NTNU by the Artificial Intelligence and Learning group