calhoun.analysis.crf.io
Class InputSequenceCharacter

java.lang.Object
  extended by calhoun.analysis.crf.io.InputSequenceCharacter
All Implemented Interfaces:
InputSequence<java.lang.Character>

public class InputSequenceCharacter
extends java.lang.Object
implements InputSequence<java.lang.Character>

an input sequence where the elements of the sequence are string characters.


Constructor Summary
InputSequenceCharacter()
          default constructor
InputSequenceCharacter(java.lang.String a)
          creates an input sequence using data from this string
 
Method Summary
 InputSequence<?> getComponent(java.lang.String name)
          For input sequences that are a composite of several different input objects, returns a particular component of the input.
 java.lang.String getString()
          returns the input sequence as a string
 java.lang.Character getX(int ix)
          retrieves the input value at a position in the input sequence.
 int length()
          Returns the length of this sequence
 java.util.Collection<java.lang.String> listComponents()
          For input sequences that are a composite of several different input objects, returns a list of the names of the components in this input sequence.
 InputSequence<java.lang.Character> subSequence(int start, int end)
          tTakes a subinterval of the input sequence with given start-end coordinates which are relative coordinates, 1-based, and inclusive.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputSequenceCharacter

public InputSequenceCharacter()
default constructor


InputSequenceCharacter

public InputSequenceCharacter(java.lang.String a)
creates an input sequence using data from this string

Parameters:
a - string containing characters of the input sequence
Method Detail

getString

public java.lang.String getString()
returns the input sequence as a string

Returns:
a string of the characters

getX

public java.lang.Character getX(int ix)
Description copied from interface: InputSequence
retrieves the input value at a position in the input sequence.

Specified by:
getX in interface InputSequence<java.lang.Character>
Parameters:
ix - the index position at which to get the input. This is a zero-based index.
Returns:
the object at this position in the input.

length

public int length()
Description copied from interface: InputSequence
Returns the length of this sequence

Specified by:
length in interface InputSequence<java.lang.Character>
Returns:
length

getComponent

public InputSequence<?> getComponent(java.lang.String name)
Description copied from interface: InputSequence
For input sequences that are a composite of several different input objects, returns a particular component of the input. For simple input sequences that just return an object, this method should throw UnsupportedOperationException.

Specified by:
getComponent in interface InputSequence<java.lang.Character>
Parameters:
name - the name of the input component to return
Returns:
the input sequence representing this component

listComponents

public java.util.Collection<java.lang.String> listComponents()
Description copied from interface: InputSequence
For input sequences that are a composite of several different input objects, returns a list of the names of the components in this input sequence. For simple input sequences that just return an object, this method should throw UnsupportedOperationException.

Specified by:
listComponents in interface InputSequence<java.lang.Character>
Returns:
a collection containing the component names

subSequence

public InputSequence<java.lang.Character> subSequence(int start,
                                                      int end)
Description copied from interface: InputSequence
tTakes a subinterval of the input sequence with given start-end coordinates which are relative coordinates, 1-based, and inclusive. Thus 1-10 will mean returning a new InputSequence which is the first 10 positions of the current one.

An implementation that does not support subsetting should throw an UnsupportedOperationException

Specified by:
subSequence in interface InputSequence<java.lang.Character>
Parameters:
start - the 1-based index of the first position of the input to retrieve.
end - the 1-based index of the last position of the input to retrieve.
Returns:
an input sequence which is a sbusequence of the original sequence.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object