sk.uniba.euromath.editor.textEditor
Class Interval
java.lang.Object
sk.uniba.euromath.editor.textEditor.Interval
public class Interval
- extends Object
Range of this interval is positive (not zero)
- Author:
- Tomáš Studva 7.2.2006
Martin Kollar
Constructor Summary |
Interval(int start,
int end)
Contructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Interval
public Interval(int start,
int end)
- Contructor.
- Parameters:
start
- of interval, must be non-negativeend
- of interval
getStart
public int getStart()
- Returns:
- starting point
getEnd
public int getEnd()
- Returns:
- ending point
contains
public boolean contains(int value)
- Parameters:
value
-
- Returns:
true
if value is inside of this interval
contains
public boolean contains(Interval interval)
- Parameters:
interval
- Interval to check
- Returns:
true
if interval
is inside this interval
intersects
public boolean intersects(Interval interval)
- Parameters:
interval
- Interval to check fror inersection
- Returns:
true
if their intersection is not empty or they are adjacent
ORIntervals
public static Interval ORIntervals(Interval interval1,
Interval interval2)
- Intervals have to intersect
- Parameters:
interval1
- interval2
-
- Returns:
- logical OR of this intersecting intervals
Copyright © 2003-2006 null. All Rights Reserved.