QuantityRange

case class QuantityRange[A <: Quantity[A]](lower: A, upper: A)

Represents a Range starting at one Quantity value and going up to another

Represents a Range starting at one Quantity value and going up to another

Type Params
A

the Quantity Type

Value Params
lower

Quantity representing the lower bound of the range

upper

Quantity representing the upper bound of the range

Authors

garyKeorkunian

Since

0.1

trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def *(multiple: Double): QuantitySeries[A]

times

times

def ++(): QuantityRange[A]

inc

inc

def ++(that: A): QuantityRange[A]

int

int

def +-(that: A): QuantityRange[A]

incFromDecTo

incFromDecTo

def +=(that: A): QuantityRange[A]

incFrom

incFrom

def -+(that: A): QuantityRange[A]

decFromIncTo

decFromIncTo

def --(): QuantityRange[A]

dec

dec

def --(that: A): QuantityRange[A]

dec

dec

def -=(that: A): QuantityRange[A]

decFrom

decFrom

def /(that: A): QuantitySeries[A]

divide

divide

def /(divisor: Double): QuantitySeries[A]

divide

divide

def /:[B](size: A, z: B)(op: (B, QuantityRange[A]) => B): B

foldLeft

foldLeft

def /:[B](divisor: Double, z: B)(op: (B, QuantityRange[A]) => B): B

foldLeft

foldLeft

def :\[B](size: A, z: B)(op: (QuantityRange[A], B) => B): B

foldRight

foldRight

def :\[B](divisor: Double, z: B)(op: (QuantityRange[A], B) => B): B

foldRight

foldRight

def =+(that: A): QuantityRange[A]

incTo

incTo

def =-(that: A): QuantityRange[A]

decTo

decTo

def contains(q: A): Boolean

Returns true if the quantity is contained within this range, otherwise false. This check is exclusive of the range's upper limit.

Returns true if the quantity is contained within this range, otherwise false. This check is exclusive of the range's upper limit.

Value Params
q

Quantity

def contains(that: QuantityRange[A]): Boolean

Return true if that range is completely contained with this range, otherwise false

Return true if that range is completely contained with this range, otherwise false

Value Params
that

Quantity

def dec(that: A): QuantityRange[A]

Decrements the range's from and to values by an amount equal to the value of that

Decrements the range's from and to values by an amount equal to the value of that

Value Params
that

Quantity

def decFrom(that: A): QuantityRange[A]

Decrements the from value by an amount equal to the value of that

Decrements the from value by an amount equal to the value of that

Value Params
that

Quantity

def decFromIncTo(that: A): QuantityRange[A]

Decrements the from value and increments the to by an amount equal to the value of that

Decrements the from value and increments the to by an amount equal to the value of that

Value Params
that

Quantity

def decTo(that: A): QuantityRange[A]
def divide(that: A): QuantitySeries[A]

Divides the range into a Series of ranges each with a range of size that The Seq will begin at from and go till to. If the range is not evenly divisible by that, the last item in the list will contain the remainder

Divides the range into a Series of ranges each with a range of size that The Seq will begin at from and go till to. If the range is not evenly divisible by that, the last item in the list will contain the remainder

QuantityRange(Each(1), Each(4)) / Each(1) => Vector(QuantityRange(1.0 ea,2.0 ea), QuantityRange(2.0 ea,3.0 ea), QuantityRange(3.0 ea,4.0 ea))

Value Params
that

Quantity

def divide(that: Double): QuantitySeries[A]

Divides the range into a Seq of divisor ranges The Seq will begin at from and go till to. If that is an integer value, the range will evenly divided at all points. If that has a fractional component, the first n-1 ranges will be evenly divided by the that and the last range in the list will contain the remainder.

Divides the range into a Seq of divisor ranges The Seq will begin at from and go till to. If that is an integer value, the range will evenly divided at all points. If that has a fractional component, the first n-1 ranges will be evenly divided by the that and the last range in the list will contain the remainder.

QuantityRange(Each(1), Each(4)) / 3 => Vector(QuantityRange(1.0 ea,2.0 ea), QuantityRange(2.0 ea,3.0 ea), QuantityRange(3.0 ea,4.0 ea))

Value Params
that

Double

def foldLeft[B](size: A, z: B)(op: (B, QuantityRange[A]) => B): B

Divides the range into a Seq of ranges of size each and applies a foldLeft operation

Divides the range into a Seq of ranges of size each and applies a foldLeft operation

Type Params
B

the result type of the binary operator

Value Params
op

the binary operator

size

Quantity representing the size for each QuantityRange in the Seq

z

the start value

def foldLeft[B](divisor: Double, z: B)(op: (B, QuantityRange[A]) => B): B

Divides the range into a Seq of ranges of size each and applies a foldLeft operation

Divides the range into a Seq of ranges of size each and applies a foldLeft operation

Type Params
B

the result type of the binary operator

Value Params
divisor

The number of ranges to split the range into

