|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectfleXplorer.Types.Interval<Type>
public class Interval<Type extends java.lang.Comparable<Type>>
Constructor Summary | |
---|---|
Interval(Type lower,
boolean isLowerClosed,
Type upper,
boolean isUpperClosed)
Constructs an Interval with specified limits and defines if those limits are closed or open. |
Method Summary | |
---|---|
Interval<Type> |
closed(Type lower,
Type upper)
Returns an Interval with specified limits which are closed. |
PartialComparison |
compareTo(Interval<Type> obj)
Compares this object with the specified object for order. |
java.util.List<Interval<Type>> |
complementRelativeTo(Interval<Type> other)
Returns an Interval that includes the left and right complement of this Interval relative to an other. |
boolean |
covers(Interval<Type> other)
Checks if an Interval covers an other Interval. |
Interval<Type> |
emptyOfSameType()
Returns an empty Interval. |
boolean |
equals(Interval<Type> other)
Indicates whether some other Interval is "equal to" this one. |
Interval<Type> |
gap(Interval<Type> other)
Returns an Interval that is the gap of two Intervals. |
int |
hashCode()
Returns a hash code value for the Interval. |
boolean |
hasLowerLimit()
Checks if Interval has lower limit. |
boolean |
hasUpperLimit()
Checks if Interval has upper limit. |
boolean |
includes(Type value)
Checks if an Interval includes a value. |
boolean |
includesLowerLimit()
Checks if lower limit of Interval is closed or open. |
boolean |
includesUpperLimit()
Checks if upper limit is closed or open. |
Interval<Type> |
intersect(Interval<Type> other)
Returns the intersect of two Intervals. |
boolean |
intersects(Interval<Type> other)
Checks if two Intervals intersected. |
boolean |
isAbove(Type value)
Checks if value is greater than the upper limit of Interval. |
boolean |
isBelow(Type value)
Checks if value is less than the lower limit of Interval. |
boolean |
isClosed()
Checks if lower and upper limit of Interval are closed. |
boolean |
isEmpty()
Checks if Interval is empty. |
boolean |
isOpen()
Checks if lower and upper limit of Interval are open. |
boolean |
isSingleElement()
Checks if Interval has only a single element. |
Type |
lowerLimit()
Returns the value of lower limit of Interval. |
Interval<Type> |
newOfSameType(Type lower,
boolean isLowerClosed,
Type upper,
boolean isUpperClosed)
Returns a new Interval with specified limits and defines if those limits are closed or open. |
Interval<Type> |
open(Type lower,
Type upper)
Returns an Interval with specified limits which are open. |
Interval<Type> |
over(Type lower,
boolean lowerIncluded,
Type upper,
boolean upperIncluded)
Returns an Interval with specified limits and defines if those limits are closed or open. |
java.lang.String |
toString()
Returns a String representation of Interval. |
Type |
upperLimit()
Returns the value of upper limit of Interval. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Interval(Type lower, boolean isLowerClosed, Type upper, boolean isUpperClosed)
lower
- the lower limit of Interval.isLowerClosed
- defines if lower limit of Interval will be closed or open. True to closed; false otherwise.upper
- the upper limit of Interval.isUpperClosed
- defines if upper limit of Interval will be closed or open. True to closed; false otherwise.Method Detail |
---|
public Interval<Type> closed(Type lower, Type upper)
lower
- the lower limit of Interval.upper
- the upper limit of Interval.
public Interval<Type> open(Type lower, Type upper)
lower
- the lower limit of Interval.upper
- the upper limit of Interval.
public Interval<Type> over(Type lower, boolean lowerIncluded, Type upper, boolean upperIncluded)
lower
- the lower limit of Interval.isLowerClosed
- defines if lower limit of Interval will be closed or open. True to closed; false otherwise.upper
- the upper limit of Interval.isUpperClosed
- defines if upper limit of Interval will be closed or open. True to closed; false otherwise.
public Type upperLimit()
public boolean includesUpperLimit()
public boolean hasUpperLimit()
public Type lowerLimit()
public boolean includesLowerLimit()
public boolean hasLowerLimit()
public Interval<Type> newOfSameType(Type lower, boolean isLowerClosed, Type upper, boolean isUpperClosed)
lower
- the lower limit of Interval.isLowerClosed
- defines if lower limit of Interval will be closed or open. True to closed; false otherwise.upper
- the upper limit of Interval.isUpperClosed
- defines if upper limit of Interval will be closed or open. True to closed; false otherwise.
public Interval<Type> emptyOfSameType()
public boolean includes(Type value)
value
- the value to be checked if included in Interval.
public boolean covers(Interval<Type> other)
other
- Interval to be checked if it is covered by the other.
public boolean isOpen()
public boolean isClosed()
public boolean isEmpty()
public boolean isSingleElement()
public boolean isBelow(Type value)
value
- value to be checked.
public boolean isAbove(Type value)
value
- value to be checked.
public PartialComparison compareTo(Interval<Type> obj)
compareTo
in interface PartialComparable<Type extends java.lang.Comparable<Type>>
arg
- Interval to be compared.
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(Interval<Type> other)
other
- the reference Interval with which to compare.
public int hashCode()
hashCode
in class java.lang.Object
public boolean intersects(Interval<Type> other)
other
- the reference Interval with which to compared.
public Interval<Type> intersect(Interval<Type> other)
other
- the reference Interval with which to compared.
public Interval<Type> gap(Interval<Type> other)
other
- the reference Interval with which to compared.
public java.util.List<Interval<Type>> complementRelativeTo(Interval<Type> other)
other
- the reference Interval with which to compared.
http://en.wikipedia.org/wiki/Set_theoretic_complement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |