ucot.output
Class Output

java.lang.Object
  extended by ucot.output.Output
All Implemented Interfaces:
OutputInterface

public class Output
extends java.lang.Object
implements OutputInterface

Simple outputer that prints AnalyzeModel to the standard output.

Author:
pajumasu

Field Summary
private  java.util.Properties options
           
 
Constructor Summary
Output()
           
 
Method Summary
 java.lang.String getName()
          Returns adapter's name
 java.util.Properties getOptions()
          Returns adapter's options
private  java.lang.String getStringFor(AnalyzeModel model, Thing i, java.lang.String preString, java.util.Set<Thing> handled)
          Creates string representation for given thing.
 void output(AnalyzeModel model, java.net.URL url)
          Outputs analyze model.
 void output(AnalyzeModel model, java.net.URL url, java.lang.String preString)
           
 void setOptions(java.util.Properties options)
          Sets options for the adapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

private java.util.Properties options
Constructor Detail

Output

public Output()
Method Detail

getStringFor

private java.lang.String getStringFor(AnalyzeModel model,
                                      Thing i,
                                      java.lang.String preString,
                                      java.util.Set<Thing> handled)
Creates string representation for given thing. Items are printed directly. Relations are printed recursively so that both to and from parts are queried again from getStringFor-method. Mehod also queries for relations that originates from the to part of handled relation and prints them too. For example relations [A -> B] [B -> C] are printed quite like [A -> B [B -> C] ] So printer relation is beign opened to the chain of relations that are connected to it.

Parameters:
model - AnalyzeModel which is used to get futher relations.
i - the thing the string is wanted for.
preString - String that is added before the representation (basically the indentation). param handled Set of already handled things so we dont crash on loop relations.
Returns:

output

public void output(AnalyzeModel model,
                   java.net.URL url)
Description copied from interface: OutputInterface
Outputs analyze model.

Specified by:
output in interface OutputInterface
Parameters:
model - Analyze model to output

output

public void output(AnalyzeModel model,
                   java.net.URL url,
                   java.lang.String preString)

getName

public java.lang.String getName()
Description copied from interface: OutputInterface
Returns adapter's name

Specified by:
getName in interface OutputInterface
Returns:

setOptions

public void setOptions(java.util.Properties options)
Description copied from interface: OutputInterface
Sets options for the adapter

Specified by:
setOptions in interface OutputInterface
Parameters:
options - options for the adapter

getOptions

public java.util.Properties getOptions()
Description copied from interface: OutputInterface
Returns adapter's options

Specified by:
getOptions in interface OutputInterface
Returns:
adapter's options