CPInt2

org.cosplay.CPInt2
See theCPInt2 companion object
final class CPInt2(val i1: Int, val i2: Int) extends Ordered[CPInt2]

General 2-int tuple.

Attributes

i1

1st integer.

i2

2nd integer.

Companion:
object
Source:
CPInt2.scala
Graph
Supertypes
trait Ordered[CPInt2]
trait Comparable[CPInt2]
trait Serializable
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Constructors

def this(i: Int)

Creates tuple with two i elements.

Creates tuple with two i elements.

Attributes

i

Tuple value.

Source:
CPInt2.scala

Concrete methods

inline override def compare(that: CPInt2): Int

Attributes

Definition Classes
Ordered
Source:
CPInt2.scala

Inherited methods

inline def *(x: Int): T

Multiplies given value with each member of this tuple.

Multiplies given value with each member of this tuple.

Attributes

x

Value to multiple by.

Returns:

New tuple as a result of multiplication.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def *(x: CPIntTuple[CPInt2]): T

Multiple two tuples by multiplying their corresponding values.

Multiple two tuples by multiplying their corresponding values.

Attributes

x

Other tuple to multiply with.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def +(x: Int): T

Adds given value to each member of this tuple.

Adds given value to each member of this tuple.

Attributes

x

Value to add.

Returns:

New tuple as a result of addition.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def +(x: CPIntTuple[_]): T

Adds two tuples by adding their corresponding values.

Adds two tuples by adding their corresponding values.

Attributes

x

Tuple to add.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def -(x: Int): T

Subtracts given value from each member of this tuple.

Subtracts given value from each member of this tuple.

Attributes

x

Value to subtract.

Returns:

New tuple as a result of subtraction.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def -(x: CPIntTuple[CPInt2]): T

Subtracts given tuple from this one by subtracting their corresponding values.

Subtracts given tuple from this one by subtracting their corresponding values.

Attributes

x

Tuple to subtract.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def /(x: Int): T

Divides each member of this tuple by the given value.

Divides each member of this tuple by the given value.

Attributes

x

Value to divide by.

Returns:

New tuple as a result of division.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def /(x: CPIntTuple[CPInt2]): T

Device this tuple by the given tuple by dividing their corresponding values.

Device this tuple by the given tuple by dividing their corresponding values.

Attributes

x

Other tuple to divide by.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
def <(that: CPInt2): Boolean

Attributes

Inherited from:
Ordered
inline def <(x: Int): Boolean

Less-then '<' operator for int.

Less-then '<' operator for int.

Attributes

x

Other tuple to compare.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def <(x: CPIntTuple[_]): Boolean

Less-then '<' operator for tuples.

Less-then '<' operator for tuples.

Attributes

x

Other tuple to compare.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
def <=(that: CPInt2): Boolean

Attributes

Inherited from:
Ordered
inline def <=(x: CPIntTuple[_]): Boolean

Less-then-or-equal '<=' operator for tuples.

Less-then-or-equal '<=' operator for tuples.

Attributes

x

Other tuple to compare.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def <=(x: Int): Boolean

Less-then-or-equal '<=' operator for int.

Less-then-or-equal '<=' operator for int.

Attributes

x

Other tuple to compare.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
def >(that: CPInt2): Boolean

Attributes

Inherited from:
Ordered
inline def >(x: CPIntTuple[_]): Boolean

Greater-then '>' operator for tuples.

Greater-then '>' operator for tuples.

Attributes

x

Other tuple to compare.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def >(x: Int): Boolean

Greater-then '>' operator for int.

Greater-then '>' operator for int.

Attributes

x

Other tuple to compare.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
def >=(that: CPInt2): Boolean

Attributes

Inherited from:
Ordered
inline def >=(x: CPIntTuple[_]): Boolean

Greater-then-or-equal '>=' operator for tuples.

Greater-then-or-equal '>=' operator for tuples.

Attributes

x

Other tuple to compare.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def >=(x: Int): Boolean

Greater-then-or-equal '>=' operator for int.

Greater-then-or-equal '>=' operator for int.

Attributes

x

Other tuple to compare.

Note:

Tuples must have the same arity.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
def compareTo(that: CPInt2): Int

Attributes

Inherited from:
Ordered
inline def copy: T

Creates a copy of this tuple.

Creates a copy of this tuple.

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
override def equals(obj: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Attributes

that

the object to compare against this object for equality.

Returns:

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
CPIntTuple -> Any
Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def isOne: Boolean

Tests whether all values in this tuple are one.

Tests whether all values in this tuple are one.

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def isPositive: Boolean

Checks if this tuple contains only positive (> 0) numbers.

Checks if this tuple contains only positive (> 0) numbers.

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def isWhole: Boolean

Checks if this tuple contains only whole (>= 0) numbers.

Checks if this tuple contains only whole (>= 0) numbers.

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def isZero: Boolean

Tests whether all values in this tuple are zero.

Tests whether all values in this tuple are zero.

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
inline def mapInt(f: Int => Int): T

Maps this tuple using given function.

Maps this tuple using given function.

Attributes

f

Mapping function.

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
CPIntTuple -> Any
Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala

Concrete fields

val i1: Int

Attributes

Source:
CPInt2.scala
val i2: Int

Attributes

Source:
CPInt2.scala
val x: Int

X-coordinate accessor (returns i1 value). Allows to treat this type as XY-coordinate holder.

X-coordinate accessor (returns i1 value). Allows to treat this type as XY-coordinate holder.

Attributes

Source:
CPInt2.scala
val y: Int

Y-coordinate accessor (returns i2 value). Allows to treat this type as XY-coordinate holder.

Y-coordinate accessor (returns i2 value). Allows to treat this type as XY-coordinate holder.

Attributes

Source:
CPInt2.scala

Inherited fields

val arity: Int

Arity of this tuple.

Arity of this tuple.

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala
val ints: Int*

Attributes

Inherited from:
CPIntTuple (hidden)
Source:
CPIntTuple.scala