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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCheck the syntactical correctness of the name.booleanconstant(NameEngine nameEngine) booleaninthashCode()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) doubletoFloat(GeneralSpec generalSpec, NameEngine nameEngine) Produces a floating result.toIrpString(int radix) Returns a computed IRP (-segment) string representation of current IrpObject.longtoLong()static longtoLong(IrpParser.NameContext ctx, NameEngine nameEngine) longtoLong(NameEngine nameEngine) Produces a numerical result.toString()static Stringstatic booleanCheck the syntactical correctness of the name.intweight()Returns a (somewhat arbitrary) measure of the complexity of the object.Methods inherited from class org.harctoolbox.irp.PrimaryItem
newPrimaryItem, newPrimaryItem, newPrimaryItemMethods 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:PrimaryItemReturns 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:
substituteConstantVariablesin 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:IrpObjectReturns 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:
toIrpStringin interfaceFloatable- Specified by:
toIrpStringin classPrimaryItem- Parameters:
radix- Radix for parameters.- Returns:
- Formatted string.
-
toLong
Description copied from interface:NumericalProduces a numerical result.- Specified by:
toLongin interfaceNumerical- Parameters:
nameEngine- used to resolve names in expressions.- Returns:
- result, long.
- Throws:
NameUnassignedException
-
toLong
- Specified by:
toLongin interfaceNumerical- Throws:
NameUnassignedException
-
toElement
-
toFloat
public double toFloat(GeneralSpec generalSpec, NameEngine nameEngine) throws NameUnassignedException Description copied from interface:FloatableProduces a floating result.- Specified by:
toFloatin interfaceFloatable- Parameters:
generalSpec-nameEngine-- Returns:
- Floating representation of class.
- Throws:
NameUnassignedException
-
constant
- Specified by:
constantin interfaceFloatable- Specified by:
constantin classPrimaryItem
-
toString
-
weight
public int weight()Description copied from class:IrpObjectReturns 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:PrimaryItemGenerate a map of the properties in the very object.- Specified by:
propertiesMapin classPrimaryItem- Parameters:
eval- If true, evaluate names.generalSpec-nameEngine-- Returns:
-
invert
Description copied from class:PrimaryItemDefault implementation, for non-invertible expressions.- Specified by:
invertin interfaceEquationSolving- Overrides:
invertin classPrimaryItem- Parameters:
rhs-nameEngine-- Returns:
- null
-
leftHandSide
Description copied from class:PrimaryItemDefault implementation.- Specified by:
leftHandSidein interfaceEquationSolving- Overrides:
leftHandSidein classPrimaryItem- Returns:
- this
-
toBitwiseParameter
- Specified by:
toBitwiseParameterin interfaceNumerical
-