org.deegree.coverage.rangeset
Class Interval<T extends Comparable<T>,R extends Comparable<R>>
java.lang.Object
org.deegree.coverage.rangeset.Interval<T,R>
- Type Parameters:
T
- of the values in this intervalR
- type of the Resolution
public class Interval<T extends Comparable<T>,R extends Comparable<R>>
- extends Object
The Interval
an intervall.
- Version:
- $Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
- Author:
- Rutger Bezema, last edited by: $Author: mschneider $
Interval
public Interval(SingleValue<T> min,
SingleValue<T> max,
Interval.Closure closure,
String semantic,
boolean atomic,
SingleValue<R> spacing)
throws IllegalArgumentException
- Parameters:
min
- max
- closure
- semantic
- atomic
- spacing
- may be null
- Throws:
IllegalArgumentException
- if the types of the min and max are not equal.
getMin
public final SingleValue<T> getMin()
- Returns:
- the min
getMax
public final SingleValue<T> getMax()
- Returns:
- the max
getClosure
public final Interval.Closure getClosure()
- Returns:
- the closure
getSemantic
public final String getSemantic()
- Returns:
- the semantic
isAtomic
public final boolean isAtomic()
- Returns:
- the atomic is true if only interval end are supported.
getSpacing
public final SingleValue<R> getSpacing()
- Returns:
- the spacing
isInBounds
public boolean isInBounds(Interval<?,?> inter)
- Parameters:
inter
- to check against
- Returns:
- true if this interval is in the bounds of the given interval.
createFromStrings
public static <RS extends Comparable<RS>> Interval<?,RS> createFromStrings(String type,
String min,
String max,
Interval.Closure closure,
String semantic,
boolean atomic,
SingleValue<RS> resolution)
- Type Parameters:
RS
- type of the resolution.- Parameters:
type
- of the Intervalmin
- will be the min value, not null
.max
- will be the max value, not null
..closure
- of the interval, if null
defaults to Interval.Closure.closed
semantic
- describing the interval, may be null
atomic
- resolution
- of the steps, may be null
.
- Returns:
- the Interval instantiated with the given min, max and optional resolution
toString
public String toString()
- Overrides:
toString
in class Object
liesWithin
public boolean liesWithin(T value)
- Parameters:
value
-
- Returns:
- true if the given value lies within the bounds of this interval.
Copyright © 2011. All Rights Reserved.