com.rubecula.spreadsheet
Class Text

java.lang.Object
  |
  +--com.rubecula.spreadsheet.Text
All Implemented Interfaces:
Presentable

public class Text
extends java.lang.Object
implements Presentable

Class to represent text which is the value of a spreadsheet cell.

Version:
$Revision: 1.2 $
Author:
Robin Hillyard

Constructor Summary
Text(java.lang.String s)
           
 
Method Summary
 java.lang.String getType()
          This method is primarily for development purposes: it yields the name of the class of the presentable object or, in some cases, the class of the presentable object indirectly referenced.
 Presentable makePresentableInstance(Presentation x)
          Instance method to convert a Presentation into a Presentable.
 Presentation present(AttrMap attributes)
          Convert this Presentable object into a Presentation, according to the set of attributes provided.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Text

public Text(java.lang.String s)
Method Detail

present

public Presentation present(AttrMap attributes)
Convert this Presentable object into a Presentation, according to the set of attributes provided.

Specified by:
present in interface Presentable
Parameters:
attributes - a map of the desired attributes for this presentation.
Returns:
an appropriate instance of Presentation.

getType

public java.lang.String getType()
This method is primarily for development purposes: it yields the name of the class of the presentable object or, in some cases, the class of the presentable object indirectly referenced. The text returned is canonical class name (subclasses may choose to override this).

Specified by:
getType in interface Presentable
Returns:
a representation of the effective class of this object.

makePresentableInstance

public Presentable makePresentableInstance(Presentation x)
Instance method to convert a Presentation into a Presentable. Ideally, this would be a class method, but such a method cannot be defined in an interface. Nor can it be defined in an abstract class with the intention of overriding it in a subclass. Polymorphism just doesn't work that way.
Therefore, the present value (as in fields) of the instance is essentially ignored - only the methods are important.

Specified by:
makePresentableInstance in interface Presentable
Parameters:
x - a presentation of a number which you want to convert into a number.
Returns:
a number in the form of a Presentable.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object