edu.stanford.nlp.util
Class Interval<E extends Comparable<E>>
java.lang.Object
edu.stanford.nlp.util.Pair<E,E>
edu.stanford.nlp.util.Interval<E>
- All Implemented Interfaces:
- HasInterval<E>, Serializable, Comparable<Pair<E,E>>
public class Interval<E extends Comparable<E>>
- extends Pair<E,E>
- implements HasInterval<E>
Represents a interval
- Author:
- Angel Chang
- See Also:
- Serialized Form
Constructor Summary |
protected |
Interval(E a,
E b,
int flags)
|
Method Summary |
int |
addIntervalRelationFlags(int flags,
boolean checkFuzzy)
|
static boolean |
checkFlagExclusiveSet(int flags,
int flag,
int mask)
|
static boolean |
checkFlagSet(int flags,
int flag)
|
static boolean |
checkMultipleBitSet(int flags)
|
boolean |
contains(E p)
|
boolean |
equals(Object o)
|
Interval |
expand(Interval<E> other)
|
static int |
extractRelationSubflags(int flags,
int shift)
|
E |
getBegin()
|
E |
getEnd()
|
Interval<E> |
getInterval()
|
Interval.RelType |
getRelation(Interval<E> other)
|
int |
getRelationFlags(Interval<E> other)
|
int |
hashCode()
|
boolean |
includesBegin()
|
boolean |
includesEnd()
|
Interval |
intersect(Interval<E> other)
|
protected static
|
max(E a,
E b)
|
protected static
|
min(E a,
E b)
|
boolean |
overlaps(Interval<E> other)
|
static
|
toInterval(E a,
E b)
|
static
|
toInterval(E a,
E b,
int flags)
|
protected int |
toRelFlags(int comp,
int shift)
|
static
|
toValidInterval(E a,
E b)
|
static
|
toValidInterval(E a,
E b,
int flags)
|
Methods inherited from class edu.stanford.nlp.util.Pair |
compareTo, first, internedStringPair, makePair, readStringPair, save, second, setFirst, setSecond, stringIntern, toString |
INTERVAL_OPEN_BEGIN
public static int INTERVAL_OPEN_BEGIN
INTERVAL_OPEN_END
public static int INTERVAL_OPEN_END
REL_FLAGS_SAME
protected static final int REL_FLAGS_SAME
- See Also:
- Constant Field Values
REL_FLAGS_BEFORE
protected static final int REL_FLAGS_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_AFTER
protected static final int REL_FLAGS_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_UNKNOWN
protected static final int REL_FLAGS_UNKNOWN
- See Also:
- Constant Field Values
REL_FLAGS_SS_SHIFT
protected static final int REL_FLAGS_SS_SHIFT
- See Also:
- Constant Field Values
REL_FLAGS_SE_SHIFT
protected static final int REL_FLAGS_SE_SHIFT
- See Also:
- Constant Field Values
REL_FLAGS_ES_SHIFT
protected static final int REL_FLAGS_ES_SHIFT
- See Also:
- Constant Field Values
REL_FLAGS_EE_SHIFT
protected static final int REL_FLAGS_EE_SHIFT
- See Also:
- Constant Field Values
REL_FLAGS_SS_SAME
public static final int REL_FLAGS_SS_SAME
- See Also:
- Constant Field Values
REL_FLAGS_SS_BEFORE
public static final int REL_FLAGS_SS_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_SS_AFTER
public static final int REL_FLAGS_SS_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_SS_UNKNOWN
public static final int REL_FLAGS_SS_UNKNOWN
- See Also:
- Constant Field Values
REL_FLAGS_SE_SAME
public static final int REL_FLAGS_SE_SAME
- See Also:
- Constant Field Values
REL_FLAGS_SE_BEFORE
public static final int REL_FLAGS_SE_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_SE_AFTER
public static final int REL_FLAGS_SE_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_SE_UNKNOWN
public static final int REL_FLAGS_SE_UNKNOWN
- See Also:
- Constant Field Values
REL_FLAGS_ES_SAME
public static final int REL_FLAGS_ES_SAME
- See Also:
- Constant Field Values
REL_FLAGS_ES_BEFORE
public static final int REL_FLAGS_ES_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_ES_AFTER
public static final int REL_FLAGS_ES_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_ES_UNKNOWN
public static final int REL_FLAGS_ES_UNKNOWN
- See Also:
- Constant Field Values
REL_FLAGS_EE_SAME
public static final int REL_FLAGS_EE_SAME
- See Also:
- Constant Field Values
REL_FLAGS_EE_BEFORE
public static final int REL_FLAGS_EE_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_EE_AFTER
public static final int REL_FLAGS_EE_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_EE_UNKNOWN
public static final int REL_FLAGS_EE_UNKNOWN
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_SAME
public static final int REL_FLAGS_INTERVAL_SAME
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_BEFORE
public static final int REL_FLAGS_INTERVAL_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_AFTER
public static final int REL_FLAGS_INTERVAL_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_OVERLAP
public static final int REL_FLAGS_INTERVAL_OVERLAP
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_INSIDE
public static final int REL_FLAGS_INTERVAL_INSIDE
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_CONTAIN
public static final int REL_FLAGS_INTERVAL_CONTAIN
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_UNKNOWN
public static final int REL_FLAGS_INTERVAL_UNKNOWN
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_ALMOST_SAME
public static final int REL_FLAGS_INTERVAL_ALMOST_SAME
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_ALMOST_BEFORE
public static final int REL_FLAGS_INTERVAL_ALMOST_BEFORE
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_ALMOST_AFTER
public static final int REL_FLAGS_INTERVAL_ALMOST_AFTER
- See Also:
- Constant Field Values
REL_FLAGS_INTERVAL_FUZZY
public static final int REL_FLAGS_INTERVAL_FUZZY
- See Also:
- Constant Field Values
Interval
protected Interval(E a,
E b,
int flags)
toInterval
public static <E extends Comparable<E>> Interval<E> toInterval(E a,
E b)
toInterval
public static <E extends Comparable<E>> Interval<E> toInterval(E a,
E b,
int flags)
toValidInterval
public static <E extends Comparable<E>> Interval<E> toValidInterval(E a,
E b)
toValidInterval
public static <E extends Comparable<E>> Interval<E> toValidInterval(E a,
E b,
int flags)
getInterval
public Interval<E> getInterval()
- Specified by:
getInterval
in interface HasInterval<E extends Comparable<E>>
getBegin
public E getBegin()
getEnd
public E getEnd()
max
protected static <E extends Comparable<E>> E max(E a,
E b)
min
protected static <E extends Comparable<E>> E min(E a,
E b)
contains
public boolean contains(E p)
expand
public Interval expand(Interval<E> other)
intersect
public Interval intersect(Interval<E> other)
overlaps
public boolean overlaps(Interval<E> other)
includesBegin
public boolean includesBegin()
includesEnd
public boolean includesEnd()
toRelFlags
protected int toRelFlags(int comp,
int shift)
getRelationFlags
public int getRelationFlags(Interval<E> other)
addIntervalRelationFlags
public int addIntervalRelationFlags(int flags,
boolean checkFuzzy)
extractRelationSubflags
public static int extractRelationSubflags(int flags,
int shift)
checkMultipleBitSet
public static boolean checkMultipleBitSet(int flags)
checkFlagSet
public static boolean checkFlagSet(int flags,
int flag)
checkFlagExclusiveSet
public static boolean checkFlagExclusiveSet(int flags,
int flag,
int mask)
getRelation
public Interval.RelType getRelation(Interval<E> other)
equals
public boolean equals(Object o)
- Overrides:
equals
in class Pair<E extends Comparable<E>,E extends Comparable<E>>
hashCode
public int hashCode()
- Overrides:
hashCode
in class Pair<E extends Comparable<E>,E extends Comparable<E>>
Stanford NLP Group