Package org.harctoolbox.irp
Class NameEngine
java.lang.Object
org.harctoolbox.irp.IrpObject
org.harctoolbox.irp.NameEngine
- All Implemented Interfaces:
Serializable,Iterable<Map.Entry<String,,Expression>> AggregateLister,XmlExport
public final class NameEngine
extends IrpObject
implements AggregateLister, Iterable<Map.Entry<String,Expression>>
Implementation of Definitions in Chapter 10 and Assignments in Chapter 11; these are not independent objects.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNameEngine(int initialCapacity) NameEngine(String str) NameEngine(Map<String, Long> numericalParameters) NameEngine(NameEngine orig) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String name) voidvoiddefine(String name, Expression expression) booleanReturns the expression associated to the name given as parameter.getNames()getPossiblyNull(String name) inthashCode()booleanisEmpty()iterator()booleannumericallyEquals(Object object) booleannumericallyEquals(Map<String, Long> other) booleannumericallyEquals(Decoder.Decode other) booleannumericallyEquals(NameEngine other) static NameEnginevoidparseDefinitions(String str) Invoke the parser on the supplied argument, and stuff the result into the name engine.voidstatic NameEngineparseLoose(String str) propertiesMap(GeneralSpec generalSpec, NameEngine nameEngine) intsize()toIrpString(int radix) Returns a computed IRP (-segment) string representation of current IrpObject.longtoMap()intweight()Returns a (somewhat arbitrary) measure of the complexity of the object.Methods inherited from class org.harctoolbox.irp.IrpObject
createParameterSpecs, getParseTree, numberOfBits, numberOfBitSpecs, numberOfInfiniteRepeats, prerender, propertiesMap, toDocument, toIrpString, toString, toString, toStringTree, toStringTree, toTreeViewer, toTreeViewer, toTreeViewer, updateStateWhenEntering, updateStateWhenExitingMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY
-
-
Constructor Details
-
NameEngine
-
NameEngine
public NameEngine() -
NameEngine
public NameEngine(int initialCapacity) -
NameEngine
- Throws:
InvalidNameException
-
NameEngine
-
-
Method Details
-
parseLoose
-
parse
-
hashCode
public int hashCode() -
equals
-
size
public int size() -
numericallyEquals
-
numericallyEquals
-
numericallyEquals
-
numericallyEquals
-
iterator
- Specified by:
iteratorin interfaceIterable<Map.Entry<String,Expression>>
-
define
- Throws:
InvalidNameException
-
define
- Throws:
InvalidNameException
-
parseDefinitions
Invoke the parser on the supplied argument, and stuff the result into the name engine.- Parameters:
str- String to be parsed, like "{C = F*4 + D + 3}".
-
parseDefinitions
-
get
Returns the expression associated to the name given as parameter.- Parameters:
name-- Returns:
- Throws:
NameUnassignedException
-
get
- Throws:
NameUnassignedException
-
getPossiblyNull
-
toLong
- Throws:
NameUnassignedException
-
containsKey
-
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 classIrpObject- Parameters:
radix- Radix for parameters.- Returns:
- Formatted string.
-
toElement
-
getNames
-
toMap
-
isEmpty
public boolean isEmpty() -
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
- Specified by:
propertiesMapin interfaceAggregateLister
-