Scala Library
|
|
scala/Array.scala
]
final
class
Array[A](_length : Int)
extends
Vector[A] with
TraversableClass[A, Array] with
VectorTemplate[A, Array[A]]Array[T]
is Scala's representation
for Java's T[]
.Additional Constructor Summary | |
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int, dim7 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int, dim7 : Int, dim8 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int, dim7 : Int, dim8 : Int, dim9 : Int) : Array[A]
Multidimensional array creation
|
def
|
this
(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int) : Array[A]
Multidimensional array creation
|
Method Summary | |
def
|
apply
(i : Int) : A
The element at given index.
|
override def
|
companion
: Companion[Array]
The factory companion object that builds instances of class CC
|
def
|
deepEquals (that : Any) : Boolean |
def
|
deepMkString
(sep : java.lang.String) : java.lang.String
Returns a string representation of this array object. The string
representations of elements (w.r.t. the method
deepToString() )
are separated by the string sep . |
def
|
deepMkString (start : java.lang.String, sep : java.lang.String, end : java.lang.String) : java.lang.String |
def
|
deepToString : java.lang.String |
def
|
length
: Int
The length of the array
|
def
|
subArray (from : Int, end : Int) : Array[A] |
override def
|
update (i : Int, x : A) : Unit |
Methods inherited from MutableVectorTemplate | |
view, view |
Methods inherited from VectorTemplate | |
iterator, isEmpty, foreach, forall, exists, find, foldLeft, foldRight, reduceLeft, reduceRight, zip, zipWithIndex, slice, head, tail, last, init, take, drop, takeRight, dropRight, splitAt, takeWhile, dropWhile, span, sameElements, copyToArray, lengthCompare, segmentLength, indexWhere, lastIndexWhere, reverse, reverseIterator, startsWith, endsWith, equals |
Methods inherited from Unhashable | |
hashCode, identityHashCode |
Methods inherited from SequenceTemplate | |
size, isDefinedAt, zipAll, prefixLength, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, reversedElements, startsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, padTo, toSequence, indices, toString, sortWith, findLastIndexOf, slice, equalsWith, containsSlice, projection |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from IterableTemplate | |
elements, toIterable, toStream, first, firstOption, toSeq |
Methods inherited from TraversableClass | |
newBuilder, genericBuilder, unzip, flatten, transpose |
Methods inherited from TraversableTemplate | |
thisCollection, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, filterNot, remove, partition, groupBy, count, /:, :\, reduceLeftOption, reduceRightOption, headOption, lastOption, copyToBuffer, copyToArray, toArray, toList, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix |
Methods inherited from AnyRef | |
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Additional Constructor Details |
def
this(dim1 : Int, dim2 : Int) : Array[A]
def
this(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int) : Array[A]
def
this(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int) : Array[A]
def
this(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int) : Array[A]
def
this(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int, dim7 : Int) : Array[A]
def
this(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int, dim7 : Int, dim8 : Int) : Array[A]
def
this(dim1 : Int, dim2 : Int, dim3 : Int, dim4 : Int, dim5 : Int, dim6 : Int, dim7 : Int, dim8 : Int, dim9 : Int) : Array[A]
Method Details |
def
length : Int
Indices start a 0
; xs.apply(0)
is the first
element of array xs
.
Note the indexing syntax xs(i)
is a shorthand for
xs.apply(i)
.
i -
the indexArrayIndexOutOfBoundsException -
if i < 0
or length <= i
Update the element at given index.
Indices start a 0
; xs.apply(0)
is the first
element of array xs
.
Note the indexing syntax xs(i) = x
is a shorthand
for xs.update(i, x)
.
i -
the indexx -
the value to be written at index i
ArrayIndexOutOfBoundsException -
if i < 0
or length <= i
def
deepToString : java.lang.String
def
deepMkString(start : java.lang.String, sep : java.lang.String, end : java.lang.String) : java.lang.String
Returns a string representation of this array object. The resulting string
begins with the string start
and is finished by the string
end
. Inside, the string representations of elements (w.r.t.
the method deepToString()
) are separated by the string
sep
. For example:
Array(Array(1, 2), Array(3)).deepMkString("[", "; ", "]") = "[[1; 2]; [3]]"
start -
starting string.sep -
separator string.end -
ending string.
def
deepMkString(sep : java.lang.String) : java.lang.String
deepToString()
)
are separated by the string sep
.sep -
separator string.
Returns true
if the two specified arrays are
deeply equal to one another.
Two array references are considered deeply equal if both are null, or if they refer to arrays that contain the same number of elements and all corresponding pairs of elements in the two arrays are deeply equal.
See also method deepEquals
in the Java class
java.utils.Arrays
that -
the secondtrue
iff both arrays are deeply equal.
def
subArray(from : Int, end : Int) : Array[A]
Scala Library
|
|