Package com.reportmill.base
Class RMRange
- java.lang.Object
-
- com.reportmill.base.RMObject
-
- com.reportmill.base.RMRange
-
- All Implemented Interfaces:
RMArchiver.Archiving
,java.lang.Cloneable
public class RMRange extends RMObject
This class represents a simple integer range (from start to end).I should probably convert this class to have _end instead of _length.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(int aLocation)
Returns whether this range contains aLocation.int
end()
Returns the end of the range.boolean
equals(java.lang.Object anObj)
Standard equals implementation.void
intersect(RMRange aRange)
Constricts this range to its start/end and given range's start/end.RMRange
intersectRange(RMRange aRange)
Returns whether given range intersects this range.int
length()
Returns the length of the range.void
set(int aStart, int anEnd)
Sets the start and end of the range.void
set2(int aStart, int aLength)
Sets the start and length of the range.void
setLength(int aLength)
Sets the length of the range.int
start()
Returns the start of the range.java.lang.String
toString()
Returns a string representation of this range.-
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
-
-
-
Constructor Detail
-
RMRange
public RMRange()
Creates and empty range (0,0).
-
RMRange
public RMRange(int aStart, int anEnd)
Creates a range with the given start and length.
-
RMRange
public RMRange(RMRange aRange)
Creates a range equal to the given range.
-
-
Method Detail
-
start
public int start()
Returns the start of the range.
-
end
public int end()
Returns the end of the range.
-
length
public int length()
Returns the length of the range.
-
set
public void set(int aStart, int anEnd)
Sets the start and end of the range.
-
set2
public void set2(int aStart, int aLength)
Sets the start and length of the range.
-
setLength
public void setLength(int aLength)
Sets the length of the range.
-
contains
public boolean contains(int aLocation)
Returns whether this range contains aLocation.
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equals
in classjava.lang.Object
-
intersectRange
public RMRange intersectRange(RMRange aRange)
Returns whether given range intersects this range.
-
intersect
public void intersect(RMRange aRange)
Constricts this range to its start/end and given range's start/end.
-
toString
public java.lang.String toString()
Returns a string representation of this range.- Overrides:
toString
in classjava.lang.Object
-
-