Package coneforest.psylla.core
Interface PsyArraylike<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
,PsyStreamlike<T>
- All Known Implementing Classes:
PsyArray
,PsyBitArray
,PsyProc
,PsyString
public interface PsyArraylike<T extends PsyObject> extends PsyAppendable<T>, PsyContainer<T>, PsyIndexed<PsyInteger,T>
A representation of Ψ-arraylike
, an abstraction of an array composed of Ψ-object
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
delete(int index)
T
extract(int index)
T
get(int index)
void
insert(int index, T o)
Inserts the specified Ψ-object
into this array at the position specified by a given index.PsyArraylike<T>
psyClone()
Returns a clone of this object.default PsyInteger
psyCount()
default void
psyDelete(PsyInteger oIndex)
Deletes a key or index and a value associated with it from this object.default PsyIterable<PsyObject>
psyEntries()
Returns a Ψ-iterable
enumeration of all the keys and values of this object.default T
psyExtract(PsyInteger oIndex)
PsyArraylike<T>
psyExtractInterval(PsyInteger oIndex, PsyInteger oCount)
default T
psyGet(PsyInteger oIndex)
Returns the element with given key or index.default PsyArraylike<T>
psyGetAll(PsyIterable<PsyInteger> oIndices)
PsyArraylike<T>
psyGetInterval(PsyInteger oIndex, PsyInteger oLength)
default void
psyInsert(PsyInteger oIndex, T o)
Inserts the specified Ψ-object
into this array at the position specified by a given Ψ-integer
index.default void
psyInsertAll(PsyInteger oIndex, PsyIterable<? extends T> oEnumeration)
default PsyIterable<PsyInteger>
psyKeys()
Returns a Ψ-iterable
enumeration of all the keys of this object.default PsyBoolean
psyKnown(PsyInteger oIndex)
Returns a Ψ-boolean
indicating whether given key or index exists in this object.default T
psyPostChop()
default T
psyPreChop()
default void
psyPrepend(T o)
Inserts the specified Ψ-object
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 PsyArraylike<T>
psyReplicate(PsyInteger oCount)
default PsyArraylike<T>
psyReverse()
void
psySetLength(PsyInteger oLength)
PsyArraylike<T>
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.default PsyIterable<T>
psyValues()
Returns a Ψ-iterable
enumeration of all the values of this object.void
put(int index, T o)
default String
toSyntaxString()
default String
toSyntaxStringHelper(PsyLengthy oLengthy)
-
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
psyFilter, psyForAll, psyMap, 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.PsyStreamlike
iterator, psyConcat
-
-
-
-
Method Detail
-
psyClone
PsyArraylike<T> psyClone()
Description copied from interface:PsyObject
Returns a clone of this object.
-
psyReverse
default PsyArraylike<T> psyReverse() throws PsyException
- Throws:
PsyException
-
psyKnown
default PsyBoolean psyKnown(PsyInteger oIndex)
Description copied from interface:PsyIndexed
Returns a Ψ-boolean
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
T get(int index) throws PsyException
- Throws:
PsyException
-
psyGet
default T psyGet(PsyInteger oIndex) throws PsyException
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:
PsyException
- when index is out of range.
-
psyGetInterval
PsyArraylike<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:PsyIndexed
Stores an element with given key or index. InPsyArraylike
containers replaces existing element. InPsyDictlike
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:
PsyException
- when key is absent or index is out of range.
-
insert
void insert(int index, T o) throws PsyException
Inserts the specified Ψ-object
into this array at the position specified by a given index.- Parameters:
index
- a Ψ-integer
index.o
- a Ψ-object
.- Throws:
PsyException
- when an error occurs.
-
psyInsert
default void psyInsert(PsyInteger oIndex, T o) throws PsyException
Inserts the specified Ψ-object
into this array at the position specified by a given Ψ-integer
index.- Parameters:
oIndex
- a Ψ-integer
index.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 Ψ-object
into 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 PsyArraylike<T> psyReplicate(PsyInteger oCount) throws PsyException
- Specified by:
psyReplicate
in 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: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:
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:
psyExtract
in interfacePsyIndexed<PsyInteger,T extends PsyObject>
- Throws:
PsyException
-
psyGetAll
default PsyArraylike<T> psyGetAll(PsyIterable<PsyInteger> oIndices) throws PsyException
- Specified by:
psyGetAll
in 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
PsyArraylike<T> psyExtractInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyException
- Throws:
PsyException
-
psySlice
PsyArraylike<T> 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 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 PsyIterable<PsyInteger> psyKeys()
Description copied from interface:PsyIndexed
Returns a Ψ-iterable
enumeration of all the keys of this object.- Specified by:
psyKeys
in interfacePsyIndexed<PsyInteger,T extends PsyObject>
- Returns:
- an enumeration of keys.
-
psyValues
default PsyIterable<T> psyValues()
Description copied from interface:PsyIndexed
Returns a Ψ-iterable
enumeration of all the values of this object.- Specified by:
psyValues
in interfacePsyIndexed<PsyInteger,T extends PsyObject>
- Returns:
- an enumeration of values.
-
psyEntries
default PsyIterable<PsyObject> psyEntries()
Description copied from interface:PsyIndexed
Returns a Ψ-iterable
enumeration of all the keys and values of this object.- Specified by:
psyEntries
in interfacePsyIndexed<PsyInteger,T extends PsyObject>
- Returns:
- an enumeration of entries.
-
psyCount
default PsyInteger psyCount()
- Specified by:
psyCount
in interfacePsyIterable<T extends PsyObject>
- Specified by:
psyCount
in interfacePsyStreamlike<T extends PsyObject>
-
toSyntaxString
default String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyObject
-
toSyntaxStringHelper
default String toSyntaxStringHelper(PsyLengthy oLengthy)
-
-