added nicer toString() for int ranges
This commit is contained in:
@@ -30,6 +30,15 @@ public final class IntRange implements Range<Integer>, IntIterable {
|
|||||||
this.count = count;
|
this.count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
if (count >= 0) {
|
||||||
|
return "" + getStart() + ".upto(" + getEnd() + ")";
|
||||||
|
} else {
|
||||||
|
return "" + getStart() + ".downto(" + getEnd() + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(Integer item) {
|
public boolean contains(Integer item) {
|
||||||
if (item == null) return false;
|
if (item == null) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user