public final class Span extends SimpleConstituent
Span
is an optimized SimpleConstituent
object.
It provides exactly the same functionality as a SimpleConstituent, but
by being final, and with its own implementation of Span equality,
it runs faster, so as to placate Dan Klein. (With JDK1.3 client, it still
doesn't run as fast as an implementation outside of the SimpleConstituent
hierarchy, but with JDK1.3 server, it does! And both versions are
several times faster with -server than -client, so that should be used.)Constructor and Description |
---|
Span()
Create an empty
Span object. |
Span(int start,
int end)
Create a
Span object with given values. |
Modifier and Type | Method and Description |
---|---|
ConstituentFactory |
constituentFactory()
Return a factory for this kind of constituent.
|
boolean |
equals(Span sp)
An overloading for efficiency for when you know that you're comparing
with a Span.
|
static ConstituentFactory |
factory()
Return a factory for this kind of constituent.
|
end, labelFactory, setEnd, setStart, start
public Span()
Span
object.public Span(int start, int end)
Span
object with given values.start
- start node of edgeend
- end node of edgepublic boolean equals(Span sp)
sp
- the span to compare againstConstituent.equals(Object)
public ConstituentFactory constituentFactory()
constituentFactory
in class SimpleConstituent
public static ConstituentFactory factory()