object Range extends Serializable
- Alphabetic
- By Inheritance
- Range
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atLeast[A](n: Int, l: List[A]): Boolean
Check that list contains at least a certain number of elements.
-
def
clamp[A](x: A, y: A, n: A)(implicit O: Ordering[A]): A
Truncate a value so it stays within some range.
Truncate a value so it stays within some range.
scala> clamp(5, 10, 15) 10 scala> clamp(5, 10, 0) 5
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
constant[A](x: A, y: A): Range[A]
Construct a range which is unaffected by the size parameter.
Construct a range which is unaffected by the size parameter.
A range from
0
to10
, with the origin at0
:scala> Range.constant(0, 10).bounds(x) (0,10) scala> Range.constant(0, 10).origin 0
-
def
constantFrom[A](z: A, x: A, y: A): Range[A]
Construct a range which is unaffected by the size parameter with a origin point which may differ from the bounds.
Construct a range which is unaffected by the size parameter with a origin point which may differ from the bounds.
A range from
-10
to10
, with the origin at0
:scala> Range.constantFrom(0, -10, 10).bounds(x) (-10,10) scala> Range.constantFrom(0, -10, 10).origin 0
A range from
1970
to2100
, with the origin at2000
:scala> Range.constantFrom(2000, 1970, 2100).bounds(x) (1970,2100) scala> Range.constantFrom(2000, 1970, 2100).origin 2000
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
linear[A](x: A, y: A)(implicit arg0: Integral[A], arg1: IntegralPlus[A], arg2: NumericPlus[A]): Range[A]
Construct a range which scales the second bound relative to the size parameter.
Construct a range which scales the second bound relative to the size parameter.
scala> Range.linear(0, 10).bounds(Size(1)) (0,0) scala> Range.linear(0, 10).bounds(Size(50)) (0,5) scala> Range.linear(0, 10).bounds(Size(100)) (0,10)
-
def
linearFrac[A](x: A, y: A)(implicit arg0: Fractional[A], arg1: DecimalPlus[A], arg2: NumericPlus[A]): Range[A]
Construct a range which scales the second bound relative to the size parameter.
Construct a range which scales the second bound relative to the size parameter.
This works the same as 'linear', but for fractional values.
-
def
linearFracFrom[A](z: A, x: A, y: A)(implicit I: Fractional[A], J: DecimalPlus[A], R: NumericPlus[A]): Range[A]
Construct a range which scales the bounds relative to the size parameter.
Construct a range which scales the bounds relative to the size parameter.
This works the same as linearFrom, but for fractional values.
- def linearFracFrom_[A](z: A, x: A, y: A)(implicit arg0: Fractional[A], arg1: NumericPlus[A]): Range[A]
-
def
linearFrom[A](z: A, x: A, y: A)(implicit I: Integral[A], J: IntegralPlus[A], R: NumericPlus[A]): Range[A]
Construct a range which scales the second bound relative to the size parameter.
Construct a range which scales the second bound relative to the size parameter.
scala> Range.linearFrom(0, -10, 10).bounds(Size(1)) (0,0) scala> Range.linearFrom(0, -10, 20).bounds(Size(50)) (-5,10) scala> Range.linearFrom(0, -10, 20).bounds(Size(100)) (-10,20)
- def linearFrom_[A](z: A, x: A, y: A)(implicit arg0: Integral[A], arg1: NumericPlus[A]): Range[A]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
scaleLinear[A](sz: Size, z: A, n: A)(implicit I: Integral[A], J: NumericPlus[A]): A
Scale an integral linearly with the size parameter.
-
def
scaleLinearFrac[A](sz: Size, z: A, n: A)(implicit F: Fractional[A], J: NumericPlus[A]): A
Scale a fractional number linearly with the size parameter.
-
def
singleton[A](x: A): Range[A]
Construct a range which represents a constant single value.
Construct a range which represents a constant single value.
scala> Range.singleton(5).bounds(x) (5,5) scala> Range.singleton(5).origin 5
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated