diva.sketch.toolbox
Class TextData

java.lang.Object
  extended by diva.util.xml.AbstractXmlBuilder
      extended by diva.sketch.toolbox.TextData
All Implemented Interfaces:
TypedData, XmlBuilder

public class TextData
extends AbstractXmlBuilder
implements TypedData

A typed data that holds a recognized text string. An object of this type might is generated by the Calligrapher recognizer, and can be used as a common type for text recognized by any handwriting recognition software.

Version:
$Revision: 1.9 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
static Type type
          The static type associated with this typed data.
 
Constructor Summary
TextData()
          Construct a text data that contains an empty string.
TextData(String text)
          Construct a text data that contains the given string.
 
Method Summary
 Object build(XmlElement in, String type)
          Given an XmlElement, create and return an internal representtion of it.
 boolean equals(Object o)
          Equality test: are the strings identical?
 XmlElement generate(Object in)
          Unable to generate XML by default.
 String getText()
          Return the text string contained by this data.
 Type getType()
          Return the type of this data, implementing the TypedData interface.
 void setText(String text)
          Set the text string contained by this data.
 String toString()
          Return a string representation of this data for debugging.
 
Methods inherited from class diva.util.xml.AbstractXmlBuilder
getDelegate, setDelegate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface diva.util.xml.XmlBuilder
setDelegate
 

Field Detail

type

public static final Type type
The static type associated with this typed data.

Constructor Detail

TextData

public TextData()
Construct a text data that contains an empty string.


TextData

public TextData(String text)
Construct a text data that contains the given string.

Method Detail

getType

public Type getType()
Return the type of this data, implementing the TypedData interface. Returns the static type TextData.type.

Specified by:
getType in interface TypedData

getText

public String getText()
Return the text string contained by this data.


setText

public void setText(String text)
Set the text string contained by this data.


equals

public boolean equals(Object o)
Equality test: are the strings identical?

Overrides:
equals in class Object

build

public Object build(XmlElement in,
                    String type)
Description copied from class: AbstractXmlBuilder
Given an XmlElement, create and return an internal representtion of it. Implementors should also provide a more type-specific version of this method:
   public Graph build (XmlELement elt, String type);
 

Specified by:
build in interface XmlBuilder
Specified by:
build in class AbstractXmlBuilder

generate

public XmlElement generate(Object in)
Description copied from class: AbstractXmlBuilder
Unable to generate XML by default.

Specified by:
generate in interface XmlBuilder
Overrides:
generate in class AbstractXmlBuilder

toString

public String toString()
Return a string representation of this data for debugging.

Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.