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
A representation of
indexed
, a type of the container whose elements
are indexed.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes a key or index and a value associated with it from this object.Returns aniterable
enumeration of all the keys and values of this object.psyExtract
(K oKey) Returns the element with given key or index.psyGetAll
(PsyIterable<K> oKeys) psyKeys()
Returns aniterable
enumeration of all the keys of this object.Returns aboolean
indicating whether given key or index exists in this object.void
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 giveniterable
and of associated values.default PsyFormalStream<V>
Returns aniterable
enumeration 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 Details
-
OPERATORS
-
-
Method Details
-
psyKnown
Returns aboolean
indicating whether given key or index exists in this object.- Parameters:
oKey
- a key or an index.- Returns:
- a result.
-
psyGet
Returns the element with given key or index.- Parameters:
oKey
- a key or an index.- Returns:
- an element.
- Throws:
PsyErrorException
- when index is out of range.
-
psyPut
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.- Parameters:
oKey
- a key or an index.oValue
- an element to be stored.- Throws:
PsyErrorException
- when key is absent or index is out of range.
-
psyDelete
Deletes a key or index and a value associated with it from this object.- Parameters:
oKey
- a key or an index.- Throws:
PsyErrorException
- when key is absent or index is out of range.
-
psyExtract
- Throws:
PsyErrorException
-
psySlice
Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.- Parameters:
oKeys
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyErrorException
- when key is absent or index is out of range.
-
psyGetAll
- Throws:
PsyErrorException
-
psyKeys
PsyFormalStream<K> psyKeys()Returns aniterable
enumeration of all the keys of this object.- Returns:
- an enumeration of keys.
-
psyValues
Returns aniterable
enumeration of all the values of this object.- Returns:
- an enumeration of values.
-
psyEntries
PsyFormalStream<PsyObject> psyEntries()Returns aniterable
enumeration of all the keys and values of this object.- Returns:
- an enumeration of entries.
-