MultiArrayDeques

scalation.MultiArrayDeques
class MultiArrayDeques[A](nLanes: Int)(implicit evidence$1: ClassTag[A])

The MultiArrayDeques class provides a data structure for storing multiple ArrayDeques for the purpose of maintaining multiple parallel lanes. For example cars on a multi-lane road can be positioned in this data structure. It allows cars to added and removed and supports finding cars at a similar distance (from the start) to be found in another lane.

Value parameters

nLanes

the number of lanes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def add(l: Int, elem: A): Unit

Add an new element to the beginning of lane l.

Add an new element to the beginning of lane l.

Value parameters

elem

the element to be added

l

the l-th lane

Attributes

def apply(l: Int): ArrayDeque[A]

Return the l-th lane.

Return the l-th lane.

Value parameters

l

the l-th lane

Attributes

def apply(l: Int, i: Int): A

Return the i-th element in lane l.

Return the i-th element in lane l.

Value parameters

i

the index position in lane l

l

the l-th lane

Attributes

def insertAt(l: Int, elem: A, i: Int): Unit

Insert a new element AT index position i into lane l.

Insert a new element AT index position i into lane l.

Value parameters

elem

the element to be inserted

i

the index position in lane l

l

the l-th lane

Attributes

def remove(l: Int): A

Remove the element from the end of lane l.

Remove the element from the end of lane l.

Value parameters

l

the l-th lane

Attributes

def removeAt(l: Int, i: Int): A

Remove the element AT index position i from lane l.

Remove the element AT index position i from lane l.

Value parameters

i

the index position in lane l

l

the l-th lane

Attributes