edu.umd.cfar.lamp.viper.util
Class SimpleInterval

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.util.AbstractInterval
      extended byedu.umd.cfar.lamp.viper.util.SimpleInterval
All Implemented Interfaces:
Interval

public class SimpleInterval
extends AbstractInterval
implements Interval

A simple immutable Interval of Comparable objects.

Author:
davidm

Constructor Summary
SimpleInterval(java.lang.Comparable start, java.lang.Comparable end)
          Constructs a new immutable interval
 
Method Summary
 Interval change(java.lang.Comparable start, java.lang.Comparable end)
          Since an Interval is designed to be immutable, you need this thing to change the interval.
 java.lang.Comparable getEnd()
          Gets the end of the interval, which is not an element of the interval.
 java.lang.Comparable getStart()
          Gets the start of the interval.
 
Methods inherited from class edu.umd.cfar.lamp.viper.util.AbstractInterval
contains, contains, contains, contains, equals, hashCode, intersects, intersects, isEmpty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.umd.cfar.lamp.viper.util.Interval
contains, contains, contains, intersects, intersects, isEmpty
 

Constructor Detail

SimpleInterval

public SimpleInterval(java.lang.Comparable start,
                      java.lang.Comparable end)
Constructs a new immutable interval

Parameters:
start - the first element of the interval
end - the first element after the end of the interval
Method Detail

getStart

public java.lang.Comparable getStart()
Description copied from interface: Interval
Gets the start of the interval.

Specified by:
getStart in interface Interval
Returns:
first element in the interval
See Also:
Interval.getStart()

getEnd

public java.lang.Comparable getEnd()
Description copied from interface: Interval
Gets the end of the interval, which is not an element of the interval.

Specified by:
getEnd in interface Interval
Returns:
the first element after the interval
See Also:
Interval.getEnd()

change

public Interval change(java.lang.Comparable start,
                       java.lang.Comparable end)
Description copied from interface: Interval
Since an Interval is designed to be immutable, you need this thing to change the interval.

Specified by:
change in interface Interval
Overrides:
change in class AbstractInterval
Parameters:
start - the start (inclusive)
end - the end (exclusive)
Returns:
the new interval
See Also:
Interval.change(java.lang.Comparable, java.lang.Comparable)