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
-
Constructor Summary
ConstructorDescriptionNameEngine
(int initialCapacity) NameEngine
(String str) NameEngine
(Map<String, Long> numericalParameters) NameEngine
(NameEngine orig) -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String name) void
void
define
(String name, Expression expression) boolean
Returns the expression associated to the name given as parameter.getNames()
getPossiblyNull
(String name) int
hashCode()
boolean
isEmpty()
iterator()
boolean
numericallyEquals
(Object object) boolean
numericallyEquals
(Map<String, Long> other) boolean
numericallyEquals
(Decoder.Decode other) boolean
numericallyEquals
(NameEngine other) static NameEngine
void
parseDefinitions
(String str) Invoke the parser on the supplied argument, and stuff the result into the name engine.void
static NameEngine
parseLoose
(String str) propertiesMap
(GeneralSpec generalSpec, NameEngine nameEngine) int
size()
toIrpString
(int radix) Returns a computed IRP (-segment) string representation of current IrpObject.long
toMap()
int
weight()
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, updateStateWhenExiting
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
iterator
in 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: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.
-
toElement
-
getNames
-
toMap
-
isEmpty
public boolean isEmpty() -
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
- Specified by:
propertiesMap
in interfaceAggregateLister
-