public class ArrayChar extends Array implements Iterable<String>
Array
Modifier and Type | Class and Description |
---|---|
static class |
ArrayChar.D0
Concrete implementation of Array specialized for char, rank 0.
|
static class |
ArrayChar.D1
Concrete implementation of Array specialized for char, rank 1.
|
static class |
ArrayChar.D2
Concrete implementation of Array specialized for char, rank 2.
|
static class |
ArrayChar.D3
Concrete implementation of Array specialized for char, rank 3.
|
static class |
ArrayChar.D4
Concrete implementation of Array specialized for char, rank 4.
|
static class |
ArrayChar.D5
Concrete implementation of Array specialized for char, rank 5.
|
static class |
ArrayChar.D6
Concrete implementation of Array specialized for char, rank 6.
|
static class |
ArrayChar.D7
Concrete implementation of Array specialized for char, rank 7.
|
class |
ArrayChar.StringIterator
rank must be > 0
|
Constructor and Description |
---|
ArrayChar(int[] dimensions)
Create a new Array of type char and the given shape.
|
ArrayChar(String s) |
Modifier and Type | Method and Description |
---|---|
char |
get(Index i)
get the value at the specified index.
|
boolean |
getBoolean(Index i)
not legal, throw ForbiddenConversionException
|
boolean |
getBoolean(int index) |
byte |
getByte(Index i)
Get the array element at the current element of ima, as a byte.
|
byte |
getByte(int index) |
char |
getChar(Index i)
Get the array element at the current element of ima, as a char.
|
char |
getChar(int index) |
ByteBuffer |
getDataAsByteBuffer()
Trasfer data to a ByteBuffer.
|
double |
getDouble(Index i)
Get the array element at the current element of ima, as a double.
|
double |
getDouble(int index) |
Class |
getElementType()
Return the element class type
|
float |
getFloat(Index i)
Get the array element at the current element of ima, as a float.
|
float |
getFloat(int index) |
int |
getInt(Index i)
Get the array element at the current element of ima, as a int.
|
int |
getInt(int index) |
long |
getLong(Index i)
Get the array element at the current element of ima, as a long.
|
long |
getLong(int index) |
Object |
getObject(Index i)
Get the array element at index as an Object.
|
Object |
getObject(int index) |
short |
getShort(Index i)
Get the array element at the current element of ima, as a short.
|
short |
getShort(int index) |
Object |
getStorage()
Get underlying primitive array storage.
|
String |
getString()
Create a String out of this rank one ArrayChar object.
|
String |
getString(Index ima)
Create a String out of this ArrayChar object.
|
String |
getString(int index)
Create a String out of this rank two ArrayChar object.
|
ArrayChar.StringIterator |
getStringIterator()
Treat this Variable as an array of Strings, and iterate over all the strings in the array.
|
Iterator<String> |
iterator() |
ArrayObject |
make1DStringArray()
Make this into the equivilent 1D ArrayObject of Strings.
|
static ArrayChar |
makeFromString(String s,
int max)
Create an ArrayChar from a String
|
static ArrayChar |
makeFromStringArray(ArrayObject values)
Create an ArrayChar from an ArrayObject of Strings.
|
static ArrayChar |
makeFromStringArray(ArrayObject values,
int strlen)
Create an ArrayChar from an ArrayObject of Strings.
|
void |
set(Index i,
char value)
set the value at the sepcified index.
|
void |
setBoolean(Index i,
boolean value)
not legal, throw ForbiddenConversionException
|
void |
setBoolean(int index,
boolean value) |
void |
setByte(Index i,
byte value)
Set the array element at the current element of ima.
|
void |
setByte(int index,
byte value) |
void |
setChar(Index i,
char value)
Set the array element at the current element of ima.
|
void |
setChar(int index,
char value) |
void |
setDouble(Index i,
double value)
Set the array element at the current element of ima.
|
void |
setDouble(int index,
double value) |
void |
setFloat(Index i,
float value)
Set the array element at the current element of ima.
|
void |
setFloat(int index,
float value) |
void |
setInt(Index i,
int value)
Set the array element at the current element of ima.
|
void |
setInt(int index,
int value) |
void |
setLong(Index i,
long value)
Set the array element at the current element of ima.
|
void |
setLong(int index,
long value) |
void |
setObject(Index i,
Object value)
Set the array element at index to the specified value.
|
void |
setObject(int index,
Object value) |
void |
setShort(Index i,
short value)
Set the array element at the current element of ima.
|
void |
setShort(int index,
short value) |
void |
setString(Index ima,
String val)
Set the ArrayChar values from the characters in the String.
|
void |
setString(int index,
String val)
Set the ArrayChar values from the characters in the String.
|
void |
setString(String val)
Set the ArrayChar values from the characters in the String.
|
String |
toString() |
arraycopy, copy, copyTo1DJavaArray, copyToNDJavaArray, factory, factory, factory, factory, factoryConstant, flip, get1DJavaArray, get1DJavaArray, getDataAsByteBuffer, getDataAsByteBuffer, getDataType, getIndex, getIndexIterator, getRangeIterator, getRank, getShape, getSize, getSizeBytes, hasNext, isConstant, isUnsigned, isVlen, makeArray, makeArray, makeArray, makeArrayRankPlusOne, makeFromJavaArray, makeFromJavaArray, makeObjectArray, makeVlenArray, next, nextBoolean, nextByte, nextChar, nextDouble, nextFloat, nextInt, nextLong, nextShort, permute, reduce, reduce, resetLocalIterator, reshape, reshapeNoCopy, section, section, section, sectionNoReduce, sectionNoReduce, shapeToString, slice, transpose
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ArrayChar(int[] dimensions)
dimensions
- the shape of the Array.public ArrayChar(String s)
public Object getStorage()
Array
getStorage
in class Array
public ByteBuffer getDataAsByteBuffer()
getDataAsByteBuffer
in class Array
public Class getElementType()
getElementType
in class Array
public char get(Index i)
public void set(Index i, char value)
public double getDouble(Index i)
Array
public void setDouble(Index i, double value)
Array
public float getFloat(Index i)
Array
public void setFloat(Index i, float value)
Array
public long getLong(Index i)
Array
public void setLong(Index i, long value)
Array
public int getInt(Index i)
Array
public void setInt(Index i, int value)
Array
public short getShort(Index i)
Array
public void setShort(Index i, short value)
Array
public byte getByte(Index i)
Array
public void setByte(Index i, byte value)
Array
public char getChar(Index i)
Array
public void setChar(Index i, char value)
Array
public boolean getBoolean(Index i)
getBoolean
in class Array
i
- Index with current element setindex
cast to boolean if necessary.public void setBoolean(Index i, boolean value)
setBoolean
in class Array
i
- Index with current element setvalue
- the new value; cast to underlying data type if necessary.public Object getObject(Index i)
Array
public void setObject(Index i, Object value)
Array
public String getString()
IllegalArgumentException
- if rank != 1public String getString(int index)
index
- index into 1D String array, must be < getShape(0).IllegalArgumentException
- if rank != 2public String getString(Index ima)
ArrayChar ca;
Index ima = ca.getIndex();
for (int i=0; i
ima
- the Index of where in the Array to start.IllegalArgumentException
- if rank != 1public void setString(String val)
val
- set characters from this StringIllegalArgumentException
- if rank != 2public void setString(int index, String val)
String[] val = new String[n];
ArrayChar ca;
Index ima = ca.getIndex();
for (int i=0; i
index
- index into 1D String array, must be < getShape(0).val
- set chars from this sStringpublic void setString(Index ima, String val)
String[][] val;
ArrayChar ca;
Index ima = ca.getIndex();
int rank0 = ca.getShape()[0];
int rank1 = ca.getShape()[1];
for (int i=0; i
ima
- the Index of where in the Array to start.val
- set to this valuepublic boolean getBoolean(int index)
getBoolean
in class Array
public void setBoolean(int index, boolean value)
setBoolean
in class Array
public ArrayChar.StringIterator getStringIterator()
public ArrayObject make1DStringArray()
public static ArrayChar makeFromString(String s, int max)
s
- Stringmax
- maximum lengthpublic static ArrayChar makeFromStringArray(ArrayObject values)
values
- ArrayObject of Stringpublic static ArrayChar makeFromStringArray(ArrayObject values, int strlen)
values
- ArrayObject of Stringstrlen
- string length dimension size