|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface COFormatter
This interface is designed to allow custom Object formatting for the core MathTools classes that might need it. Specifically it applies to the classes that
represent actual mathematical things. All return values are cast as generic Object
to allow maximum flexibility. As with the
GraphPaper.render()
method once a Custom Object Formatter finishes its work MathTools' is done.
The formatGeneric()
method is provided to catch anything not covered specifically that might need formatting. Question
and
Percent
instances should not need formatting but the methods are provided in case they do.
In addition to the methods specified below classes implementing COFormatter
must have a zero-argument constructor. This is the one
used by COFormatterFactory
to create instances.
The context Object is treated more formally here than in the graphing.*
package. It is created using a String key (optionally) and it is
assumed to contain all relevant contextual information needed to format the MathTools object. As with GraphKeys
it is optional but provided if
needed.
Method Summary | |
---|---|
java.lang.Object |
format(MathStat pMStat,
java.lang.Object pContext)
Format a MathStat Object. |
java.lang.Object |
format(MComplex pMCplx,
java.lang.Object pContext)
Format a MComplex per the supplied context. |
java.lang.Object |
format(MEquation pEqn,
java.lang.Object pContext)
Format a MEquation . |
java.lang.Object |
format(MFraction pFrac,
java.lang.Object pContext)
Format a MFraction . |
java.lang.Object |
format(MMatrix pMatrix,
java.lang.Object pContext)
Format a MMatrix properly. |
java.lang.Object |
format(MRadical pRoot,
java.lang.Object pContext)
Format a MRadical . |
java.lang.Object |
format(Polynomial pPoly,
java.lang.Object pContext)
Format a Polynomial . |
java.lang.Object |
format(Question pQues,
java.lang.Object pContext)
Format a Question . |
java.lang.Object |
formatGeneric(java.lang.Object pObject,
java.lang.Object pContext)
This method is provided to format anything not covered specifically. |
java.lang.Object |
formatXML(org.w3c.dom.Node pData,
java.lang.Object pContext)
Format XML data contained in a DOM Node . |
java.lang.Object |
formatXML(java.lang.String pData,
java.lang.Object pContext)
Format XML content represented as a String. |
java.lang.Object |
getContext(java.lang.String pType)
Get the formatting context Object if such is needed. |
boolean |
setParameter(java.lang.String pKey,
java.lang.Object pValue)
This is a very generic method used to configure the COFormatter instance. |
Method Detail |
---|
java.lang.Object getContext(java.lang.String pType)
pType
- The type of context to create.
java.lang.Object format(MFraction pFrac, java.lang.Object pContext)
MFraction
.
pFrac
- The MFraction to be formatted.pContext
- The context Object containing formatting information.java.lang.Object format(MEquation pEqn, java.lang.Object pContext)
MEquation
.
pEqn
- The MEquation to be formatted.pContext
- The context Object containing formatting information.java.lang.Object format(MRadical pRoot, java.lang.Object pContext)
MRadical
.
pRoot
- The MRadical to be formatted.pContext
- The context Object.java.lang.Object format(MMatrix pMatrix, java.lang.Object pContext)
MMatrix
properly.
pMatrix
- The MMatrix to be formatted.pContext
- The formatting context Object.java.lang.Object format(Polynomial pPoly, java.lang.Object pContext)
Polynomial
. This method must take all terms into account.
pPoly
- The Polynomial to be formatted.pContext
- The context Object containing formatting information.java.lang.Object format(Question pQues, java.lang.Object pContext)
Question
. The data within the question should be formatted internally but this method is provided in case it isn't.
pQues
- The Question to format.pContext
- The context Object for formatting.java.lang.Object format(MathStat pMStat, java.lang.Object pContext)
MathStat
Object.
pMStat
- The MathStat to format.pContext
- The Context Object.java.lang.Object format(MComplex pMCplx, java.lang.Object pContext)
MComplex
per the supplied context.
java.lang.Object formatGeneric(java.lang.Object pObject, java.lang.Object pContext)
pObject
- The Object to format.pContext
- The formatting Context to use.java.lang.Object formatXML(java.lang.String pData, java.lang.Object pContext)
pData
- The XML data to format.pContext
- The formatting Context Object.java.lang.Object formatXML(org.w3c.dom.Node pData, java.lang.Object pContext)
Node
.
pData
- The DOM Node XML data.pContext
- The format Context.boolean setParameter(java.lang.String pKey, java.lang.Object pValue)
COFormatter
instance. How it is used or if it is used must be specified in the
implementation documentation. The return value should only be false if the parameter requested absolutely cannot be set as requested.
pKey
- The name of the parameter to set.pValue
- The value of the parameter set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |