Package org.onlab.util
Class ClosedOpenRange
- java.lang.Object
-
- org.onlab.util.ClosedOpenRange
-
@Beta public final class ClosedOpenRange extends java.lang.ObjectRepresent a closed-open range. The primary user of this class is the ResourceService implementation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()intlowerBound()Returns the lower bound.static ClosedOpenRangeof(int lowerBound, int upperBound)Create a range with a lower bound and an upper bound.static ClosedOpenRangeof(com.google.common.collect.Range<java.lang.Integer> range)Creates a range from a Guava's range.java.lang.StringtoString()intupperBound()Returns the upper bound.
-
-
-
Method Detail
-
of
public static ClosedOpenRange of(com.google.common.collect.Range<java.lang.Integer> range)
Creates a range from a Guava's range.- Parameters:
range- Guava's range- Returns:
- this range
-
of
public static ClosedOpenRange of(int lowerBound, int upperBound)
Create a range with a lower bound and an upper bound.- Parameters:
lowerBound- lower bound (inclusive)upperBound- upper bound (exclusive)- Returns:
- this range
-
lowerBound
public int lowerBound()
Returns the lower bound.- Returns:
- the lower bound
-
upperBound
public int upperBound()
Returns the upper bound.- Returns:
- the upper bound
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-