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
A representation of
dict
, a dictionary.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isEmpty()
Returns a boolean indicating if this container is empty (has zero length).iterator()
boolean
int
length()
Returns a length of this object.void
psyClear()
Clear this object.psyClone()
Returns a clone of this object.psyKeys()
Returns aniterable
enumeration of all the keys of this object.psySlice
(PsyIterable<PsyTextual> oKeys) Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.void
void
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 Details
-
OPERATORS
-
-
Constructor Details
-
PsyDict
public PsyDict()Creates a new emptydict
. -
PsyDict
Creates a newdict
wrapped around the given hash map.- Parameters:
dict
- a given hash map.
-
-
Method Details
-
psyClone
Description copied from interface:PsyObject
Returns a clone of this object. -
get
- Specified by:
get
in interfacePsyFormalDict<PsyObject>
- Throws:
PsyErrorException
-
put
- Specified by:
put
in interfacePsyFormalDict<PsyObject>
-
undef
- Specified by:
undef
in interfacePsyFormalDict<PsyObject>
-
known
- Specified by:
known
in interfacePsyFormalDict<PsyObject>
-
iterator
-
length
public int length()Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Returns:
- a length.
-
isEmpty
public boolean isEmpty()Description copied from interface:PsyLengthy
Returns a boolean indicating if this container is empty (has zero length).- Specified by:
isEmpty
in interfacePsyLengthy
- Returns:
true
, if this container is empty, andfalse
otherwise.
-
psyClear
public void psyClear()Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
- Specified by:
psyClear
in interfacePsyFormalDict<PsyObject>
-
psySlice
Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.- Specified by:
psySlice
in interfacePsyFormalDict<PsyObject>
- Specified by:
psySlice
in interfacePsyIndexed<PsyTextual,
PsyObject> - Parameters:
oKeys
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyErrorException
- when key is absent or index is out of range.
-
psyKeys
Description copied from interface:PsyIndexed
Returns aniterable
enumeration of all the keys of this object.- Specified by:
psyKeys
in interfacePsyFormalDict<PsyObject>
- Specified by:
psyKeys
in interfacePsyIndexed<PsyTextual,
PsyObject> - Returns:
- an enumeration of keys.
-
psyStream
- Specified by:
psyStream
in interfacePsyIterable<PsyObject>
- Specified by:
psyStream
in interfacePsyStreamable<PsyObject>
-