Class/Object

io.scalajs.dom.html.phaser.utils

ArrayUtils

Related Docs: object ArrayUtils | package utils

Permalink

class ArrayUtils extends Object

Utility functions for dealing with Arrays.

Annotations
@RawJSType() @native()
See also

https://phaser.io/docs/2.6.2/Phaser.ArrayUtils.html

Linear Supertypes
Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ArrayUtils
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ArrayUtils()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def findClosest(value: JsNumber, arr: Array[JsNumber]): Int

    Permalink

    Snaps a value to the nearest value in an array.

    Snaps a value to the nearest value in an array.

    value

    The search value

    arr

    The input array which must be sorted.

    returns

    The nearest value found.

  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def getRandomItem[T](objects: Array[T], startIndex: Int = js.native, length: Int = js.native): T

    Permalink

    Fetch a random entry from the given array.

    Fetch a random entry from the given array. Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.

    objects

    An array of objects.

    startIndex

    Optional offset off the front of the array. Default value is 0, or the beginning of the array.

    length

    Optional restriction on the number of values you want to randomly select from.

    returns

    The random object that was selected.

  12. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def numberArray[T](start: JsNumber, end: JsNumber): Array[T]

    Permalink

    Create an array representing the inclusive range of numbers (usually integers) in [start, end].

    Create an array representing the inclusive range of numbers (usually integers) in [start, end]. This is equivalent to numberArrayStep(start, end, 1).

    start

    The minimum value the array starts with.

    end

    The maximum value the array contains.

    returns

    The array of number values.

  20. def numberArrayStep[T](start: JsNumber, end: JsNumber = js.native, step: Int = js.native): Array[T]

    Permalink

    Create an array of numbers (positive and/or negative) progressing from start up to but not including end by advancing by step.

    Create an array of numbers (positive and/or negative) progressing from start up to but not including end by advancing by step. If start is less than end a zero-length range is created unless a negative step is specified. Certain values for start and end (eg. NaN/undefined/null) are currently coerced to 0; for forward compatibility make sure to pass in actual numbers.

    start

    The start of the range.

    end

    The end of the range.

    step

    The value to increment or decrement by.

    returns

    Returns the new array of numbers.

  21. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  22. def removeRandomItem[T](objects: Array[T], startIndex: Int = js.native, length: Int = js.native): T

    Permalink

    Removes a random object from the given array and returns it.

    Removes a random object from the given array and returns it. Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.

    objects

    An array of objects.

    startIndex

    Optional offset off the front of the array. Default value is 0, or the beginning of the array.

    length

    Optional restriction on the number of values you want to randomly select from.

    returns

    The random object that was removed.

  23. def rotateLeft[T](array: Array[T]): Array[T]

    Permalink

    Moves the element from the start of the array to the end, shifting all items in the process.

    Moves the element from the start of the array to the end, shifting all items in the process. The "rotation" happens to the left.

    array

    The array to rotate. The array is modified.

    returns

    The rotated value.

  24. def rotateMatrix[T](matrix: Array[T], direction: |[JsNumber, String]): Array[T]

    Permalink

    Rotates the given matrix (array of arrays).

    Rotates the given matrix (array of arrays).

    matrix

    The array to rotate; this matrix may be altered.

    direction

    The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').

    returns

    The rotated matrix. The source matrix should be discarded for the returned matrix.

    See also

    http://jsfiddle.net/MrPolywhirl/NH42z/.

  25. def rotateRight[T](array: Array[T]): Array[T]

    Permalink

    Moves the element from the end of the array to the start, shifting all items in the process.

    Moves the element from the end of the array to the start, shifting all items in the process. The "rotation" happens to the right.

    array

    The array to rotate. The array is modified.

    returns

    The shifted value.

  26. def shuffle[T](array: Array[T]): Array[T]

    Permalink

    A standard Fisher-Yates Array shuffle implementation which modifies the array in place.

    A standard Fisher-Yates Array shuffle implementation which modifies the array in place.

    array

    The array to shuffle.

    returns

    The original array, now shuffled.

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. def transposeMatrix[T](array: Array[T]): Array[T]

    Permalink

    Transposes the elements of the given matrix (array of arrays).

    Transposes the elements of the given matrix (array of arrays).

    array

    The matrix to transpose.

    returns

    A new transposed matrix

  31. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  32. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def rotate[T](array: Array[T]): Array[T]

    Permalink

    Moves the element from the start of the array to the end, shifting all items in the process.

    Moves the element from the start of the array to the end, shifting all items in the process. The "rotation" happens to the left.

    array

    The array to rotate. The array is modified.

    returns

    The rotated value.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.2) This method is deprecated and should not be used. It may be removed in the future.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped