Package org.harctoolbox.irp
Class Name
java.lang.Object
org.harctoolbox.irp.IrpObject
org.harctoolbox.irp.PrimaryItem
org.harctoolbox.irp.Name
- All Implemented Interfaces:
Serializable
,EquationSolving
,Floatable
,Numerical
,XmlExport
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Check the syntactical correctness of the name.boolean
constant
(NameEngine nameEngine) boolean
int
hashCode()
invert
(BitwiseParameter rhs, RecognizeData nameEngine) Default implementation, for non-invertible expressions.Default implementation.propertiesMap
(boolean eval, GeneralSpec generalSpec, NameEngine nameEngine) Generate a map of the properties in the very object.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.toBitwiseParameter
(RecognizeData recognizeData) double
toFloat
(GeneralSpec generalSpec, NameEngine nameEngine) Produces a floating result.toIrpString
(int radix) Returns a computed IRP (-segment) string representation of current IrpObject.long
toLong()
static long
toLong
(IrpParser.NameContext ctx, NameEngine nameEngine) long
toLong
(NameEngine nameEngine) Produces a numerical result.toString()
static String
static boolean
Check the syntactical correctness of the name.int
weight()
Returns a (somewhat arbitrary) measure of the complexity of the object.Methods inherited from class org.harctoolbox.irp.PrimaryItem
newPrimaryItem, newPrimaryItem, newPrimaryItem
Methods inherited from class org.harctoolbox.irp.IrpObject
createParameterSpecs, getParseTree, numberOfBits, numberOfBitSpecs, numberOfInfiniteRepeats, prerender, propertiesMap, toDocument, toIrpString, toString, toStringTree, toStringTree, toTreeViewer, toTreeViewer, toTreeViewer, updateStateWhenEntering, updateStateWhenExiting
-
Constructor Details
-
Name
-
Name
- Throws:
InvalidNameException
-
-
Method Details
-
validName
Check the syntactical correctness of the name. This invokes a newly constructed parser, i.e. is comparatively expensive.- Parameters:
name
- Name to be checked- Returns:
- true iff the name is syntactically valid.
-
toLong
public static long toLong(IrpParser.NameContext ctx, NameEngine nameEngine) throws NameUnassignedException - Throws:
NameUnassignedException
-
toString
-
checkName
Check the syntactical correctness of the name. This invokes a newly constructed parser, i.e. is comparatively expensive.- Parameters:
candidate
- Name to be checked- Throws:
InvalidNameException
-
substituteConstantVariables
Description copied from class:PrimaryItem
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.- Specified by:
substituteConstantVariables
in classPrimaryItem
- Parameters:
constantVariables
- Map<String, Long> of variables to replace.- Returns:
- PrimaryItem of the same type.
-
equals
-
hashCode
public int hashCode() -
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 interfaceFloatable
- Specified by:
toIrpString
in classPrimaryItem
- Parameters:
radix
- Radix for parameters.- Returns:
- Formatted string.
-
toLong
Description copied from interface:Numerical
Produces a numerical result.- Specified by:
toLong
in interfaceNumerical
- Parameters:
nameEngine
- used to resolve names in expressions.- Returns:
- result, long.
- Throws:
NameUnassignedException
-
toLong
- Specified by:
toLong
in interfaceNumerical
- Throws:
NameUnassignedException
-
toElement
-
toFloat
public double toFloat(GeneralSpec generalSpec, NameEngine nameEngine) throws NameUnassignedException Description copied from interface:Floatable
Produces a floating result.- Specified by:
toFloat
in interfaceFloatable
- Returns:
- Floating representation of class.
- Throws:
NameUnassignedException
-
constant
- Specified by:
constant
in interfaceFloatable
- Specified by:
constant
in classPrimaryItem
-
toString
-
weight
public int weight()Description copied from class:IrpObject
Returns a (somewhat arbitrary) measure of the complexity of the object. Can be used for determining if a decode is "simpler" than another decode. -
propertiesMap
public Map<String,Object> propertiesMap(boolean eval, GeneralSpec generalSpec, NameEngine nameEngine) Description copied from class:PrimaryItem
Generate a map of the properties in the very object.- Specified by:
propertiesMap
in classPrimaryItem
- Parameters:
eval
- If true, evaluate names.- Returns:
-
invert
Description copied from class:PrimaryItem
Default implementation, for non-invertible expressions.- Specified by:
invert
in interfaceEquationSolving
- Overrides:
invert
in classPrimaryItem
- Returns:
- null
-
leftHandSide
Description copied from class:PrimaryItem
Default implementation.- Specified by:
leftHandSide
in interfaceEquationSolving
- Overrides:
leftHandSide
in classPrimaryItem
- Returns:
- this
-
toBitwiseParameter
- Specified by:
toBitwiseParameter
in interfaceNumerical
-