Package coneforest.psylla.core
Class PsyArray
- java.lang.Object
-
- coneforest.psylla.core.PsyArray
-
- All Implemented Interfaces:
PsyAppendable<PsyObject>,PsyClearable,PsyContainer<PsyObject>,PsyConvertableToName,PsyConvertableToString,PsyFormalArray<PsyObject>,PsyIndexed<PsyInteger,PsyObject>,PsyIterable<PsyObject>,PsyLengthy,PsyObject,PsySequential<PsyObject>,PsyStreamable<PsyObject>,Iterable<PsyObject>
- Direct Known Subclasses:
PsyProc
public class PsyArray extends Object implements PsyFormalArray<PsyObject>
A representation of Ψ-arrayobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(int indexValue)PsyObjectextract(int indexValue)PsyObjectget(int index)voidinsert(int indexValue, PsyObject o)Inserts the specified Ψ-objectinto this array at the position specified by a given index.Iterator<PsyObject>iterator()intlength()Returns a length of this object.voidpsyAppend(PsyObject o)Appends a given Ψ-objectto this container.PsyIntegerpsyBinarySearch(PsyObject o, PsyProc oComparator, PsyContext oContext)voidpsyClear()Clear this object.PsyArraypsyClone()Returns a clone of this object.PsyArraypsyExtractInterval(PsyInteger oStart, PsyInteger oCount)PsyArraypsyGetInterval(PsyInteger oStart, PsyInteger oCount)voidpsySetLength(PsyInteger oLength)PsyArraypsySlice(PsyIterable<PsyInteger> oIndices)Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.PsyArraypsySort(Comparator<? super PsyObject> comparator)PsyStreampsyStream()voidput(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.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyFormalArray
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.PsyIterable
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.PsyStreamable
psyForAll
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Method Detail
-
length
public int length()
Description copied from interface:PsyLengthyReturns a length of this object.- Specified by:
lengthin interfacePsyLengthy- Returns:
- a length.
-
psyClone
public PsyArray psyClone()
Description copied from interface:PsyObjectReturns a clone of this object.- Specified by:
psyClonein interfacePsyFormalArray<PsyObject>- Specified by:
psyClonein interfacePsyObject- Returns:
- a clone of this object.
-
get
public PsyObject get(int index) throws PsyRangeCheckException
- Specified by:
getin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psyGetInterval
public PsyArray psyGetInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException
- Specified by:
psyGetIntervalin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psyAppend
public void psyAppend(PsyObject o) throws PsyLimitCheckException
Description copied from interface:PsyAppendableAppends a given Ψ-objectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyObject>- Parameters:
o- a given Ψ-objectto append.- Throws:
PsyLimitCheckException
-
insert
public void insert(int indexValue, PsyObject o) throws PsyRangeCheckExceptionDescription copied from interface:PsyFormalArrayInserts the specified Ψ-objectinto this array at the position specified by a given index.- Specified by:
insertin interfacePsyFormalArray<PsyObject>- Parameters:
indexValue- a Ψ-integerindex.o- a Ψ-object.- Throws:
PsyRangeCheckException
-
put
public void put(int indexValue, PsyObject o) throws PsyRangeCheckException- Specified by:
putin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
delete
public void delete(int indexValue) throws PsyRangeCheckException- Specified by:
deletein interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
extract
public PsyObject extract(int indexValue) throws PsyRangeCheckException
- Specified by:
extractin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psyExtractInterval
public PsyArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException
- Specified by:
psyExtractIntervalin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckException
-
psySlice
public PsyArray psySlice(PsyIterable<PsyInteger> oIndices) throws PsyException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.- Specified by:
psySlicein interfacePsyFormalArray<PsyObject>- Specified by:
psySlicein 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:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable
-
psySetLength
public void psySetLength(PsyInteger oLength) throws PsyRangeCheckException, PsyLimitCheckException
- Specified by:
psySetLengthin interfacePsyFormalArray<PsyObject>- Throws:
PsyRangeCheckExceptionPsyLimitCheckException
-
psySort
public PsyArray psySort(Comparator<? super PsyObject> comparator)
-
psyBinarySearch
public PsyInteger psyBinarySearch(PsyObject o, PsyProc oComparator, PsyContext oContext)
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStreamin interfacePsyIterable<PsyObject>- Specified by:
psyStreamin interfacePsyStreamable<PsyObject>
-
-