Package coneforest.psylla.core
Class PsyDict
- java.lang.Object
-
- coneforest.psylla.core.PsyDict
-
- All Implemented Interfaces:
PsyClearable,PsyContainer<PsyObject>,PsyConvertableToName,PsyConvertableToString,PsyFormalDict<PsyObject>,PsyIndexed<PsyTextual,PsyObject>,PsyIterable<PsyObject>,PsyLengthy,PsyObject,PsySequential<PsyObject>,PsyStreamable<PsyObject>,Iterable<PsyObject>
- Direct Known Subclasses:
PsyModule,PsyNamespace
public class PsyDict extends Object implements PsyFormalDict<PsyObject>
A representation of Ψ-dict, a dictionary.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PsyObjectget(String key)booleanisEmpty()Returns a boolean indicating if this container is empty (has zero length).Iterator<PsyObject>iterator()booleanknown(String key)intlength()Returns a length of this object.voidpsyClear()Clear this object.PsyDictpsyClone()Returns a clone of this object.PsyStreampsyKeys()Returns a Ψ-iterableenumeration of all the keys of this object.PsyDictpsySlice(PsyIterable<PsyTextual> oKeys)Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.PsyStreampsyStream()voidput(String key, PsyObject o)voidundef(String key)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyFormalDict
psyDelete, psyEntries, psyExtract, psyForAll, psyGet, psyGetAll, psyKnown, psyPut, psyUndef, toSyntaxString, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyIndexed
psyValues
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyToArray, psyUnite
-
Methods inherited from interface coneforest.psylla.core.PsyLengthy
psyIsEmpty, psyLength
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Method Detail
-
psyClone
public PsyDict psyClone()
Description copied from interface:PsyObjectReturns a clone of this object.
-
get
public PsyObject get(String key) throws PsyException
- Specified by:
getin interfacePsyFormalDict<PsyObject>- Throws:
PsyException
-
put
public void put(String key, PsyObject o)
- Specified by:
putin interfacePsyFormalDict<PsyObject>
-
undef
public void undef(String key)
- Specified by:
undefin interfacePsyFormalDict<PsyObject>
-
known
public boolean known(String key)
- Specified by:
knownin interfacePsyFormalDict<PsyObject>
-
length
public int length()
Description copied from interface:PsyLengthyReturns a length of this object.- Specified by:
lengthin interfacePsyLengthy- Returns:
- a length.
-
isEmpty
public boolean isEmpty()
Description copied from interface:PsyLengthyReturns a boolean indicating if this container is empty (has zero length).- Specified by:
isEmptyin interfacePsyLengthy- Returns:
true, if this container is empty, andfalseotherwise.
-
psyClear
public void psyClear()
Description copied from interface:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable- Specified by:
psyClearin interfacePsyFormalDict<PsyObject>
-
psySlice
public PsyDict psySlice(PsyIterable<PsyTextual> oKeys) throws PsyException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.- Specified by:
psySlicein interfacePsyFormalDict<PsyObject>- Specified by:
psySlicein interfacePsyIndexed<PsyTextual,PsyObject>- Parameters:
oKeys- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException- when key is absent or index is out of range.
-
psyKeys
public PsyStream psyKeys()
Description copied from interface:PsyIndexedReturns a Ψ-iterableenumeration of all the keys of this object.- Specified by:
psyKeysin interfacePsyFormalDict<PsyObject>- Specified by:
psyKeysin interfacePsyIndexed<PsyTextual,PsyObject>- Returns:
- an enumeration of keys.
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStreamin interfacePsyIterable<PsyObject>- Specified by:
psyStreamin interfacePsyStreamable<PsyObject>
-
-