org.deegree.coverage.rangeset
Class Interval<T extends Comparable<T>,R extends Comparable<R>>

java.lang.Object
  extended by org.deegree.coverage.rangeset.Interval<T,R>
Type Parameters:
T - of the values in this interval
R - 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 $

Nested Class Summary
static class Interval.Closure
          The Closure of an interval
 
Constructor Summary
Interval(SingleValue<T> min, SingleValue<T> max, Interval.Closure closure, String semantic, boolean atomic, SingleValue<R> spacing)
           
 
Method Summary
static
<RS extends Comparable<RS>>
Interval<?,RS>
createFromStrings(String type, String min, String max, Interval.Closure closure, String semantic, boolean atomic, SingleValue<RS> resolution)
           
 Interval.Closure getClosure()
           
 SingleValue<T> getMax()
           
 SingleValue<T> getMin()
           
 String getSemantic()
           
 SingleValue<R> getSpacing()
           
 boolean isAtomic()
           
 boolean isInBounds(Interval<?,?> inter)
           
 boolean liesWithin(T value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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 Interval
min - 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.