Package coneforest.psylla.core
Class PsyArray
- java.lang.Object
-
- coneforest.psylla.core.PsyArray
-
- All Implemented Interfaces:
PsyAppendable<PsyObject>
,PsyArraylike<PsyObject>
,PsyClearable
,PsyContainer<PsyObject>
,PsyConvertableToName
,PsyConvertableToString
,PsyIndexed<PsyInteger,PsyObject>
,PsyIterable<PsyObject>
,PsyLengthy
,PsyObject
,PsyStreamlike<PsyObject>
,Iterable<PsyObject>
- Direct Known Subclasses:
PsyProc
public class PsyArray extends Object implements PsyArraylike<PsyObject>
A representation of Ψ-array
object.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(int indexValue)
PsyObject
extract(int indexValue)
PsyObject
get(int index)
void
insert(int indexValue, PsyObject o)
Inserts the specified Ψ-object
into this array at the position specified by a given index.Iterator<PsyObject>
iterator()
int
length()
Returns a length of this object.void
psyAppend(PsyObject o)
Appends a given Ψ-object
to this container.PsyInteger
psyBinarySearch(PsyObject o, PsyProc oComparator)
void
psyClear()
Clear this object.PsyArray
psyClone()
Returns a clone of this object.PsyArray
psyExtractInterval(PsyInteger oStart, PsyInteger oCount)
PsyArray
psyGetInterval(PsyInteger oStart, PsyInteger oCount)
void
psySetLength(PsyInteger oLength)
PsyArray
psySlice(PsyIterable<PsyInteger> oIndices)
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.PsyArray
psySort(Comparator<? super PsyObject> comparator)
PsyStream
psyStream()
void
put(int indexValue, PsyObject o)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppendAll
-
Methods inherited from interface coneforest.psylla.core.PsyArraylike
psyCount, psyDelete, psyEntries, psyExtract, psyGet, psyGetAll, psyInsert, psyInsertAll, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyPutInterval, psyReplicate, psyReverse, psyValues, toSyntaxString, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyFilter, psyForAll, psyMap, psyToArray, psyUnite
-
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLength
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
Methods inherited from interface coneforest.psylla.core.PsyStreamlike
psyConcat
-
-
-
-
Method Detail
-
length
public int length()
Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Returns:
- a length.
-
psyClone
public PsyArray psyClone()
Description copied from interface:PsyObject
Returns a clone of this object.- Specified by:
psyClone
in interfacePsyArraylike<PsyObject>
- Specified by:
psyClone
in interfacePsyObject
- Returns:
- a clone of this object.
-
get
public PsyObject get(int index) throws PsyRangeCheckException
- Specified by:
get
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
-
psyGetInterval
public PsyArray psyGetInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException
- Specified by:
psyGetInterval
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
-
psyAppend
public void psyAppend(PsyObject o) throws PsyLimitCheckException
Description copied from interface:PsyAppendable
Appends a given Ψ-object
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyObject>
- Parameters:
o
- a given Ψ-object
to append.- Throws:
PsyLimitCheckException
-
insert
public void insert(int indexValue, PsyObject o) throws PsyRangeCheckException
Description copied from interface:PsyArraylike
Inserts the specified Ψ-object
into this array at the position specified by a given index.- Specified by:
insert
in interfacePsyArraylike<PsyObject>
- Parameters:
indexValue
- a Ψ-integer
index.o
- a Ψ-object
.- Throws:
PsyRangeCheckException
-
put
public void put(int indexValue, PsyObject o) throws PsyRangeCheckException
- Specified by:
put
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
-
delete
public void delete(int indexValue) throws PsyRangeCheckException
- Specified by:
delete
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
-
extract
public PsyObject extract(int indexValue) throws PsyRangeCheckException
- Specified by:
extract
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
-
psyExtractInterval
public PsyArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException
- Specified by:
psyExtractInterval
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
-
psySlice
public PsyArray psySlice(PsyIterable<PsyInteger> oIndices) throws PsyException
Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.- Specified by:
psySlice
in interfacePsyArraylike<PsyObject>
- Specified by:
psySlice
in interfacePsyIndexed<PsyInteger,PsyObject>
- Parameters:
oIndices
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException
- when key is absent or index is out of range.
-
psyClear
public void psyClear()
Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
psySetLength
public void psySetLength(PsyInteger oLength) throws PsyRangeCheckException, PsyLimitCheckException
- Specified by:
psySetLength
in interfacePsyArraylike<PsyObject>
- Throws:
PsyRangeCheckException
PsyLimitCheckException
-
psySort
public PsyArray psySort(Comparator<? super PsyObject> comparator)
-
psyBinarySearch
public PsyInteger psyBinarySearch(PsyObject o, PsyProc oComparator)
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStream
in interfacePsyIterable<PsyObject>
-
-