op

the binary operator

z

the start value

def foldRight[B](size: A, z: B)(op: (QuantityRange[A], B) => B): B

Divides the range into a Seq of ranges of size each and applies a foldRight operation

Divides the range into a Seq of ranges of size each and applies a foldRight operation

Type Params
B

the result type of the binary operator

Value Params
op

the binary operator

size

Quantity representing the size for each QuantityRange in the Seq

z

the start value

def foldRight[B](divisor: Double, z: B)(op: (QuantityRange[A], B) => B): B

Divides the range into a Seq of ranges of size each and applies a foldRight operation

Divides the range into a Seq of ranges of size each and applies a foldRight operation

Type Params
B

the result type of the binary operator

Value Params
divisor

The number of ranges to split the range into

op

the binary operator

z

the start value

def foreach[U](size: A)(op: QuantityRange[A] => U): Unit

Divides the range into a Seq of ranges of size each and applies a f to each element

Divides the range into a Seq of ranges of size each and applies a f to each element

Value Params
op

the side affecting operation

size

Quantity representing the size for each QuantityRange in the Seq

def foreach[U](divisor: Double)(op: QuantityRange[A] => U): Unit

Divides the range into a Seq of divisor ranges and applies a f to each element

Divides the range into a Seq of divisor ranges and applies a f to each element

Value Params
divisor

Quantity representing the size for each QuantityRange in the Seq

op

the side affecting operation

def inc(that: A): QuantityRange[A]

Increments the range's from and to values by an amount equal to the value of that

Increments the range's from and to values by an amount equal to the value of that

Value Params
that

Quantity

def incFrom(that: A): QuantityRange[A]

Increments the from value by an amount equal to the value of that

Increments the from value by an amount equal to the value of that

Value Params
that

Quantity

def incFromDecTo(that: A): QuantityRange[A]

Increments the from value and decrements the to by an amount equal to the value of that

Increments the from value and decrements the to by an amount equal to the value of that

Value Params
that

Quantity

def incTo(that: A): QuantityRange[A]

Increments the to value by an amount equal to the value of that

Increments the to value by an amount equal to the value of that

Value Params
that

Quantity

def includes(q: A): Boolean

Returns true if that quantity is included within this range. This check is inclusive of the range's upper limit.

Returns true if that quantity is included within this range. This check is inclusive of the range's upper limit.

Value Params
q

Quantity

def includes(that: QuantityRange[A]): Boolean

Returns true if that range is completely included in this range, otherwise false

Returns true if that range is completely included in this range, otherwise false

Value Params
that

QuantityRange[A]

def map[B](size: A)(op: QuantityRange[A] => B): Seq[B]

Divides the range into a Seq of ranges of size each and applies a map operation to each

Divides the range into a Seq of ranges of size each and applies a map operation to each

Type Params
B

the result type of the map operation

Value Params
op

the transformation operation

size

Quantity representing the size for each QuantityRange in the Seq

def map[B](divisor: Double)(op: QuantityRange[A] => B): Seq[B]

Divides the range into a Seq of divisor ranges and applies a map operation to each

Divides the range into a Seq of divisor ranges and applies a map operation to each

Type Params
B

the result type of the map operation

Value Params
divisor

Quantity representing the size for each QuantityRange in the Seq

op

the transformation operation

def partiallyContains(range: QuantityRange[A]): Boolean

Returns true if that range contains any part that is in this range, otherwise false

Returns true if that range contains any part that is in this range, otherwise false

Value Params
range

QuantityRange[A]

def partiallyIncludes(range: QuantityRange[A]): Boolean

Returns true if that range includes any part that is in this range, otherwise false

Returns true if that range includes any part that is in this range, otherwise false

Value Params
range

QuantityRange[A]

def times(multiple: Double): QuantitySeries[A]

Create a Seq of multiple ranges equal in size to the original with sequential range values If multiple contains a fractional component, the last item in the resulting range will be equal to that fraction of the original

Create a Seq of multiple ranges equal in size to the original with sequential range values If multiple contains a fractional component, the last item in the resulting range will be equal to that fraction of the original

Value Params
multiple

Number of ranges to create

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Concrete fields

lazy val dec: QuantityRange[A]

Decrements the range's from and to value by an amount equal to the Quantity value of the range

Decrements the range's from and to value by an amount equal to the Quantity value of the range

lazy val inc: QuantityRange[A]

Increments the range's from and to values by an amount equal to the Quantity value of the range

Increments the range's from and to values by an amount equal to the Quantity value of the range

lazy val toList: List[A]

Return this Range's boundary values as List[A] or the two

Return this Range's boundary values as List[A] or the two

lazy val toQuantity: A

Returns a quantity that is equal to the difference between the from and to

Returns a quantity that is equal to the difference between the from and to

lazy val toSeq: Seq[A]

Returns this Range's boundary values as a Seq[A] of the two

Returns this Range's boundary values as a Seq[A] of the two