public abstract class ProofWorkStmt
extends java.lang.Object
Constructor and Description |
---|
ProofWorkStmt(ProofWorksheet w)
Default ProofWorkStmt constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendToProofText(java.lang.StringBuilder sb)
Appends the contents of the input StringBuilder to the ProofWorkStmt
formula area.
|
abstract int |
computeFieldIdCol(int fieldId)
Function used for cursor positioning.
|
int |
getLineCnt()
Get count of number of lines used by this ProofWorkStmt.
|
ProofWorksheet |
getProofWorksheet() |
java.lang.String |
getStmtDiagnosticInfo()
Returns diagnostic data for this ProofWorkStmt, which in this case is the
Class name.
|
java.lang.StringBuilder |
getStmtText()
Get the ProofWorkStmt stmtText area.
|
boolean |
hasMatchingRefLabel(java.lang.String newRefLabel)
Base class function to determine whether the ProofWorkStmt Ref label
matches the input Ref label (always false in base class.)
|
boolean |
hasMatchingStepNbr(java.lang.String newStepNbr)
Base class function to determine whether the ProofWorkStmt step number
matches the input step number (always false in base class.)
|
java.lang.String |
load(java.lang.String firstToken)
Default load method for ProofWorkStmt that does not validate the input.
|
protected java.lang.String |
loadAllStmtTextGetNextStmt(java.lang.String prevToken)
Loads input token into ProofWorkStmt's stmtText then loads ALL following
whitespace AND tokens until the start of the next statement, returning
the next token without loading it into
|
protected java.lang.String |
loadStmtTextGetNextStmt(java.lang.String prevToken)
Loads input token into ProofWorkStmt's stmtText then loads following
whitespace and returns the next token, but without loading it into
stmtText.
|
protected java.lang.String |
loadStmtTextGetOptionalToken(java.lang.String prevToken)
Loads input token into ProofWorkStmt's stmtText then loads following
whitespace and returns the *next* token, but without loading it into
stmtText.
|
protected java.lang.String |
loadStmtTextGetRequiredToken(java.lang.String prevToken)
Loads input token into ProofWorkStmt's stmtText then loads following
whitespace and returns the next token, but without loading it into
stmtText.
|
protected void |
setStmtCursorToCurrLineColumn() |
abstract boolean |
stmtIsIncomplete()
Is statement incomplete?
|
abstract void |
tmffReformat()
Reformats Derivation Step using TMFF.
|
protected int |
updateLineCntUsingTokenizer(int prevLineNbr,
java.lang.String nextT) |
public ProofWorkStmt(ProofWorksheet w)
Every ProofWorkStmt starts out with "valid" status and lineCnt = 1!
w
- the owning ProofWorksheetpublic abstract boolean stmtIsIncomplete()
-- used primarily for cursor positioning:
-- a virtual method that checks the statement for the state of "incompleteness" of data as indicated by state variables in the specific ProofWorkStmt types.
public abstract int computeFieldIdCol(int fieldId)
fieldId
- value identify ProofWorkStmt field for cursor positioning,
as defined in PaConstants.FIELD_ID_*.public abstract void tmffReformat()
public boolean hasMatchingStepNbr(java.lang.String newStepNbr)
newStepNbr
- to compare to ProofWorkStmt step number.public boolean hasMatchingRefLabel(java.lang.String newRefLabel)
newRefLabel
- to compare to ProofWorkStmt Ref label.public java.lang.String load(java.lang.String firstToken) throws java.io.IOException, MMIOException, ProofAsstException
This is used for GeneratedProofStmt and CommentStmt -- and any other possible future statement where you, theoretically, want to be able to parse and load the input statement but don't care about the contents.
Output/Updates
firstToken
- the first tokenjava.io.IOException
- if IO errorMMIOException
- if an error occurredProofAsstException
- if an error occurredpublic void appendToProofText(java.lang.StringBuilder sb)
sb
- StringBuilder to append to stmtText.public int getLineCnt()
public ProofWorksheet getProofWorksheet()
public java.lang.String getStmtDiagnosticInfo()
public java.lang.StringBuilder getStmtText()
protected void setStmtCursorToCurrLineColumn()
protected int updateLineCntUsingTokenizer(int prevLineNbr, java.lang.String nextT)
protected java.lang.String loadStmtTextGetRequiredToken(java.lang.String prevToken) throws java.io.IOException, MMIOException, ProofAsstException
Blows up if there is no next token or whitespace because they are required at the current parse position within the ProofWorkStmt.
prevToken
- the first token of the Stmtjava.io.IOException
- if an error occurredMMIOException
- if an error occurredProofAsstException
- if an error occurredprotected java.lang.String loadStmtTextGetOptionalToken(java.lang.String prevToken) throws java.io.IOException, MMIOException, ProofAsstException
Returns empty String (length = 0) if end of file reached.
prevToken
- the first tokenjava.io.IOException
- if an error occurredMMIOException
- if an error occurredProofAsstException
- if an error occurredprotected java.lang.String loadStmtTextGetNextStmt(java.lang.String prevToken) throws java.io.IOException, MMIOException, ProofAsstException
Blows up if the next token does not begin in column 1, which indicates the start of the next statement.
Returns empty String (length = 0) if end of file reached.
prevToken
- the first tokenjava.io.IOException
- if an error occurredMMIOException
- if an error occurredProofAsstException
- if an error occurredprotected java.lang.String loadAllStmtTextGetNextStmt(java.lang.String prevToken) throws java.io.IOException, MMIOException, ProofAsstException
Returns empty String (length = 0) if end of file reached.
prevToken
- the token from the last calljava.io.IOException
- if an error occurredMMIOException
- if an error occurredProofAsstException
- if an error occurred