Package coneforest.psylla.core
Interface PsyFormalArray<T extends PsyObject>
-
- Type Parameters:
T- a type of contained objects.
- All Superinterfaces:
Iterable<T>,PsyAppendable<T>,PsyClearable,PsyContainer<T>,PsyConvertableToName,PsyConvertableToString,PsyIndexed<PsyInteger,T>,PsyIterable<T>,PsyLengthy,PsyObject,PsySequential<T>,PsyStreamable<T>
- All Known Implementing Classes:
PsyArray,PsyBitArray,PsyProc,PsyString
public interface PsyFormalArray<T extends PsyObject> extends PsyAppendable<T>, PsyContainer<T>, PsyIndexed<PsyInteger,T>, PsySequential<T>
A representation of Ψ-formalarray, an abstraction of an array composed of Ψ-objects.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddelete(int index)Textract(int index)Tget(int index)voidinsert(int index, T o)Inserts the specified Ψ-objectinto this array at the position specified by a given index.PsyFormalArray<T>psyClone()Returns a clone of this object.default voidpsyDelete(PsyInteger oIndex)Deletes a key or index and a value associated with it from this object.default PsyFormalStream<PsyObject>psyEntries()Returns a Ψ-iterableenumeration of all the keys and values of this object.default TpsyExtract(PsyInteger oIndex)PsyFormalArray<T>psyExtractInterval(PsyInteger oIndex, PsyInteger oCount)default TpsyGet(PsyInteger oIndex)Returns the element with given key or index.default PsyFormalArray<T>psyGetAll(PsyIterable<PsyInteger> oIndices)PsyFormalArray<T>psyGetInterval(PsyInteger oIndex, PsyInteger oLength)default voidpsyInsert(PsyInteger oIndex, T o)Inserts the specified Ψ-objectinto this array at the position specified by a given Ψ-integerindex.default voidpsyInsertAll(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration)default PsyStreampsyKeys()Returns a Ψ-iterableenumeration of all the keys of this object.default PsyBooleanpsyKnown(PsyInteger oIndex)Returns a Ψ-booleanindicating whether given key or index exists in this object.default TpsyPostChop()default TpsyPreChop()default voidpsyPrepend(T o)Inserts the specified Ψ-objectinto this array at the beginning.default voidpsyPrependAll(PsyIterable<? extends T> oEnumeration)default voidpsyPut(PsyInteger oIndex, T o)Stores an element with given key or index.default voidpsyPutInterval(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration)default PsyFormalArray<T>psyReplicate(PsyInteger oCount)default PsyFormalArray<T>psyReverse()voidpsySetLength(PsyInteger oLength)PsyFormalArray<T>psySlice(PsyIterable<PsyInteger> oIndices)Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.default PsyFormalStream<T>psyValues()Returns a Ψ-iterableenumeration of all the values of this object.voidput(int index, T o)default StringtoSyntaxString()default StringtoSyntaxStringHelper(Set<PsyContainer<T>> processed)-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppend, psyAppendAll
-
Methods inherited from interface coneforest.psylla.core.PsyClearable
psyClear
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyStream, psyToArray, psyUnite
-
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, length, 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
static final PsyOperator[] OPERATORS
-
-
Method Detail
-
psyClone
PsyFormalArray<T> psyClone()
Description copied from interface:PsyObjectReturns a clone of this object.
-
psyReverse
default PsyFormalArray<T> psyReverse() throws PsyException
- Throws:
PsyException
-
psyKnown
default PsyBoolean psyKnown(PsyInteger oIndex)
Description copied from interface:PsyIndexedReturns a Ψ-booleanindicating whether given key or index exists in this object.- Specified by:
psyKnownin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Parameters:
oIndex- a key or an index.- Returns:
- a result.
-
get
T get(int index) throws PsyException
- Throws:
PsyException
-
psyGet
default T psyGet(PsyInteger oIndex) throws PsyException
Description copied from interface:PsyIndexedReturns the element with given key or index.- Specified by:
psyGetin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Parameters:
oIndex- a key or an index.- Returns:
- an element.
- Throws:
PsyException- when index is out of range.
-
psyGetInterval
PsyFormalArray<T> psyGetInterval(PsyInteger oIndex, PsyInteger oLength) throws PsyException
- Throws:
PsyException
-
put
void put(int index, T o) throws PsyException- Throws:
PsyException
-
psyPut
default void psyPut(PsyInteger oIndex, T o) throws PsyException
Description copied from interface:PsyIndexedStores an element with given key or index. InPsyFormalArraycontainers replaces existing element. InPsyFormalDictcontainers replaces an old or creates a new element associated with specified key.- Specified by:
psyPutin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Parameters:
oIndex- a key or an index.o- an element to be stored.- Throws:
PsyException- when key is absent or index is out of range.
-
insert
void insert(int index, T o) throws PsyExceptionInserts the specified Ψ-objectinto this array at the position specified by a given index.- Parameters:
index- a Ψ-integerindex.o- a Ψ-object.- Throws:
PsyException- when an error occurs.
-
psyInsert
default void psyInsert(PsyInteger oIndex, T o) throws PsyException
Inserts the specified Ψ-objectinto this array at the position specified by a given Ψ-integerindex.- Parameters:
oIndex- a Ψ-integerindex.o- a Ψ-object.- Throws:
PsyException- when an error occurs.
-
psyInsertAll
default void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) throws PsyException
- Throws:
PsyException
-
psyPrepend
default void psyPrepend(T o) throws PsyException
Inserts the specified Ψ-objectinto this array at the beginning.- Parameters:
o- a Ψ-object.- Throws:
PsyException- when an error occurs.
-
psyPreChop
default T psyPreChop() throws PsyException
- Throws:
PsyException
-
psyPostChop
default T psyPostChop() throws PsyException
- Throws:
PsyException
-
psyPrependAll
default void psyPrependAll(PsyIterable<? extends T> oEnumeration) throws PsyException
- Throws:
PsyException
-
psyReplicate
default PsyFormalArray<T> psyReplicate(PsyInteger oCount) throws PsyException
- Specified by:
psyReplicatein interfacePsyAppendable<T extends PsyObject>- Throws:
PsyException
-
psyPutInterval
default void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) throws PsyException
- Throws:
PsyException
-
psyDelete
default void psyDelete(PsyInteger oIndex) throws PsyException
Description copied from interface:PsyIndexedDeletes a key or index and a value associated with it from this object.- Specified by:
psyDeletein interfacePsyIndexed<PsyInteger,T extends PsyObject>- Parameters:
oIndex- a key or an index.- Throws:
PsyException- when key is absent or index is out of range.
-
delete
void delete(int index) throws PsyException- Throws:
PsyException
-
psyExtract
default T psyExtract(PsyInteger oIndex) throws PsyException
- Specified by:
psyExtractin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Throws:
PsyException
-
psyGetAll
default PsyFormalArray<T> psyGetAll(PsyIterable<PsyInteger> oIndices) throws PsyException
- Specified by:
psyGetAllin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Throws:
PsyException
-
psySetLength
void psySetLength(PsyInteger oLength) throws PsyException
- Throws:
PsyException
-
extract
T extract(int index) throws PsyException
- Throws:
PsyException
-
psyExtractInterval
PsyFormalArray<T> psyExtractInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyException
- Throws:
PsyException
-
psySlice
PsyFormalArray<T> 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 interfacePsyIndexed<PsyInteger,T extends PsyObject>- Parameters:
oIndices- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException- when key is absent or index is out of range.
-
psyKeys
default PsyStream psyKeys()
Description copied from interface:PsyIndexedReturns a Ψ-iterableenumeration of all the keys of this object.- Specified by:
psyKeysin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Returns:
- an enumeration of keys.
-
psyValues
default PsyFormalStream<T> psyValues()
Description copied from interface:PsyIndexedReturns a Ψ-iterableenumeration of all the values of this object.- Specified by:
psyValuesin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Returns:
- an enumeration of values.
-
psyEntries
default PsyFormalStream<PsyObject> psyEntries()
Description copied from interface:PsyIndexedReturns a Ψ-iterableenumeration of all the keys and values of this object.- Specified by:
psyEntriesin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Returns:
- an enumeration of entries.
-
toSyntaxString
default String toSyntaxString()
- Specified by:
toSyntaxStringin interfacePsyObject
-
toSyntaxStringHelper
default String toSyntaxStringHelper(Set<PsyContainer<T>> processed)
- Specified by:
toSyntaxStringHelperin interfacePsyContainer<T extends PsyObject>
-
-