public final class DoubleInterval extends Object implements Set
double, but applicable to any primitive or Object
number.
Minor note: specifying integer intervals as half-open is a near universal convention, at least in the Java libraries. It's less common and a bit tricky for floating point intervals. I make them both half-open for consistency.
TODO: how to implement [x,infinity]? TODO: empty interval different from general empty set? has a location so it can be transformed by functions R->R? TODO: any sense in [z1,z0) where z1 > z0 ?
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(boolean x)
Is
x an element of this set? |
boolean |
contains(Boolean x)
Is
x an element of this set? |
boolean |
contains(byte x)
Is
x an element of this set? |
boolean |
contains(Byte x)
Is
x an element of this set? |
boolean |
contains(char x)
Is
x an element of this set? |
boolean |
contains(Character x)
Is
x an element of this set? |
boolean |
contains(double x)
Is
x an element of this set? |
boolean |
contains(Double x)
Is
x an element of this set? |
boolean |
contains(float x)
Is
x an element of this set? |
boolean |
contains(Float x)
Is
x an element of this set? |
boolean |
contains(int x)
Is
x an element of this set? |
boolean |
contains(Integer x)
Is
x an element of this set? |
boolean |
contains(long x)
Is
x an element of this set? |
boolean |
contains(Long x)
Is
x an element of this set? |
boolean |
contains(Object x)
Is
x an element of this set? |
boolean |
contains(short x)
Is
x an element of this set? |
boolean |
contains(Short x)
Is
x an element of this set? |
double |
diameter() |
static DoubleInterval |
generate(clojure.lang.IFn.D g)
g is a 'function' of no arguments, which is
expected to return a different value on each call, typically
wrapping some pseudo-random number generator. |
boolean |
intersects(ByteInterval that) |
boolean |
intersects(DoubleInterval that) |
boolean |
intersects(FloatInterval that) |
boolean |
intersects(IntegerInterval that) |
boolean |
intersects(LongInterval that) |
boolean |
intersects(Object set)
Does
this share any elements with
set? |
boolean |
intersects(Set that) |
boolean |
intersects(ShortInterval that) |
static DoubleInterval |
make(double z0,
double z1) |
public final boolean contains(boolean x)
Setx an element of this set?public final boolean contains(byte x)
Setx an element of this set?public final boolean contains(char x)
Setx an element of this set?public final boolean contains(double x)
Setx an element of this set?public final boolean contains(float x)
Setx an element of this set?public final boolean contains(int x)
Setx an element of this set?public final boolean contains(long x)
Setx an element of this set?public final boolean contains(short x)
Setx an element of this set?public final boolean contains(Boolean x)
Setx an element of this set?public final boolean contains(Byte x)
Setx an element of this set?public final boolean contains(Character x)
Setx an element of this set?public final boolean contains(Double x)
Setx an element of this set?public final boolean contains(Float x)
Setx an element of this set?public final boolean contains(Integer x)
Setx an element of this set?public final boolean contains(Long x)
Setx an element of this set?public final boolean contains(Short x)
Setx an element of this set?public final boolean contains(Object x)
Setx an element of this set?public final boolean intersects(ByteInterval that)
public final boolean intersects(DoubleInterval that)
public final boolean intersects(FloatInterval that)
public final boolean intersects(IntegerInterval that)
public final boolean intersects(LongInterval that)
public final boolean intersects(ShortInterval that)
public final boolean intersects(Set that)
public final boolean intersects(Object set)
Setthis share any elements with
set?intersects in interface Setpublic static final DoubleInterval make(double z0, double z1)
public static final DoubleInterval generate(clojure.lang.IFn.D g)
g is a 'function' of no arguments, which is
expected to return a different value on each call, typically
wrapping some pseudo-random number generator.
Clojure unfortunately only supports functions returning
primitive long and double
values.an - exception if the generated value is not within
the valid range.Copyright © 2017. All rights reserved.