Package ghidra.util.datastruct
Class Range
java.lang.Object
ghidra.util.datastruct.Range
- All Implemented Interfaces:
Comparable<Range>
,Iterable<Integer>
A class for holding a minimum and maximum signed int values that define a range.
-
Field Details
-
min
public int minThe range's minimum extent. -
max
public int maxThe range's maximum extent (inclusive).
-
-
Constructor Details
-
Range
public Range(int min, int max) Creates a range whose extent is from min to max.- Parameters:
min
- the minimum extent.max
- the maximum extent (inclusive).- Throws:
IllegalArgumentException
- if max is less than min.
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Range>
-
equals
-
hashCode
public int hashCode() -
toString
-
contains
public boolean contains(int value) Returns true if the value is within the ranges extent.- Parameters:
value
- the value to check.- Returns:
- true if the value is within the ranges extent.
-
size
public long size()Returns the range's size.- Returns:
- the size
-
iterator
-