Package coneforest.psylla.core
Interface PsyIndexed<K extends PsyObject,V extends PsyObject>
-
- Type Parameters:
K- a type of keys or indices.V- a type of elements.
- All Superinterfaces:
PsyConvertableToName,PsyConvertableToString,PsyObject
- All Known Subinterfaces:
PsyFormalArray<T>,PsyFormalDict<V>
- All Known Implementing Classes:
PsyArray,PsyBitArray,PsyConfigDict,PsyDict,PsyErrorDict,PsyModule,PsyNamespace,PsyProc,PsyRomanNumerals,PsyString,PsySystemDict
public interface PsyIndexed<K extends PsyObject,V extends PsyObject> extends PsyObject
A representation of Ψ-indexed, a type of the container whose elements are indexed.
-
-
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 voidpsyDelete(K oKey)Deletes a key or index and a value associated with it from this object.PsyFormalStream<PsyObject>psyEntries()Returns a Ψ-iterableenumeration of all the keys and values of this object.VpsyExtract(K oKey)VpsyGet(K oKey)Returns the element with given key or index.PsyFormalArray<V>psyGetAll(PsyIterable<K> oKeys)PsyFormalStream<K>psyKeys()Returns a Ψ-iterableenumeration of all the keys of this object.PsyBooleanpsyKnown(K oKey)Returns a Ψ-booleanindicating whether given key or index exists in this object.voidpsyPut(K oKey, V oValue)Stores an element with given key or index.PsyIndexed<K,V>psySlice(PsyIterable<K> oKeys)Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.default PsyFormalStream<V>psyValues()Returns a Ψ-iterableenumeration of all the values of this object.-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
-
-
-
-
Field Detail
-
OPERATORS
static final PsyOperator[] OPERATORS
-
-
Method Detail
-
psyKnown
PsyBoolean psyKnown(K oKey)
Returns a Ψ-booleanindicating whether given key or index exists in this object.- Parameters:
oKey- a key or an index.- Returns:
- a result.
-
psyGet
V psyGet(K oKey) throws PsyException
Returns the element with given key or index.- Parameters:
oKey- a key or an index.- Returns:
- an element.
- Throws:
PsyException- when index is out of range.
-
psyPut
void psyPut(K oKey, V oValue) throws PsyException
Stores an element with given key or index. InPsyFormalArraycontainers replaces existing element. InPsyFormalDictcontainers replaces an old or creates a new element associated with specified key.- Parameters:
oKey- a key or an index.oValue- an element to be stored.- Throws:
PsyException- when key is absent or index is out of range.
-
psyDelete
void psyDelete(K oKey) throws PsyException
Deletes a key or index and a value associated with it from this object.- Parameters:
oKey- a key or an index.- Throws:
PsyException- when key is absent or index is out of range.
-
psyExtract
V psyExtract(K oKey) throws PsyException
- Throws:
PsyException
-
psySlice
PsyIndexed<K,V> psySlice(PsyIterable<K> oKeys) throws PsyException
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.- Parameters:
oKeys- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException- when key is absent or index is out of range.
-
psyGetAll
PsyFormalArray<V> psyGetAll(PsyIterable<K> oKeys) throws PsyException
- Throws:
PsyException
-
psyKeys
PsyFormalStream<K> psyKeys()
Returns a Ψ-iterableenumeration of all the keys of this object.- Returns:
- an enumeration of keys.
-
psyValues
default PsyFormalStream<V> psyValues()
Returns a Ψ-iterableenumeration of all the values of this object.- Returns:
- an enumeration of values.
-
psyEntries
PsyFormalStream<PsyObject> psyEntries()
Returns a Ψ-iterableenumeration of all the keys and values of this object.- Returns:
- an enumeration of entries.
-
-