|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspark.data.SArray
public class SArray
This is a concrete implementation of SA that implements arrays with arbitrary content and of dynamic length.
Constructor Summary | |
---|---|
SArray()
|
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)
|
SParented |
myParent()
Returns the parent of this object, if this object is part of a tree. |
void |
newParent(SParented newParent)
changes the parent of this object. |
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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SArray()
Method Detail |
---|
public int size()
SA
size
in interface SA
public SV get(int index)
SA
get
in interface SA
index
- the index of the value to be retrieved.
public void set(int index, SV val)
SA
set
in interface SA
index
- the index where the value is to be savedval
- the value to be savedpublic void add(SV val)
SA
add
in interface SA
val
- the new valuepublic void insert(int index, SV val)
SA
insert
in interface SA
index
- the location where the new value is to be inserted.val
- the new valuepublic void insert(int index, SA vals)
SA
insert
in interface SA
index
- the location in the array where thevals
- the new values to be insertedpublic void delete(int index)
SA
delete
in interface SA
index
- the location of the value to be removed.public void delete(int first, int last)
SA
delete
in interface SA
first
- the index of the first value to be removed.last
- the index of the last value to be removed.public SA extract(int first, int last)
SA
extract
in interface SA
first
- the index of the first value to be removed.last
- the index of the last value to be removed.
public SParented myParent()
SParented
myParent
in interface SParented
public void newParent(SParented newParent)
SParented
newParent
in interface SParented
newParent
- the new parent object.public void set(int index, long val)
set
in interface SA
public void set(int index, double val)
set
in interface SA
public void set(int index, boolean val)
set
in interface SA
public void set(int index, java.lang.String val)
set
in interface SA
public void set(int index, SA val)
set
in interface SA
public void set(int index, SO val)
set
in interface SA
public void add(long val)
add
in interface SA
public void add(double val)
add
in interface SA
public void add(boolean val)
add
in interface SA
public void add(java.lang.String val)
add
in interface SA
public void add(SA val)
add
in interface SA
public void add(SO val)
add
in interface SA
public void insert(int index, long val)
insert
in interface SA
public void insert(int index, double val)
insert
in interface SA
public void insert(int index, boolean val)
insert
in interface SA
public void insert(int index, java.lang.String val)
insert
in interface SA
public void insert(int index, SO val)
insert
in interface SA
public long getLong(int index)
getLong
in interface SA
public double getDouble(int index)
getDouble
in interface SA
public boolean isTrue(int index)
isTrue
in interface SA
public java.lang.String getString(int index)
getString
in interface SA
public SA getSA(int index)
getSA
in interface SA
public SO getSO(int index)
getSO
in interface SA
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |