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 offormalarray, an abstraction of an array composed ofobjects.
-
-
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 specifiedobjectinto 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 aniterableenumeration 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 specifiedobjectinto this array at the position specified by a givenintegerindex.default voidpsyInsertAll(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration)default PsyStreampsyKeys()Returns aniterableenumeration of all the keys of this object.default PsyBooleanpsyKnown(PsyInteger oIndex)Returns abooleanindicating whether given key or index exists in this object.default TpsyPostChop()default TpsyPreChop()default voidpsyPrepend(T o)Inserts the specifiedobjectinto 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 giveniterableand of associated values.default PsyFormalStream<T>psyValues()Returns aniterableenumeration 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 PsyErrorException
- Throws:
PsyErrorException
-
psyKnown
default PsyBoolean psyKnown(PsyInteger oIndex)
Description copied from interface:PsyIndexedReturns abooleanindicating 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 PsyErrorException
- Throws:
PsyErrorException
-
psyGet
default T psyGet(PsyInteger oIndex) throws PsyErrorException
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:
PsyErrorException- when index is out of range.
-
psyGetInterval
PsyFormalArray<T> psyGetInterval(PsyInteger oIndex, PsyInteger oLength) throws PsyErrorException
- Throws:
PsyErrorException
-
put
void put(int index, T o) throws PsyErrorException- Throws:
PsyErrorException
-
psyPut
default void psyPut(PsyInteger oIndex, T o) throws PsyErrorException
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:
PsyErrorException- when key is absent or index is out of range.
-
insert
void insert(int index, T o) throws PsyErrorExceptionInserts the specifiedobjectinto this array at the position specified by a given index.- Parameters:
index- aintegerindex.o- aobject.- Throws:
PsyErrorException- when an error occurs.
-
psyInsert
default void psyInsert(PsyInteger oIndex, T o) throws PsyErrorException
Inserts the specifiedobjectinto this array at the position specified by a givenintegerindex.- Parameters:
oIndex- anintegerindex.o- anobject.- Throws:
PsyErrorException- when an error occurs.
-
psyInsertAll
default void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) throws PsyErrorException
- Throws:
PsyErrorException
-
psyPrepend
default void psyPrepend(T o) throws PsyErrorException
Inserts the specifiedobjectinto this array at the beginning.- Parameters:
o- anobject.- Throws:
PsyErrorException- when an error occurs.
-
psyPreChop
default T psyPreChop() throws PsyErrorException
- Throws:
PsyErrorException
-
psyPostChop
default T psyPostChop() throws PsyErrorException
- Throws:
PsyErrorException
-
psyPrependAll
default void psyPrependAll(PsyIterable<? extends T> oEnumeration) throws PsyErrorException
- Throws:
PsyErrorException
-
psyReplicate
default PsyFormalArray<T> psyReplicate(PsyInteger oCount) throws PsyErrorException
- Specified by:
psyReplicatein interfacePsyAppendable<T extends PsyObject>- Throws:
PsyErrorException
-
psyPutInterval
default void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) throws PsyErrorException
- Throws:
PsyErrorException
-
psyDelete
default void psyDelete(PsyInteger oIndex) throws PsyErrorException
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:
PsyErrorException- when key is absent or index is out of range.
-
delete
void delete(int index) throws PsyErrorException- Throws:
PsyErrorException
-
psyExtract
default T psyExtract(PsyInteger oIndex) throws PsyErrorException
- Specified by:
psyExtractin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Throws:
PsyErrorException
-
psyGetAll
default PsyFormalArray<T> psyGetAll(PsyIterable<PsyInteger> oIndices) throws PsyErrorException
- Specified by:
psyGetAllin interfacePsyIndexed<PsyInteger,T extends PsyObject>- Throws:
PsyErrorException
-
psySetLength
void psySetLength(PsyInteger oLength) throws PsyErrorException
- Throws:
PsyErrorException
-
extract
T extract(int index) throws PsyErrorException
- Throws:
PsyErrorException
-
psyExtractInterval
PsyFormalArray<T> psyExtractInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyErrorException
- Throws:
PsyErrorException
-
psySlice
PsyFormalArray<T> psySlice(PsyIterable<PsyInteger> oIndices) throws PsyErrorException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from giveniterableand of associated values.- Specified by:
psySlicein interfacePsyIndexed<PsyInteger,T extends PsyObject>- Parameters:
oIndices- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyErrorException- when key is absent or index is out of range.
-
psyKeys
default PsyStream psyKeys()
Description copied from interface:PsyIndexedReturns aniterableenumeration 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 aniterableenumeration 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 aniterableenumeration 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>
-
-