jcreek.representation.cbr
Class StringEntity

java.lang.Object
  extended byjcreek.representation.Entity
      extended byjcreek.representation.EntityType
          extended byjcreek.representation.cbr.StringEntity
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class StringEntity
extends EntityType

A particular type of entity that encapsulates an instance of String.

Version:
1.0
Author:
Elise Bakke

Constructor Summary
StringEntity(Entity ent)
          Creates a StringEntity from an existing Entity.
StringEntity(KnowledgeModel model, java.lang.String string, Entity type)
          Creates a new StringEntity that is a value of a supplied entity.
StringEntity(KnowledgeModel model, java.lang.String string, java.lang.String description)
          Creates a new StringEntity.
 
Method Summary
 java.lang.String asString()
          Returns the encapsulated string.
static boolean matches(Entity ent)
          An Entity is of type StringEntity if and only if it encapsulates an object that is an instance of java.lang.String.
 void setString(java.lang.String string)
          Changes the encapsulated string of this entity.
 
Methods inherited from class jcreek.representation.Entity
addConstraint, addRelation, addRelation, addRelation, addRelation, addRelation, addRelation, clone, compareTo, equals, getAllSubclasses, getAllSubclassesCollection, getAllSuperclasses, getAllSuperclassesCollection, getConstraints, getCreationTime, getCurrentPartition, getDescription, getEntityData, getEntityObject, getFrameString, getID, getImmediateSubclasses, getImmediateSubclassesCollection, getImmediateSuperclasses, getImmediateSuperclassesCollection, getInheritedConstraints, getKnowledgeModel, getLocalConstraints, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelations, getLocalRelations, getLocalRelations, getLocalRelations, getLocalRelations, getName, getRelation, getRelation, getRelation, getRelation, getRelationNames, getRelations, getRelations, getRelations, getRelations, getRelations, getRelations, getRelations, getRelationTypes, getValueString, hasEntityObject, hashCode, isAssignableFrom, remove, removeConstraint, removeEntityData, setDescription, setEntityObject, setName, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringEntity

public StringEntity(KnowledgeModel model,
                    java.lang.String string,
                    java.lang.String description)
Creates a new StringEntity.

Parameters:
model - The KnowledgeModel to create the new entity in.
string - The string to encapsulate in this entity.
description - The description of the entity.

StringEntity

public StringEntity(KnowledgeModel model,
                    java.lang.String string,
                    Entity type)
Creates a new StringEntity that is a value of a supplied entity.


StringEntity

public StringEntity(Entity ent)
             throws EntityTypeNotMatchedException
Creates a StringEntity from an existing Entity.

Method Detail

setString

public void setString(java.lang.String string)
Changes the encapsulated string of this entity.

Parameters:
string - The new String.

asString

public java.lang.String asString()
Returns the encapsulated string.


matches

public static boolean matches(Entity ent)
An Entity is of type StringEntity if and only if it encapsulates an object that is an instance of java.lang.String.



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