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 object
s.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int index) extract
(int index) get
(int index) void
Inserts the specifiedobject
into this array at the position specified by a given index.psyClone()
Returns a clone of this object.default void
psyDelete
(PsyInteger oIndex) Deletes a key or index and a value associated with it from this object.default PsyFormalStream<PsyObject>
Returns aniterable
enumeration of all the keys and values of this object.default T
psyExtract
(PsyInteger oIndex) psyExtractInterval
(PsyInteger oIndex, PsyInteger oCount) default T
psyGet
(PsyInteger oIndex) Returns the element with given key or index.default PsyFormalArray<T>
psyGetAll
(PsyIterable<PsyInteger> oIndices) psyGetInterval
(PsyInteger oIndex, PsyInteger oLength) default void
psyInsert
(PsyInteger oIndex, T o) Inserts the specifiedobject
into this array at the position specified by a giveninteger
index.default void
psyInsertAll
(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) default PsyStream
psyKeys()
Returns aniterable
enumeration of all the keys of this object.default PsyBoolean
psyKnown
(PsyInteger oIndex) Returns aboolean
indicating whether given key or index exists in this object.default T
default T
default void
psyPrepend
(T o) Inserts the specifiedobject
into this array at the beginning.default void
psyPrependAll
(PsyIterable<? extends T> oEnumeration) default void
psyPut
(PsyInteger oIndex, T o) Stores an element with given key or index.default void
psyPutInterval
(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) default PsyFormalArray<T>
psyReplicate
(PsyInteger oCount) default PsyFormalArray<T>
void
psySetLength
(PsyInteger oLength) psySlice
(PsyIterable<PsyInteger> oIndices) Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.default PsyFormalStream<T>
Returns aniterable
enumeration of all the values of this object.void
default String
default String
toSyntaxStringHelper
(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 Details
-
OPERATORS
-
-
Method Details
-
psyClone
PsyFormalArray<T> psyClone()Description copied from interface:PsyObject
Returns a clone of this object. -
psyReverse
- Throws:
PsyErrorException
-
psyKnown
Description copied from interface:PsyIndexed
Returns aboolean
indicating whether given key or index exists in this object.- Specified by:
psyKnown
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Parameters:
oIndex
- a key or an index.- Returns:
- a result.
-
get
- Throws:
PsyErrorException
-
psyGet
Description copied from interface:PsyIndexed
Returns the element with given key or index.- Specified by:
psyGet
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Parameters:
oIndex
- a key or an index.- Returns:
- an element.
- Throws:
PsyErrorException
- when index is out of range.
-
psyGetInterval
- Throws:
PsyErrorException
-
put
- Throws:
PsyErrorException
-
psyPut
Description copied from interface:PsyIndexed
Stores an element with given key or index. InPsyFormalArray
containers replaces existing element. InPsyFormalDict
containers replaces an old or creates a new element associated with specified key.- Specified by:
psyPut
in 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
Inserts the specifiedobject
into this array at the position specified by a given index.- Parameters:
index
- ainteger
index.o
- aobject
.- Throws:
PsyErrorException
- when an error occurs.
-
psyInsert
Inserts the specifiedobject
into this array at the position specified by a giveninteger
index.- Parameters:
oIndex
- aninteger
index.o
- anobject
.- Throws:
PsyErrorException
- when an error occurs.
-
psyInsertAll
default void psyInsertAll(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) throws PsyErrorException - Throws:
PsyErrorException
-
psyPrepend
Inserts the specifiedobject
into this array at the beginning.- Parameters:
o
- anobject
.- Throws:
PsyErrorException
- when an error occurs.
-
psyPreChop
- Throws:
PsyErrorException
-
psyPostChop
- Throws:
PsyErrorException
-
psyPrependAll
- Throws:
PsyErrorException
-
psyReplicate
- Specified by:
psyReplicate
in interfacePsyAppendable<T extends PsyObject>
- Throws:
PsyErrorException
-
psyPutInterval
default void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration) throws PsyErrorException - Throws:
PsyErrorException
-
psyDelete
Description copied from interface:PsyIndexed
Deletes a key or index and a value associated with it from this object.- Specified by:
psyDelete
in 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
- Throws:
PsyErrorException
-
psyExtract
- Specified by:
psyExtract
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Throws:
PsyErrorException
-
psyGetAll
- Specified by:
psyGetAll
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Throws:
PsyErrorException
-
psySetLength
- Throws:
PsyErrorException
-
extract
- Throws:
PsyErrorException
-
psyExtractInterval
- Throws:
PsyErrorException
-
psySlice
Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.- Specified by:
psySlice
in 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
Description copied from interface:PsyIndexed
Returns aniterable
enumeration of all the keys of this object.- Specified by:
psyKeys
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Returns:
- an enumeration of keys.
-
psyValues
Description copied from interface:PsyIndexed
Returns aniterable
enumeration of all the values of this object.- Specified by:
psyValues
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Returns:
- an enumeration of values.
-
psyEntries
Description copied from interface:PsyIndexed
Returns aniterable
enumeration of all the keys and values of this object.- Specified by:
psyEntries
in interfacePsyIndexed<PsyInteger,
T extends PsyObject> - Returns:
- an enumeration of entries.
-
toSyntaxString
- Specified by:
toSyntaxString
in interfacePsyObject
-
toSyntaxStringHelper
- Specified by:
toSyntaxStringHelper
in interfacePsyContainer<T extends PsyObject>
-