|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.query.SelectedInterval
public class SelectedInterval
An interval selected for display.
MG4J uses intervals returned by a DocumentIterator
to produce snippet of text that help the user to understand why a document satisfies a query.
This class wraps an Interval
, adding some information that
is useful for displaying the interval itself (e.g., whether the interval is an actual
interval satisfying the query or was generated by an IntervalSelector
).
Whereas the query-solving process uses exclusively Interval
(which
is on purpose a small, final and very lightweight class), the snippeting process
uses exclusively instances of this class.
Nested Class Summary | |
---|---|
static class |
SelectedInterval.IntervalType
The type of a selected interval, as set by an IntervalSelector . |
Field Summary | |
---|---|
static SelectedInterval[] |
EMPTY_ARRAY
|
static SelectedInterval[] |
FALSE_ARRAY
A marker array used to represent the (absence of) intervals associated with IntervalIterators.FALSE . |
Interval |
interval
The underlying interval. |
static SelectedInterval[] |
TRUE_ARRAY
A marker array used to represent the (absence of) intervals associated with IntervalIterators.TRUE . |
SelectedInterval.IntervalType |
type
The interval type, or null for an untyped interval. |
Constructor Summary | |
---|---|
SelectedInterval(Interval interval,
SelectedInterval.IntervalType type)
Creates a new selected interval by wrapping a given interval. |
Method Summary | |
---|---|
int |
compareTo(SelectedInterval i)
Compares two selected intervals by their left extremes. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SelectedInterval[] EMPTY_ARRAY
public static final SelectedInterval[] TRUE_ARRAY
IntervalIterators.TRUE
.
public static final SelectedInterval[] FALSE_ARRAY
IntervalIterators.FALSE
.
public final Interval interval
public final SelectedInterval.IntervalType type
null
for an untyped interval.
Constructor Detail |
---|
public SelectedInterval(Interval interval, SelectedInterval.IntervalType type)
interval
- the underlying interval.type
- the interval type, or null
for a pure wrapper.Method Detail |
---|
public int compareTo(SelectedInterval i)
compareTo
in interface Comparable<SelectedInterval>
i
- a selected interval.
i
.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |