Package org.harctoolbox.irp
Class PrimaryItem
java.lang.Object
org.harctoolbox.irp.IrpObject
org.harctoolbox.irp.PrimaryItem
- All Implemented Interfaces:
Serializable
,EquationSolving
,Numerical
,XmlExport
- Direct Known Subclasses:
Expression
,Name
,Number
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
constant
(NameEngine nameEngine) invert
(BitwiseParameter rhs, RecognizeData nameEngine) Default implementation, for non-invertible expressions.Default implementation.static PrimaryItem
newPrimaryItem
(long n) static PrimaryItem
newPrimaryItem
(String name) static PrimaryItem
propertiesMap
(boolean eval, GeneralSpec generalSpec, NameEngine nameEngine) Generate a map of the properties in the very object.abstract PrimaryItem
substituteConstantVariables
(Map<String, Long> constantVariables) Returns a PrimaryItem of the same type with all occurrences of the variables in the dictionary replaced by their values in the dictionary.abstract String
toIrpString
(int radix) Returns a computed IRP (-segment) string representation of current IrpObject.Methods inherited from class org.harctoolbox.irp.IrpObject
createParameterSpecs, equals, getParseTree, hashCode, numberOfBits, numberOfBitSpecs, numberOfInfiniteRepeats, prerender, propertiesMap, toDocument, toElement, toIrpString, toString, toString, toStringTree, toStringTree, toTreeViewer, toTreeViewer, toTreeViewer, updateStateWhenEntering, updateStateWhenExiting, weight
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.harctoolbox.irp.Numerical
toBitwiseParameter, toLong, toLong
-
Constructor Details
-
PrimaryItem
protected PrimaryItem(org.antlr.v4.runtime.tree.ParseTree ctx)
-
-
Method Details
-
newPrimaryItem
-
newPrimaryItem
-
newPrimaryItem
- Throws:
InvalidNameException
-
toIrpString
Description copied from class:IrpObject
Returns a computed IRP (-segment) string representation of current IrpObject. Numerical parameters, but not durations etc, will be printed using the radix in the argument.- Specified by:
toIrpString
in classIrpObject
- Parameters:
radix
- Radix for parameters.- Returns:
- Formatted string.
-
propertiesMap
public abstract Map<String,Object> propertiesMap(boolean eval, GeneralSpec generalSpec, NameEngine nameEngine) Generate a map of the properties in the very object.- Parameters:
eval
- If true, evaluate names.generalSpec
-nameEngine
-- Returns:
-
invert
public BitwiseParameter invert(BitwiseParameter rhs, RecognizeData nameEngine) throws NameUnassignedException Default implementation, for non-invertible expressions.- Specified by:
invert
in interfaceEquationSolving
- Parameters:
rhs
-nameEngine
-- Returns:
- null
- Throws:
NameUnassignedException
-
leftHandSide
Default implementation.- Specified by:
leftHandSide
in interfaceEquationSolving
- Returns:
- this
-
substituteConstantVariables
Returns a PrimaryItem of the same type with all occurrences of the variables in the dictionary replaced by their values in the dictionary. Does not change the containing object. May return the object itself, or share sub-objects with it.- Parameters:
constantVariables
- Map<String, Long> of variables to replace.- Returns:
- PrimaryItem of the same type.
-
constant
-