|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.recognition.Type
public final class Type
A unique identifier for the type of a piece of data that results from a recognition. For example, different drawings of squares have different parameters (size, etc.) but they all have the same type.
The type system implemented in Diva is semi-dynamic. There is a class SimpleData that is dynamically typed; the only data that it contains is the type that is associated with a particular recognized object. For all other objects with semantic information (e.g. TextType, which contains the recognized text), the type system uses Java's runtime type system. This is an implementation detail, and is transparent to the user.
There are two ways to get a handle to a type object. The static method Type.getType with a String name argument will return a static type if the name has been registered as static. Otherwise it will return a dynamic type. There is also a getType method with a Class object argument that can be used to create a static type.
TypedData
,
SimpleData
Field Summary | |
---|---|
static Type |
NO_TYPE
The type to be associated with an unrecognized piece of data. |
Method Summary | |
---|---|
static void |
addStaticType(String staticType)
Add a static type to the Type system. |
boolean |
equals(Object o)
Return whether the given type object is equivalent to this one. |
String |
getID()
Return the type ID of this object. |
Type |
getParent()
Return the parent type of this one. |
int |
hashCode()
Override the hashCode() method so that objects of the same type hash to the same index. |
static boolean |
isStaticType(String typeID)
Return whether the given type name has been registered as a native type in this type system. |
static Type |
makeType(Class c)
Return the type object associated with the given class and register it as static. |
static Type |
makeType(String typeName)
Return the type object associated with the given type name. |
String |
toString()
Return a string representation of the type object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Type NO_TYPE
Method Detail |
---|
public static void addStaticType(String staticType) throws ClassNotFoundException
ClassNotFoundException
public boolean equals(Object o)
equals
in class Object
public String getID()
public Type getParent()
public int hashCode()
hashCode
in class Object
public static boolean isStaticType(String typeID)
public static Type makeType(String typeName)
public static Type makeType(Class c)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |