com.unitesk.atp.text.generation
Class DefaultFunction

java.lang.Object
  extended by com.unitesk.atp.text.generation.DefaultFunction
All Implemented Interfaces:
Function
Direct Known Subclasses:
PatternDefaultFunction, TreeDefaultFunction

public class DefaultFunction
extends Object
implements Function

The default implementation of Function interface.

Version:
$Id: DefaultFunction.java,v 1.2 2004/10/11 15:00:43 all-x Exp $
Author:
Alexey Demakov

Field Summary
protected  Generator generator
           
 
Constructor Summary
DefaultFunction()
           
 
Method Summary
 void process(Object arg)
          Outputs text representation of the specified object to generator using Generator.txtAsIs(String).
 void setGenerator(Generator generator)
          Associates or deassociates this function with text generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

generator

protected Generator generator
Constructor Detail

DefaultFunction

public DefaultFunction()
Method Detail

setGenerator

public void setGenerator(Generator generator)
Associates or deassociates this function with text generator. Function can be associated with text generator more than once - under different names. Function can not be associated with more than one text generator. So if parameter is not null association counter is incremented, otherwise - decremented.

Specified by:
setGenerator in interface Function
Parameters:
generator - The specified text generator.
Throws:
IllegalArgumentException - If function is already associated with some generator and the specified non-null parameter differs from it. Or if function is not associated and parameter is null.

process

public void process(Object arg)
Outputs text representation of the specified object to generator using Generator.txtAsIs(String).

Specified by:
process in interface Function
Parameters:
arg - The specified object.


Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.