spark.data
Interface SA

All Superinterfaces:
SParented
All Known Implementing Classes:
SArray

public interface SA
extends SParented

This is the interface for Spark arrays of objects. Arrays are indexed starting at zero.

Author:
olsen

Method Summary
 void add(boolean val)
           
 void add(double val)
           
 void add(long val)
           
 void add(SA val)
           
 void add(SO val)
           
 void add(java.lang.String val)
           
 void add(SV val)
          Adds a new value to the end of the array
 void delete(int index)
          Removes a value from the array.
 void delete(int first, int last)
          Removes a sequence of values from the array.
 SA extract(int first, int last)
          Functions the same as delete except that the values to be deleted are first copied out of the array and then returned as an array.
 SV get(int index)
          The value stored at index.
 double getDouble(int index)
           
 long getLong(int index)
           
 SA getSA(int index)
           
 SO getSO(int index)
           
 java.lang.String getString(int index)
           
 void insert(int index, boolean val)
           
 void insert(int index, double val)
           
 void insert(int index, long val)
           
 void insert(int index, SA vals)
          Inserts a bunch of values into the array.
 void insert(int index, SO val)
           
 void insert(int index, java.lang.String val)
           
 void insert(int index, SV val)
          Inserts a value into the array at the specified index.
 boolean isTrue(int index)
           
 void set(int index, boolean val)
           
 void set(int index, double val)
           
 void set(int index, long val)
           
 void set(int index, SA val)
           
 void set(int index, SO val)
           
 void set(int index, java.lang.String val)
           
 void set(int index, SV val)
          Changes the value at a particular index
 int size()
          the size of the array
 
Methods inherited from interface spark.data.SParented
myParent, newParent
 

Method Detail

size

int size()
the size of the array

Returns:
the total number of values in the array

get

SV get(int index)
The value stored at index.

Parameters:
index - the index of the value to be retrieved.
Returns:
the retrieved value.
Throws:
java.lang.RuntimeException - if there is no such index

getLong

long getLong(int index)

getDouble

double getDouble(int index)

isTrue

boolean isTrue(int index)

getString

java.lang.String getString(int index)

getSA

SA getSA(int index)

getSO

SO getSO(int index)

set

void set(int index,
         SV val)
Changes the value at a particular index

Parameters:
index - the index where the value is to be saved
val - the value to be saved
Throws:
java.lang.RuntimeException - is if there is no such index or the value cannot be handled by the implementation.

set

void set(int index,
         long val)

set

void set(int index,
         double val)

set

void set(int index,
         boolean val)

set

void set(int index,
         java.lang.String val)

set

void set(int index,
         SA val)

set

void set(int index,
         SO val)

add

void add(SV val)
Adds a new value to the end of the array

Parameters:
val - the new value
Throws:
java.lang.RuntimeException - if the array cannot be extended.

add

void add(long val)

add

void add(double val)

add

void add(boolean val)

add

void add(java.lang.String val)

add

void add(SA val)

add

void add(SO val)

insert

void insert(int index,
            SV val)
Inserts a value into the array at the specified index. All values with equal or greater index are moved up one and the array is enlarged by 1.

Parameters:
index - the location where the new value is to be inserted.
val - the new value
Throws:
java.lang.RuntimeException - if the index is invalid, the new value is incompatible with the array implementation or the array cannot be extended.

insert

void insert(int index,
            long val)

insert

void insert(int index,
            double val)

insert

void insert(int index,
            boolean val)

insert

void insert(int index,
            java.lang.String val)

insert

void insert(int index,
            SO val)

insert

void insert(int index,
            SA vals)
Inserts a bunch of values into the array. The array is extended by vals.size(), all elements at index or greater are moved up by vals.size() and the new values are copied into the array starting at index.

Parameters:
index - the location in the array where the
vals - the new values to be inserted
Throws:
java.lang.RuntimeException - if the index is invalid, any of the new values are incompatible with the array implementation or the array cannot be extended.

delete

void delete(int index)
Removes a value from the array. All elements with a greater index are moved down 1. If the array size cannot be changed, a null value can be inserted at the end.

Parameters:
index - the location of the value to be removed.
Throws:
java.lang.RuntimeException - if the index is invalid

delete

void delete(int first,
            int last)
Removes a sequence of values from the array. All elements with a greater index than last are moved down. If the array size cannot be changed, null values are inserted at the end.

Parameters:
first - the index of the first value to be removed.
last - the index of the last value to be removed.
Throws:
java.lang.RuntimeException - if the index is invalid

extract

SA extract(int first,
           int last)
Functions the same as delete except that the values to be deleted are first copied out of the array and then returned as an array.

Parameters:
first - the index of the first value to be removed.
last - the index of the last value to be removed.
Returns:
an array of the values that were deleted.
Throws:
java.lang.RuntimeException - if the index is invalid