|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.washington.cs.knowitall.sequence.SimpleLayeredSequence
public class SimpleLayeredSequence
An immutable implementation of LayeredSequence. This class represents
a sequence with multiple layers (e.g. a sentence with words and
part-of-speech tags). In this implementation, the length of the sequence is
fixed and the values at each position in the sequence cannot be changed. New
layers can be added.
| Constructor Summary | |
|---|---|
SimpleLayeredSequence(int length)
Constructs a new layered sequence with the given length |
|
| Method Summary | |
|---|---|
void |
addLayer(String layerName,
com.google.common.collect.ImmutableList<String> layer)
Adds a new layer to the sequence |
void |
addLayer(String layerName,
List<String> layer)
Adds a new layer to the sequence. |
void |
addLayer(String layerName,
String[] layer)
Adds a new layer to the sequence |
boolean |
equals(Object obj)
|
String |
get(String layerName,
int index)
|
com.google.common.collect.ImmutableList<String> |
getLayer(String layerName)
|
String |
getLayerAsString(String layerName)
|
String |
getLayerAsString(String layerName,
int start,
int length)
|
String |
getLayerAsString(String layerName,
edu.washington.cs.knowitall.commonlib.Range r)
|
Collection<String> |
getLayerNames()
|
int |
getLength()
|
int |
getNumLayers()
|
SimpleLayeredSequence |
getSubSequence(int start,
int length)
Returns the subsequence of this layered sequence starting at the given position with the given length |
SimpleLayeredSequence |
getSubSequence(edu.washington.cs.knowitall.commonlib.Range r)
Returns the subsequence of this layered sequence starting at the given position with the given length |
com.google.common.collect.ImmutableList<String> |
getSubSequence(String layerName,
int start,
int length)
|
List<String> |
getSubSequence(String layerName,
edu.washington.cs.knowitall.commonlib.Range r)
|
int |
hashCode()
|
boolean |
hasLayer(String layerName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleLayeredSequence(int length)
length - | Method Detail |
|---|
public com.google.common.collect.ImmutableList<String> getLayer(String layerName)
layerName -
public int getNumLayers()
getNumLayers in interface LayeredSequencepublic int getLength()
getLength in interface LayeredSequence
public void addLayer(String layerName,
com.google.common.collect.ImmutableList<String> layer)
throws SequenceException
layerName - layer -
SequenceException - if a layer with layerName already exists or the given layer
has the incorrect length
public void addLayer(String layerName,
List<String> layer)
layer.
layerName - layer -
SequenceException - if a layer with layerName already exists or the given layer
has the incorrect length
public void addLayer(String layerName,
String[] layer)
throws SequenceException
layerName - layer -
SequenceException - if a layer with layerName already exists or the given layer
has the incorrect lengthpublic boolean hasLayer(String layerName)
hasLayer in interface LayeredSequencelayerName -
public String get(String layerName,
int index)
get in interface LayeredSequence
public com.google.common.collect.ImmutableList<String> getSubSequence(String layerName,
int start,
int length)
layerName - start - length -
public List<String> getSubSequence(String layerName,
edu.washington.cs.knowitall.commonlib.Range r)
layerName - r -
public SimpleLayeredSequence getSubSequence(int start,
int length)
start - length -
public SimpleLayeredSequence getSubSequence(edu.washington.cs.knowitall.commonlib.Range r)
r -
public Collection<String> getLayerNames()
getLayerNames in interface LayeredSequencepublic String getLayerAsString(String layerName)
layerName -
public String getLayerAsString(String layerName,
edu.washington.cs.knowitall.commonlib.Range r)
layerName - r -
public String getLayerAsString(String layerName,
int start,
int length)
layerName - start - length -
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||