Package org.kigalisim.lang.fragment
Class Fragment
java.lang.Object
org.kigalisim.lang.fragment.Fragment
- Direct Known Subclasses:
AboutStanzaFragment,ApplicationFragment,DuringFragment,OperationFragment,PolicyFragment,ProgramFragment,ScenarioFragment,ScenariosFragment,StringFragment,SubstanceFragment,UnitFragment
Description of a part of a parsed QubecTalk program.
Description of a part of a parsed QubecTalk program that provides a type which can be used to facilitate the ANTLR visitor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the application parsed from the source of this fragment.Get the during that should be applied in filtering if an operation should be applied.booleanCheck if this fragment is a policy stanza (or default).booleanCheck if this fragment is a scenarios stanza.Get the calculation parsed from the source of this fragment.Get the policy parsed from the source of this fragment.Get the program parsed from the source of this fragment.Get the scenario parsed from the source of this fragment.Get the scenarios parsed from the source of this fragment.Get the string parsed from the source of this fragment.Get the substance parsed from the source of this fragment.getUnit()Get the units that should be applied to the result of a calculation or to an EngineNumber.
-
Constructor Details
-
Fragment
public Fragment()Constructs a new Fragment.
-
-
Method Details
-
getString
Get the string parsed from the source of this fragment.- Returns:
- The string found on this fragment.
-
getOperation
Get the calculation parsed from the source of this fragment.- Returns:
- Operation which can be resolved to an EngineNumber at runtime.
-
getUnit
Get the units that should be applied to the result of a calculation or to an EngineNumber.- Returns:
- Parsed units as a string.
-
getDuring
Get the during that should be applied in filtering if an operation should be applied.- Returns:
- Parsed during.
-
getProgram
Get the program parsed from the source of this fragment.- Returns:
- Parsed program.
-
getPolicy
Get the policy parsed from the source of this fragment.- Returns:
- Parsed policy.
-
getScenario
Get the scenario parsed from the source of this fragment.- Returns:
- Parsed scenario.
-
getApplication
Get the application parsed from the source of this fragment.- Returns:
- Parsed application.
-
getSubstance
Get the substance parsed from the source of this fragment.- Returns:
- Parsed substance.
-
getScenarios
Get the scenarios parsed from the source of this fragment.- Returns:
- The parsed scenarios.
-
getIsStanzaScenarios
public boolean getIsStanzaScenarios()Check if this fragment is a scenarios stanza.- Returns:
- True if this fragment is a scenarios stanza, false if another stanza.
- Throws:
RuntimeException- Thrown if requested on a non-stanza.
-
getIsStanzaPolicyOrDefault
public boolean getIsStanzaPolicyOrDefault()Check if this fragment is a policy stanza (or default).- Returns:
- True if policy stanza, false if another stanza.
- Throws:
RuntimeException- Thrown if requested on a non-stanza.
-