Package eu.bandm.tools.ramus.ogma
Class Output<D,T>
java.lang.Object
eu.bandm.tools.ramus.ogma.Output<D,T>
- Type Parameters:
D- the type of source document identifiersT- the type of token types; typically an enum type
Immutable parser transition outputs. Each output is a pair of the reified
semantic effect of a parsing transition and the next input state.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the effect on semantic parsing state of this output.getNext()Returns the next input state of this output.mapEffect(Function<? super Update<SimpleMessage<D>>, ? extends Update<SimpleMessage<D>>> fun) Returns a variant of this output with the semantic effect tranformed by a given function.toString()withEffect(Update<SimpleMessage<D>> effect) Returns a variant of this output with the given semantic effect.Returns a variant of this output with the given next input state.withPostEffect(Update<SimpleMessage<D>> postEffect) Returns a variant of this output with the given semantic post-effect.withPreEffect(Update<SimpleMessage<D>> preEffect) Returns a variant of this output with the given semantic pre-effect.
-
Constructor Details
-
Output
Creates a new instance.- Parameters:
effect- the semantic effectnext- the next input state- Throws:
NullPointerException- ifeffectornextis null
-
-
Method Details
-
getEffect
Returns the effect on semantic parsing state of this output.- Returns:
- the effect on semantic parsing state of this output.
-
getNext
Returns the next input state of this output.- Returns:
- the next input state of this output.
-
withEffect
Returns a variant of this output with the given semantic effect.- Parameters:
effect- the new semantic effect- Returns:
- a variant of this output with the given semantic effect replacing the original one
- Throws:
NullPointerException- ifeffectis null
-
withPreEffect
Returns a variant of this output with the given semantic pre-effect.- Parameters:
preEffect- the semantic effect to prepend- Returns:
- a variant of this output with the given semantic effect prepended to the original one
- Throws:
NullPointerException- ifpreEffectis null
-
withPostEffect
Returns a variant of this output with the given semantic post-effect.- Parameters:
postEffect- the semantic effect to prepend- Returns:
- a variant of this output with the given semantic effect appended to the original one
- Throws:
NullPointerException- ifpostEffectis null
-
mapEffect
public Output<D,T> mapEffect(Function<? super Update<SimpleMessage<D>>, ? extends Update<SimpleMessage<D>>> fun) Returns a variant of this output with the semantic effect tranformed by a given function.- Parameters:
fun- the function to transform the semantic effect with- Returns:
- a variant of this output where
funhas been applied to the semantic effect - Throws:
NullPointerException- iffunis null
-
withNext
Returns a variant of this output with the given next input state.- Parameters:
next- the next input state- Returns:
- a variant of this output with the given next input state replacing the original one
- Throws:
NullPointerException- ifnextis null
-
toString
-