|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jml2b.util.Profiler jml2b.formula.Formula jml2b.formula.TriaryForm
This class implements tri-ary formula, that is conditional formula coming
from the Java structure a ? b : c
or equals with restricted
domains formulas.
The token associated with those formulas can be
Ja_QUESTION
EQUALS_RESTRICT_DOM
EQUAL_SUBSTRACTION_DOM
Field Summary |
Constructor Summary | |
TriaryForm(byte nodeType,
Formula cond,
Formula left,
Formula right)
Constructs a question formula from three formulas. |
|
TriaryForm(TriaryForm f)
|
Method Summary | |
java.lang.Object |
clone()
Clones the formula. |
int |
contains(java.util.Vector selectedFields)
|
boolean |
equals(java.lang.Object f)
Returns whether the formula equals the parameter. |
void |
garbageIdent()
Annotates all the fields that appear in the formula to declare them in the Atelier B files. |
BasicType |
getBasicType()
Returns the type of a formula |
Formula |
getF1()
Returns the f1. |
void |
getFields(java.util.Set fields)
Collects the fields that occur in the formula. |
Formula |
getLeft()
Returns the left. |
Formula |
getRight()
Returns the right. |
Formula |
instancie(Formula b)
Replaces this with the parameter in the expression. |
boolean |
is(Formula f)
Returns whether the formula corresponds to a read formula. |
boolean |
isObvious(boolean atTheEnd)
Returns whether a formula is obvious. |
void |
processIdent()
Collects all the indentifier of a formula to give them an index in the identifer array. |
void |
save(IJml2bConfiguration config,
IOutputStream s,
IJmlFile jf)
Saves the formula in a .jpo file |
Formula |
sub(Formula a,
Formula b,
boolean subInCalledOld)
Applies a substitution on a formula. |
Formula |
subIdent(java.lang.String a,
Formula b)
Applies a substitution on a formula. |
Formula |
suppressSpecialOld(int token)
Suppress the called old pragmas. |
Methods inherited from class jml2b.formula.Formula |
and, create, declarField, domainRestrict, getFalse, getNodeType, getNull, implies, indent, isBFalse, matchAEqualsNull, not, oldParam, or, renameParam, sub, toJava, toLang, toVector |
Methods inherited from class jml2b.util.Profiler |
runGC |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TriaryForm(TriaryForm f)
public TriaryForm(byte nodeType, Formula cond, Formula left, Formula right)
cond
- The condition formulaleft
- The formula corresponding to a valid conditionright
- The formula corresponding to a unvalid conditionMethod Detail |
public java.lang.Object clone()
Formula
clone
in class Formula
public void processIdent()
Formula
processIdent
in class Formula
jml2b.pog.IdentifierResolver#bIdents
public Formula instancie(Formula b)
Formula
this
with the parameter in the expression.
instancie
in class Formula
b
- expression on which the method where the expression occurs is
called.
public Formula sub(Formula a, Formula b, boolean subInCalledOld)
Formula
sub
in class Formula
a
- the substituted formulab
- the new formulasubInCalledOld
- specify whether the substitution should also be
applied in the called old construction
public Formula suppressSpecialOld(int token)
Formula
suppressSpecialOld
in class Formula
public Formula subIdent(java.lang.String a, Formula b)
Formula
subIdent
in class Formula
a
- the substituted string correspondingto an identifierb
- the new formula
public boolean equals(java.lang.Object f)
Formula
equals
in class Formula
f
- the checked parameter
true
if the formula syntaxically equals the
parameter, false
otherwisepublic boolean is(Formula f)
Formula
is
in class Formula
f
- a read formula coming from a jpo file
true
if the formula equals to the read formula,
false
otherwise.public int contains(java.util.Vector selectedFields)
contains
in class Formula
public boolean isObvious(boolean atTheEnd)
Formula
isObvious
in class Formula
true
if the formula is considered as obvious,
false
otherwisepublic void save(IJml2bConfiguration config, IOutputStream s, IJmlFile jf) throws java.io.IOException
Formula
save
in class Formula
config
- s
- the ouputstream corresponding to a jpo filejf
-
java.io.IOException
- when the formula cannot be saved.public void garbageIdent()
Formula
garbageIdent
in class Formula
public void getFields(java.util.Set fields)
Formula
getFields
in class Formula
fields
- The set a collected fields.public Formula getF1()
public Formula getLeft()
public Formula getRight()
public BasicType getBasicType()
Formula
getBasicType
in class Formula
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |