ShuffleOrder.UnshuffledShuffleOrder


class ShuffleOrder.UnshuffledShuffleOrder : ShuffleOrder


A ShuffleOrder implementation which does not shuffle.

Summary

Public constructors

Creates an instance with a specified length.

Public functions

ShuffleOrder!

Returns a copy of the shuffle order with all elements removed.

ShuffleOrder!
cloneAndInsert(insertionIndex: Int, insertionCount: Int)

Returns a copy of the shuffle order with newly inserted elements.

ShuffleOrder!
cloneAndRemove(indexFrom: Int, indexToExclusive: Int)

Returns a copy of the shuffle order with a range of elements removed.

Int

Returns the first index in the shuffle order, or INDEX_UNSET if the shuffle order is empty.

Int

Returns the last index in the shuffle order, or INDEX_UNSET if the shuffle order is empty.

Int
getNextIndex(index: Int)

Returns the next index in the shuffle order.

Int

Returns the previous index in the shuffle order.

Public properties

Int

Public constructors

UnshuffledShuffleOrder

UnshuffledShuffleOrder(length: Int)

Creates an instance with a specified length.

Parameters
length: Int

The length of the shuffle order.

Public functions

cloneAndClear

fun cloneAndClear(): ShuffleOrder!

Returns a copy of the shuffle order with all elements removed.

cloneAndInsert

fun cloneAndInsert(insertionIndex: Int, insertionCount: Int): ShuffleOrder!

Returns a copy of the shuffle order with newly inserted elements.

Parameters
insertionIndex: Int

The index in the unshuffled order at which elements are inserted.

insertionCount: Int

The number of elements inserted at insertionIndex.

Returns
ShuffleOrder!

A copy of this ShuffleOrder with newly inserted elements.

cloneAndRemove

fun cloneAndRemove(indexFrom: Int, indexToExclusive: Int): ShuffleOrder!

Returns a copy of the shuffle order with a range of elements removed.

Parameters
indexFrom: Int

The starting index in the unshuffled order of the range to remove.

indexToExclusive: Int

The smallest index (must be greater or equal to indexFrom) that will not be removed.

Returns
ShuffleOrder!

A copy of this ShuffleOrder without the elements in the removed range.

getFirstIndex

fun getFirstIndex(): Int

Returns the first index in the shuffle order, or INDEX_UNSET if the shuffle order is empty.

getLastIndex

fun getLastIndex(): Int

Returns the last index in the shuffle order, or INDEX_UNSET if the shuffle order is empty.

getNextIndex

fun getNextIndex(index: Int): Int

Returns the next index in the shuffle order.

Parameters
index: Int

An index.

Returns
Int

The index after index, or INDEX_UNSET if index is the last element.

getPreviousIndex

fun getPreviousIndex(index: Int): Int

Returns the previous index in the shuffle order.

Parameters
index: Int

An index.

Returns
Int

The index before index, or INDEX_UNSET if index is the first element.

Public properties

length

val lengthInt