Method RestoreState
RestoreState(AttributeSource.State)
Restores this state by copying the values of all attribute implementations that this state contains into the attributes implementations of the targetStream. The targetStream must contain a corresponding instance for each argument contained in this state (e.g. it is not possible to restore the state of an AttributeSource containing a ICharTermAttribute into a AttributeSource using a Token instance as implementation).
Note that this method does not affect attributes of the targetStream
that are not contained in this state. In other words, if for example
the targetStream contains an IOffsetAttribute, but this state doesn't, then
the value of the IOffsetAttribute remains unchanged. It might be desirable to
reset its value to the default, in which case the caller should first
call ClearAttributes() (TokenStream.ClearAttributes()
on the targetStream.
Declaration
public void RestoreState(AttributeSource.State state)
Parameters
Type | Name | Description |
---|---|---|
AttributeSource.State | state |