jcreek.representation
Class NumberEntity

java.lang.Object
  extended byjcreek.representation.Entity
      extended byjcreek.representation.EntityType
          extended byjcreek.representation.NumberEntity
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
DoubleEntity

public class NumberEntity
extends EntityType

A particular type of entity that encapsulates an instance of any of the Java Number classes.

Version:
1.0
Author:
Frode Sørmo

Constructor Summary
NumberEntity(Entity ent)
          Creates a NumberEntity from an existing Entity.
NumberEntity(KnowledgeModel model, java.lang.Number number, Entity type)
          Creates a new NumberEntity that is a value of a supplied entity.
NumberEntity(KnowledgeModel model, java.lang.Number number, java.lang.String description)
          Creates a new NumberEntity.
 
Method Summary
 java.lang.Number asNumber()
          Returns the encapsulated number.
static boolean matches(Entity ent)
          An Entity is of type NumberEntity if and only if it encapsulates an object that is an instance of java.lang.Number.
 void setValue(java.lang.Number number)
          Changes the encapsulated number 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

NumberEntity

public NumberEntity(KnowledgeModel model,
                    java.lang.Number number,
                    java.lang.String description)
Creates a new NumberEntity.

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

NumberEntity

public NumberEntity(KnowledgeModel model,
                    java.lang.Number number,
                    Entity type)
Creates a new NumberEntity that is a value of a supplied entity.


NumberEntity

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

Method Detail

setValue

public void setValue(java.lang.Number number)
Changes the encapsulated number of this entity.

Parameters:
number - The new Number.

asNumber

public java.lang.Number asNumber()
Returns the encapsulated number.


matches

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



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