story.scheherazade.verbalizer
Class Serialization

java.lang.Object
  extended by story.scheherazade.verbalizer.Serialization

public class Serialization
extends java.lang.Object


Constructor Summary
Serialization()
           
Serialization(java.lang.String surfaceText)
           
Serialization(java.lang.String surfaceText, SerializationSymbol relatedSymbol)
           
 
Method Summary
 void addSymbolInterval(SymbolInterval interval)
          Manually specify a symbol interval for a portion of the text.
 void append(Serialization serialization)
           
 void append(java.lang.String s)
           
 java.lang.String capitalize()
           
 void clearSymbolIntervals()
          Clear all symbol intervals.
 int getIntervalEnd(int position)
          Get the end of the nearest symbol interval in which a given character in the serialization falls.
 SymbolInterval getIntervalOfSymbol(SerializationSymbol relatedSymbol)
          Retrieve the interval for a given symbol, if the symbol has an interval associated with it.
 int getIntervalStart(int position)
          Get the beginning of the nearest symbol interval in which a given character in the serialization falls.
 SerializationSymbol getRelatedSymbol(int position)
          Retrieve the object that a given character in the serialization points to.
 java.util.Vector getSymbolIntervals()
          Get an edit-safe copy of the symbol intervals used in the Serialization.
 boolean hasRelatedSymbol(int position)
           
 int length()
           
 java.lang.StringBuffer renderSymbolIntervals()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Serialization

public Serialization()

Serialization

public Serialization(java.lang.String surfaceText)

Serialization

public Serialization(java.lang.String surfaceText,
                     SerializationSymbol relatedSymbol)
Method Detail

append

public void append(java.lang.String s)

clearSymbolIntervals

public void clearSymbolIntervals()
                          throws Scheherexception
Clear all symbol intervals.

Throws:
Scheherexception

addSymbolInterval

public void addSymbolInterval(SymbolInterval interval)
                       throws Scheherexception
Manually specify a symbol interval for a portion of the text.

Throws:
Scheherexception

append

public void append(Serialization serialization)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

capitalize

public java.lang.String capitalize()

length

public int length()

getSymbolIntervals

public java.util.Vector getSymbolIntervals()
Get an edit-safe copy of the symbol intervals used in the Serialization. (Note: Intervals might overlap.)


renderSymbolIntervals

public java.lang.StringBuffer renderSymbolIntervals()
                                             throws Scheherexception
Throws:
Scheherexception

getIntervalOfSymbol

public SymbolInterval getIntervalOfSymbol(SerializationSymbol relatedSymbol)
                                   throws Scheherexception
Retrieve the interval for a given symbol, if the symbol has an interval associated with it. Otherwise, returns null.

Throws:
Scheherexception

getRelatedSymbol

public SerializationSymbol getRelatedSymbol(int position)
                                     throws Scheherexception
Retrieve the object that a given character in the serialization points to.

Throws:
Scheherexception

getIntervalStart

public int getIntervalStart(int position)
                     throws Scheherexception
Get the beginning of the nearest symbol interval in which a given character in the serialization falls.

Throws:
Scheherexception

hasRelatedSymbol

public boolean hasRelatedSymbol(int position)
                         throws Scheherexception
Throws:
Scheherexception

getIntervalEnd

public int getIntervalEnd(int position)
                   throws Scheherexception
Get the end of the nearest symbol interval in which a given character in the serialization falls.

Throws:
Scheherexception


Copyright © 2011 David K. Elson. All Rights Reserved.