notio
Interface TranslationInfoUnit

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
SimpleInfoUnit

public interface TranslationInfoUnit
extends java.io.Serializable

An interface for information units relating to translation so they can be given to different parsers and generators to ensure consistent representations. Common examples of these units include symbol tables. TranslationInfoUnits are contained within and passed around using TranslationContexts. Translators that are to exchange information via these units must agree on both a name for particular unit and a sub-interface of this interface which defines the methods usable on that unit. This allows for multiple instances of the same type of unit (e.g. a generic symbol table) but with different names for instances being used for different purposes.

See Also:
TranslationContext

Method Summary
 TranslationInfoUnit copyUnit()
          Returns a duplicate of this information unit that is distinct from the original.
 java.lang.String getUnitName()
          Returns the name of this translation unit.
 void resetUnit()
          Resets this information unit to its initial state.
 void setUnitName(java.lang.String newName)
          Sets the name of this translation unit.
 

Method Detail

setUnitName

public void setUnitName(java.lang.String newName)
Sets the name of this translation unit. Parsers and generators can use a name to retrieve the units they need from a TranslationContext.
Parameters:
newName - the new name for this unit.

getUnitName

public java.lang.String getUnitName()
Returns the name of this translation unit. Parsers and generators can use a name to retrieve the units they need from a TranslationContext.
Returns:
the name for this unit.

resetUnit

public void resetUnit()
Resets this information unit to its initial state. This method can be called by translators in order to ensure that a unit contains no information relating to earlier translation sessions.

copyUnit

public TranslationInfoUnit copyUnit()
Returns a duplicate of this information unit that is distinct from the original. This means that changes to the original will not affect the duplicate and vice versa.
Returns:
a duplicate of this unit.


Copyright 1998-2001 Finnegan Southey