public class MultiInterval extends Object implements Iterable<Interval>, Serializable
Constructor and Description |
---|
MultiInterval()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static MultiInterval |
abs(MultiInterval mInterval)
Calculates the absolute value
MultiInterval of a MultiInterval |
static MultiInterval |
add(MultiInterval term1,
MultiInterval term2)
Calculates the sum of two
MultiInterval s |
static MultiInterval |
avg(List<MultiInterval> terms)
Calculates the average of a
List of MultiInterval s |
MultiInterval |
clone()
Makes a copy of this
MultiInterval intance |
boolean |
contains(double value)
Check if a value is contained in this MultiInterval.
|
static MultiInterval |
cos(MultiInterval mInterval)
Calculates the cosine
MultiInterval of a MultiInterval |
static MultiInterval |
div(MultiInterval numerator,
MultiInterval denominator)
Calculates the quotient of two
MultiInterval s |
boolean |
equals(Object o)
Compares the specified MultiInterval with this MultiInterval for equality.
|
void |
exclude(Interval interval)
Exclude a specific interval from this MultiInterval.
|
static MultiInterval |
exp(MultiInterval exponent)
Calculates Eulers number e raised to a
MultiInterval |
static MultiInterval |
fact(MultiInterval mInterval)
Calculates the factorial of a
MultiInterval |
void |
include(Interval interval)
Add an interval to be included in this MultiInterval.
|
Iterator<Interval> |
iterator()
Returns an iterator over the intervals in this MultiInterval in proper sequence.
|
static MultiInterval |
ln(MultiInterval mInterval)
Calculates the natural logarithm of a
MultiInterval |
static MultiInterval |
log10(MultiInterval mInterval)
Calculates the base 10 logarithm of a
MultiInterval |
static MultiInterval |
mul(MultiInterval factor1,
MultiInterval factor2)
Calculates the product of two
MultiInterval s |
static MultiInterval |
negate(MultiInterval term)
Calculates a negation av a
MultiInterval |
static MultiInterval |
pow(MultiInterval base,
MultiInterval exponent)
Calculates the first
MultiInterval raised to the power of the second MultiInterval |
static MultiInterval |
rand()
Returns a
MultiInterval holding all possible values you get from the Math.random() method |
static MultiInterval |
sin(MultiInterval mInterval)
Calculates the sine
MultiInterval of a MultiInterval |
static MultiInterval |
sqrt(MultiInterval mInterval)
Calculates the square root of a
MultiInterval |
static MultiInterval |
sub(MultiInterval term1,
MultiInterval term2)
Calculates the difference of two
MultiInterval s |
static MultiInterval |
sum(List<MultiInterval> terms)
Calculates the sum of a
List of MultiInterval s |
static MultiInterval |
tan(MultiInterval mInterval)
Calculates the tangent
MultiInterval of a MultiInterval |
static MultiInterval |
toInt(MultiInterval mInterval)
Calculates the
MultiInterval you get if you convert all values from double to int |
String |
toString()
Returns a string representation of this MultiInterval.
|
public MultiInterval()
exclude()
,
all values except the ones excluded will be included in this interval.public void include(Interval interval)
interval
- An interval specifying values to be included in this MultiInterval.public void exclude(Interval interval)
interval
- an interval specifying which values to exclude from this MultiInterval.public boolean contains(double value)
NOTE: Infinity and NaN is never reported to be included in a MultiInterval.
value
- The value to check for.true
if the value has been specified to be included in this
MultiInterval, false
otherwise.public static MultiInterval negate(MultiInterval term)
MultiInterval
term
- is the MultiInterval
to be negatedMultiInterval
public static MultiInterval add(MultiInterval term1, MultiInterval term2)
MultiInterval
sterm1
- is the first termterm2
- is the second termMultiInterval
spublic static MultiInterval sub(MultiInterval term1, MultiInterval term2)
MultiInterval
sterm1
- is the first termterm2
- is the second termMultiInterval
spublic static MultiInterval mul(MultiInterval factor1, MultiInterval factor2)
MultiInterval
sfactor1
- is the first factorfactor2
- is the second factorMultiInterval
spublic static MultiInterval div(MultiInterval numerator, MultiInterval denominator) throws MathException
MultiInterval
snumerator
- is the numeratordenominator
- is the denominatorMultiInterval
sMathException
public static MultiInterval pow(MultiInterval base, MultiInterval exponent) throws MathException
MultiInterval
raised to the power of the second MultiInterval
base
- is the first MultiInterval
exponent
- is the second MultiInterval
MultiInterval
raised to the power of the second MultiInterval
MathException
- if the first MultiInterval
contains values below zero and the second MultiInterval
is not build of singel integer value Interval
spublic static MultiInterval cos(MultiInterval mInterval)
MultiInterval
of a MultiInterval
mInterval
- is the MultiInterval
MultiInterval
of the MultiInterval
public static MultiInterval sin(MultiInterval mInterval)
MultiInterval
of a MultiInterval
mInterval
- is the MultiInterval
MultiInterval
of the MultiInterval
public static MultiInterval tan(MultiInterval mInterval)
MultiInterval
of a MultiInterval
mInterval
- is the MultiInterval
MultiInterval
of the MultiInterval
public static MultiInterval ln(MultiInterval mInterval) throws MathException
MultiInterval
mInterval
- is the MultiInterval
MultiInterval
MathException
- if the MultiInterval
contains values below zeropublic static MultiInterval log10(MultiInterval mInterval) throws MathException
MultiInterval
mInterval
- is the MultiInterval
MultiInterval
MathException
- if the MultiInterval
contains values below zeropublic static MultiInterval exp(MultiInterval exponent)
MultiInterval
exponent
- is the MultiInterval
MultiInterval
public static MultiInterval sqrt(MultiInterval mInterval) throws MathException
MultiInterval
mInterval
- is the MultiInterval
MultiInterval
MathException
- if the MultiInterval
contains values below zeropublic static MultiInterval toInt(MultiInterval mInterval)
MultiInterval
you get if you convert all values from double
to int
mInterval
- is the MultiInterval
MultiInterval
you get if you convert the values from double
to int
public static MultiInterval abs(MultiInterval mInterval)
MultiInterval
of a MultiInterval
mInterval
- is the MultiInterval
MultiInterval
of the MultiInterval
public static MultiInterval rand()
MultiInterval
holding all possible values you get from the Math.random()
methodMultiInterval
holding all possible values you get from the Math.random()
mathodpublic static MultiInterval fact(MultiInterval mInterval) throws MathException
MultiInterval
mInterval
- is the MultiInterval
MultiInterval
MathException
- if the MultiInterval
contains values below zeropublic static MultiInterval sum(List<MultiInterval> terms)
List
of MultiInterval
sterms
- is the terms to be summarizedMultiInterval
spublic static MultiInterval avg(List<MultiInterval> terms)
List
of MultiInterval
sterms
- is the termsMultiInterval
spublic Iterator<Interval> iterator()
public boolean equals(Object o)
public MultiInterval clone()
MultiInterval
intance