Package coneforest.psylla.core
Interface PsyFormalDict<V extends PsyObject>
-
- Type Parameters:
V- a type of contained values.
- All Superinterfaces:
Iterable<V>,PsyClearable,PsyContainer<V>,PsyConvertableToName,PsyConvertableToString,PsyIndexed<PsyTextual,V>,PsyIterable<V>,PsyLengthy,PsyObject,PsySequential<V>,PsyStreamable<V>
- All Known Implementing Classes:
PsyConfigDict,PsyDict,PsyErrorDict,PsyModule,PsyNamespace,PsyRomanNumerals,PsySystemDict
public interface PsyFormalDict<V extends PsyObject> extends PsyContainer<V>, PsyIndexed<PsyTextual,V>, PsySequential<V>
A representation offormaldict, an abstraction of a dictionary.
-
-
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 Vget(String key)booleanknown(String key)default voidpsyClear()Clear this object.default voidpsyDelete(PsyTextual oKey)Deletes a key or index and a value associated with it from this object.default PsyStreampsyEntries()Returns aniterableenumeration of all the keys and values of this object.default VpsyExtract(PsyTextual oKey)default voidpsyForAll(PsyObject oProc, PsyContext oContext)default VpsyGet(PsyTextual oKey)Returns the element with given key or index.default PsyFormalArray<V>psyGetAll(PsyIterable<PsyTextual> oEnumeration)PsyFormalStream<PsyTextual>psyKeys()Returns aniterableenumeration of all the keys of this object.default PsyBooleanpsyKnown(PsyTextual oKey)Returns abooleanindicating whether given key or index exists in this object.default voidpsyPut(PsyTextual oKey, V oValue)Stores an element with given key or index.PsyFormalDict<V>psySlice(PsyIterable<PsyTextual> oEnumeration)Returns a container of the same type as this object consisting of keys or indices from giveniterableand of associated values.default voidpsyUndef(PsyTextual oKey)Deletes a key and associated value from this dictionary.voidput(String key, V oValue)default StringtoSyntaxString()default StringtoSyntaxStringHelper(Set<PsyContainer<V>> processed)voidundef(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.PsyIndexed
psyValues
-
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, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
-
-
-
Field Detail
-
OPERATORS
static final PsyOperator[] OPERATORS
-
-
Method Detail
-
psyForAll
default void psyForAll(PsyObject oProc, PsyContext oContext) throws PsyErrorException
- Specified by:
psyForAllin interfacePsySequential<V extends PsyObject>- Specified by:
psyForAllin interfacePsyStreamable<V extends PsyObject>- Throws:
PsyErrorException
-
get
V get(String key) throws PsyErrorException
- Throws:
PsyErrorException
-
psyGet
default V psyGet(PsyTextual oKey) throws PsyErrorException
Description copied from interface:PsyIndexedReturns the element with given key or index.- Specified by:
psyGetin interfacePsyIndexed<PsyTextual,V extends PsyObject>- Parameters:
oKey- a key or an index.- Returns:
- an element.
- Throws:
PsyErrorException- when index is out of range.
-
psyGetAll
default PsyFormalArray<V> psyGetAll(PsyIterable<PsyTextual> oEnumeration) throws PsyErrorException
- Specified by:
psyGetAllin interfacePsyIndexed<PsyTextual,V extends PsyObject>- Throws:
PsyErrorException
-
psyPut
default void psyPut(PsyTextual oKey, V oValue)
Description copied from interface:PsyIndexedStores an element with given key or index. InPsyFormalArraycontainers replaces existing element. InPsyFormalDictcontainers replaces an old or creates a new element associated with specified key.- Specified by:
psyPutin interfacePsyIndexed<PsyTextual,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(PsyTextual oKey)
Description copied from interface:PsyIndexedReturns abooleanindicating whether given key or index exists in this object.- Specified by:
psyKnownin interfacePsyIndexed<PsyTextual,V extends PsyObject>- Parameters:
oKey- a key or an index.- Returns:
- a result.
-
undef
void undef(String key)
-
psyUndef
default void psyUndef(PsyTextual oKey)
Deletes a key and associated value from this dictionary.- Parameters:
oKey- atextualkey.
-
psyKeys
PsyFormalStream<PsyTextual> psyKeys()
Description copied from interface:PsyIndexedReturns aniterableenumeration of all the keys of this object.- Specified by:
psyKeysin interfacePsyIndexed<PsyTextual,V extends PsyObject>- Returns:
- an enumeration of keys.
-
psyDelete
default void psyDelete(PsyTextual oKey) throws PsyErrorException
Description copied from interface:PsyIndexedDeletes a key or index and a value associated with it from this object.- Specified by:
psyDeletein interfacePsyIndexed<PsyTextual,V extends PsyObject>- Parameters:
oKey- a key or an index.- Throws:
PsyErrorException- when key is absent or index is out of range.
-
psyExtract
default V psyExtract(PsyTextual oKey) throws PsyErrorException
- Specified by:
psyExtractin interfacePsyIndexed<PsyTextual,V extends PsyObject>- Throws:
PsyErrorException
-
psySlice
PsyFormalDict<V> psySlice(PsyIterable<PsyTextual> oEnumeration) throws PsyErrorException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from giveniterableand of associated values.- Specified by:
psySlicein interfacePsyIndexed<PsyTextual,V extends PsyObject>- Parameters:
oEnumeration- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyErrorException- when key is absent or index is out of range.
-
psyEntries
default PsyStream psyEntries()
Description copied from interface:PsyIndexedReturns aniterableenumeration of all the keys and values of this object.- Specified by:
psyEntriesin interfacePsyIndexed<PsyTextual,V extends PsyObject>- Returns:
- an enumeration of entries.
-
toSyntaxString
default String toSyntaxString()
- Specified by:
toSyntaxStringin interfacePsyObject
-
toSyntaxStringHelper
default String toSyntaxStringHelper(Set<PsyContainer<V>> processed)
- Specified by:
toSyntaxStringHelperin interfacePsyContainer<V extends PsyObject>
-
psyClear
default void psyClear()
Description copied from interface:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable
-
-