com.rubecula.spreadsheet
Class TextPresentation

java.lang.Object
  |
  +--com.rubecula.util.Presentation
        |
        +--com.rubecula.spreadsheet.TextPresentation
All Implemented Interfaces:
Auditable

public class TextPresentation
extends Presentation

Class to model the presentation of pure text in a spreadsheet cell.

Version:
$Revision: 1.1 $
Author:
Robin Hillyard

Field Summary
(package private) static java.lang.String _PresentableClass
          The name of the class that will be used to create a Presentable from a TextPresentation, when invoking the parse() method.
 
Fields inherited from class com.rubecula.util.Presentation
$empty, $Stars
 
Constructor Summary
TextPresentation(java.lang.String s)
          Primary constructor.
 
Method Summary
 java.lang.String audit(java.lang.String label)
          Method to return a detailed string from an object for debugging purposes.
 java.lang.String getIdentifier()
          Method to get the specific identifier for an object.
 Presentable parse()
          Method to parse this text presentation and create a new Presentable object.
 java.lang.String toString(int width)
          Render this Presentation as a String within the width specified.
 
Methods inherited from class com.rubecula.util.Presentation
audit, audit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_PresentableClass

static java.lang.String _PresentableClass
The name of the class that will be used to create a Presentable from a TextPresentation, when invoking the parse() method.

Constructor Detail

TextPresentation

public TextPresentation(java.lang.String s)
Primary constructor.

Parameters:
s - the text for the new TextPresentation.
Method Detail

toString

public java.lang.String toString(int width)
Render this Presentation as a String within the width specified.

Specified by:
toString in class Presentation
Parameters:
width - the max. number of characters within which to output the presentation.
Returns:
a representation (rendering) of this Presentation.
Throws:
PresentationException - if the presentation cannot be rendered within the given width.

audit

public java.lang.String audit(java.lang.String label)
Description copied from interface: Auditable
Method to return a detailed string from an object for debugging purposes.

Parameters:
label - the label to associate with the data. If label is non-null, a more detailed audit will be returned (this normally occurs only at the top level).
Returns:
the detailed string.

parse

public Presentable parse()
Method to parse this text presentation and create a new Presentable object.

Specified by:
parse in class Presentation
Returns:
an object of class defined by _PresentableClass.
Throws:
java.lang.RuntimeException - if the text presentation cannot be parsed.

getIdentifier

public java.lang.String getIdentifier()
Method to get the specific identifier for an object.

Returns:
the text itself.