Package org.harctoolbox.irp
Class Extent
java.lang.Object
org.harctoolbox.irp.IrpObject
org.harctoolbox.irp.Duration
org.harctoolbox.irp.Extent
- All Implemented Interfaces:
Serializable
,Floatable
,IrStreamItem
,XmlExport
This class implements Extents as per Chapter 4.
- See Also:
-
Field Summary
Fields inherited from class org.harctoolbox.irp.Duration
nameOrNumber, time_periods, time_units, unit, us
-
Constructor Summary
ConstructorDescriptionExtent
(double d) Extent
(NameOrNumber non, String unit) Extent
(ParserDriver parserDriver) -
Method Summary
Modifier and TypeMethodDescriptionallDurationsInMicros
(GeneralSpec generalSpec, NameEngine nameEngine) Delivers a set of all the contained durations in microseconds.void
decode
(RecognizeData recognizeData, List<BitSpec> bitSpecStack, boolean isLast) boolean
double
evaluate
(GeneralSpec generalSpec, NameEngine nameEngine, double elapsed) protected Extent
evaluatedDuration
(GeneralSpec generalSpec, NameEngine nameEngine) Deliver an "evaluated" Duration (variables resolved) of the same subclass.double
evaluateWithSign
(GeneralSpec generalSpec, NameEngine nameEngine, double elapsed) boolean
int
hashCode()
protected boolean
isOn()
propertiesMap
(int noProperites) substituteConstantVariables
(Map<String, Long> constantVariables) Returns an IrStreamItem of the same type with all occurrences of the variables in the dictionary replaced by their values in the dictionary.toIrpString
(int radix) Returns a computed IRP (-segment) string representation of current IrpObject.Methods inherited from class org.harctoolbox.irp.Duration
assignmentVariables, constant, endingDurationType, evaluate, evaluate, extractPass, getTimeInUnits, getUnit, guessParameterLength, interleavingOk, interleavingOk, isEmpty, isOn, microSeconds, newDuration, newDuration, newDuration, newDuration, nonConstantBitFieldLength, numberOfBareDurations, numberOfBits, numberOfDurations, propertiesMap, recognize, render, startingDuratingType, toElement, toFloat, weight
Methods inherited from class org.harctoolbox.irp.IrpObject
createParameterSpecs, getParseTree, 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 org.harctoolbox.irp.IrStreamItem
createParameterSpecs, numberOfBitSpecs, numberOfInfiniteRepeats, propertiesMap, updateStateWhenEntering, updateStateWhenExiting
Methods inherited from interface org.harctoolbox.xml.XmlExport
toDocument
-
Constructor Details
-
Extent
-
Extent
-
Extent
-
Extent
-
Extent
public Extent(double d) -
Extent
-
-
Method Details
-
substituteConstantVariables
Description copied from interface:IrStreamItem
Returns an IrStreamItem 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:
- IrStreamItem of the same type.
-
equals
-
evaluate
public double evaluate(GeneralSpec generalSpec, NameEngine nameEngine, double elapsed) throws NameUnassignedException, IrpInvalidArgumentException - Overrides:
evaluate
in classDuration
- Throws:
NameUnassignedException
IrpInvalidArgumentException
-
evaluateWithSign
public double evaluateWithSign(GeneralSpec generalSpec, NameEngine nameEngine, double elapsed) throws NameUnassignedException, IrpInvalidArgumentException - Specified by:
evaluateWithSign
in classDuration
- Throws:
NameUnassignedException
IrpInvalidArgumentException
-
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 interfaceIrStreamItem
- Overrides:
toIrpString
in classDuration
- Parameters:
radix
- Radix for parameters.- Returns:
- Formatted string.
-
decode
public void decode(RecognizeData recognizeData, List<BitSpec> bitSpecStack, boolean isLast) throws SignalRecognitionException - Specified by:
decode
in interfaceIrStreamItem
- Overrides:
decode
in classDuration
- Throws:
SignalRecognitionException
-
isOn
protected boolean isOn() -
hashCode
public int hashCode() -
hasExtent
public boolean hasExtent()- Specified by:
hasExtent
in interfaceIrStreamItem
- Overrides:
hasExtent
in classDuration
-
evaluatedDuration
protected Extent evaluatedDuration(GeneralSpec generalSpec, NameEngine nameEngine) throws NameUnassignedException, IrpInvalidArgumentException Description copied from class:Duration
Deliver an "evaluated" Duration (variables resolved) of the same subclass.- Specified by:
evaluatedDuration
in classDuration
- Returns:
- Throws:
NameUnassignedException
IrpInvalidArgumentException
-
allDurationsInMicros
Description copied from interface:IrStreamItem
Delivers a set of all the contained durations in microseconds. Dumb, in that it does not consider consecutive flashes or consecutive gaps. Also, durations that cannot be statically computed may be omitted, as well as duration arising from extents.- Specified by:
allDurationsInMicros
in interfaceIrStreamItem
- Overrides:
allDurationsInMicros
in classDuration
- Returns:
-
numberOfBitSpecs
Integer numberOfBitSpecs() -
propertiesMap
-