Package coneforest.psylla.core
Interface PsyDictlike<V extends PsyObject>
-
- Type Parameters:
V
- a type of contained values.
- All Superinterfaces:
Iterable<V>
,PsyClearable
,PsyContainer<V>
,PsyConvertableToName
,PsyConvertableToString
,PsyIndexed<PsyStringy,V>
,PsyIterable<V>
,PsyLengthy
,PsyObject
,PsyStreamlike<V>
- All Known Implementing Classes:
PsyConfigDict
,PsyDict
,PsyErrorDict
,PsyModule
,PsyNamespace
,PsyRomanNumerals
,PsySystemDict
public interface PsyDictlike<V extends PsyObject> extends PsyContainer<V>, PsyIndexed<PsyStringy,V>
A representation of Ψ-dictlike
, an abstraction of a dictionary.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description V
get(String key)
boolean
known(String key)
default void
psyClear()
Clear this object.default void
psyDelete(PsyStringy oKey)
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 V
psyExtract(PsyStringy oKey)
default V
psyGet(PsyStringy oKey)
Returns the element with given key or index.default PsyArraylike<V>
psyGetAll(PsyIterable<PsyStringy> oEnumeration)
PsyIterable<PsyStringy>
psyKeys()
Returns a Ψ-iterable
enumeration of all the keys of this object.default PsyBoolean
psyKnown(PsyStringy oKey)
Returns a Ψ-boolean
indicating whether given key or index exists in this object.default void
psyPut(PsyStringy oKey, V oValue)
Stores an element with given key or index.PsyDictlike<V>
psySlice(PsyIterable<PsyStringy> oEnumeration)
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.default void
psyUndef(PsyStringy oKey)
Deletes a key and associated value from this dictionary.default PsyIterable<V>
psyValues()
Returns a Ψ-iterable
enumeration of all the values of this object.void
put(String key, V oValue)
default String
toSyntaxString()
default String
toSyntaxStringHelper(PsyLengthy oLengthy)
void
undef(String key)
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyCount, 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, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
Methods inherited from interface coneforest.psylla.core.PsyStreamlike
iterator, psyConcat
-
-
-
-
Method Detail
-
get
V get(String key) throws PsyException
- Throws:
PsyException
-
psyGet
default V psyGet(PsyStringy oKey) throws PsyException
Description copied from interface:PsyIndexed
Returns the element with given key or index.- Specified by:
psyGet
in interfacePsyIndexed<PsyStringy,V extends PsyObject>
- Parameters:
oKey
- a key or an index.- Returns:
- an element.
- Throws:
PsyException
- when index is out of range.
-
psyGetAll
default PsyArraylike<V> psyGetAll(PsyIterable<PsyStringy> oEnumeration) throws PsyException
- Specified by:
psyGetAll
in interfacePsyIndexed<PsyStringy,V extends PsyObject>
- Throws:
PsyException
-
psyPut
default void psyPut(PsyStringy oKey, V oValue)
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<PsyStringy,V extends PsyObject>
- Parameters:
oKey
- a key or an index.oValue
- an element to be stored.
-
known
boolean known(String key)
-
psyKnown
default PsyBoolean psyKnown(PsyStringy oKey)
Description copied from interface:PsyIndexed
Returns a Ψ-boolean
indicating whether given key or index exists in this object.- Specified by:
psyKnown
in interfacePsyIndexed<PsyStringy,V extends PsyObject>
- Parameters:
oKey
- a key or an index.- Returns:
- a result.
-
undef
void undef(String key)
-
psyUndef
default void psyUndef(PsyStringy oKey)
Deletes a key and associated value from this dictionary.- Parameters:
oKey
- a Ψ-stringy
key.
-
psyKeys
PsyIterable<PsyStringy> psyKeys()
Description copied from interface:PsyIndexed
Returns a Ψ-iterable
enumeration of all the keys of this object.- Specified by:
psyKeys
in interfacePsyIndexed<PsyStringy,V extends PsyObject>
- Returns:
- an enumeration of keys.
-
psyValues
default PsyIterable<V> psyValues()
Description copied from interface:PsyIndexed
Returns a Ψ-iterable
enumeration of all the values of this object.- Specified by:
psyValues
in interfacePsyIndexed<PsyStringy,V extends PsyObject>
- Returns:
- an enumeration of values.
-
psyDelete
default void psyDelete(PsyStringy oKey) 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<PsyStringy,V extends PsyObject>
- Parameters:
oKey
- a key or an index.- Throws:
PsyException
- when key is absent or index is out of range.
-
psyExtract
default V psyExtract(PsyStringy oKey) throws PsyException
- Specified by:
psyExtract
in interfacePsyIndexed<PsyStringy,V extends PsyObject>
- Throws:
PsyException
-
psySlice
PsyDictlike<V> psySlice(PsyIterable<PsyStringy> oEnumeration) 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<PsyStringy,V extends PsyObject>
- Parameters:
oEnumeration
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException
- when key is absent or index is out of range.
-
toSyntaxString
default String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyObject
-
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<PsyStringy,V extends PsyObject>
- Returns:
- an enumeration of entries.
-
toSyntaxStringHelper
default String toSyntaxStringHelper(PsyLengthy oLengthy)
-
psyClear
default void psyClear()
Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
-