|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.base.Object
ist.palcom.base.ReadableArray
ist.palcom.base.Array
public class Array
Array is a system class that represents an mutable sequence of objects. The index of the first element is 0. The size of an array is fixed at creation time.
| Constructor Summary | |
|---|---|
Array()
Creates a new empty array. |
|
Array(Integer size,
Block block)
Creates an array with the specified size. |
|
Array(List list)
Creates an array containing all values in the specified list in the same order. |
|
Array(Object object,
Object anotherObject)
Creates an array with two values: object and anotherObject. |
|
| Method Summary | |
|---|---|
void |
at(set name,
Integer index,
Object value)
Replaces the value at the specified position with the specified value. |
void |
putAll(Block block)
Replaces the value at all indeces with the result of evaluating the specified block with the index as argument. |
Array |
sort()
Returns a sorted copy of this array. |
Array |
sortFrom(Integer from,
Integer to)
Returns a sorted copy of the values of this array ranging from from to (to - 1). |
| Methods inherited from class ist.palcom.base.ReadableArray |
|---|
at, length |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Array(Integer size,
Block block)
size - Integer size of new arrayblock - Block block to supply the valuespublic Array(List list)
list - List list with values to be used to create new array
public Array(Object object,
Object anotherObject)
object - Object the first value in the new arrayanotherObject - Object the second value in the new arraypublic Array()
| Method Detail |
|---|
public void putAll(Block block)
block - Block block that takes the index as argumentpublic Array sort()
public Array sortFrom(Integer from,
Integer to)
from - Integer first index in the rangeto - Integer the value 1 larger than the last index in range
public void at(set name,
Integer index,
Object value)
name - setindex - Integer index of the element to replacevalue - Object value to be stored at the specified position
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||