org.extex.ocpware.writer
Class AbstractWriter

java.lang.Object
  extended by org.extex.ocpware.writer.AbstractWriter
All Implemented Interfaces:
OcpWriter
Direct Known Subclasses:
OcpExTeXWriter, OcpOmegaWriter

public abstract class AbstractWriter
extends java.lang.Object
implements OcpWriter

This is an abstract base class for ΩCP writers which handles the application of a resource bundle.

Version:
$Revision: 6021 $
Author:
Gerd Neugebauer

Constructor Summary
AbstractWriter()
          Creates a new object.
 
Method Summary
protected  boolean booleanResource(java.lang.String key)
          Extract a boolean value from a resource bundle.
protected  java.lang.String format(java.lang.String key, java.lang.Object... a)
          Apply a message format and handle exceptions gracefully.
protected  int room(java.util.List<int[]> a)
          Compute the sum of length of a list of arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.extex.ocpware.writer.OcpWriter
write
 

Constructor Detail

AbstractWriter

public AbstractWriter()
Creates a new object.

Method Detail

room

protected int room(java.util.List<int[]> a)
Compute the sum of length of a list of arrays.

Parameters:
a - a list of arrays
Returns:
the sum of length

format

protected java.lang.String format(java.lang.String key,
                                  java.lang.Object... a)
Apply a message format and handle exceptions gracefully.

Parameters:
key - the resource key
a - the arguments
Returns:
the formatted result

booleanResource

protected boolean booleanResource(java.lang.String key)
Extract a boolean value from a resource bundle.

Parameters:
key - the key in the resource bundle
Returns:
the boolean value; it defaults to false