- Type Parameters:
T
- a type of the elements.
- All Superinterfaces:
Iterable<T>
,PsyAppendable<T>
,PsyClearable
,PsyContainer<T>
,PsyIterable<T>
,PsyLengthy
,PsyObject
,PsySequential<T>
,PsyStreamable<T>
@Type("formalset")
public interface PsyFormalSet<T extends PsyObject>
extends PsyAppendable<T>, PsyContainer<T>
The representation of a
formalset
, an abstraction of a finite set of object
s.
This interface declares methods for appending, removal and set operations.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thecontains
operator.static final ContextAction
Context action of theintersects
operator.static final ContextAction
Context action of theremove
operator.static final ContextAction
Context action of theremoveall
operator.static final ContextAction
Context action of theretainall
operator.Fields inherited from interface coneforest.psylla.core.PsyAppendable
PSY_APPEND, PSY_APPENDALL
Fields inherited from interface coneforest.psylla.core.PsyClearable
PSY_CLEAR
Fields inherited from interface coneforest.psylla.core.PsyLengthy
PSY_ISEMPTY, PSY_LENGTH
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALL
Fields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
psyAppendAll
(PsyIterable<? extends T> oEnumeration) Appends all theobject
s from a giveniterable
enumeration to this set.default void
psyClear()
Removes all the elements from this set.psyContains
(T o) Returns aboolean
object indicating whether a givenobject
belongs to this set.default PsyBoolean
psyIntersects
(PsyFormalSet<? extends T> oSet) Returns aboolean
object indicating whether a givenformalset
set intersects with this set.void
Removes anobject
from this set.default void
psyRemoveAll
(PsyIterable<? extends T> oEnumeration) Removes all theobject
s in a giveniterable
enumeration from this set.default PsyFormalSet<T>
psyReplicate
(PsyInteger oCount) default void
psyRetainAll
(PsyIterable<? extends T> oEnumeration) default String
Returns the syntactic representation of this object.default String
toSyntaxStringHelper
(PsyLengthy oLengthy) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppend
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty, toSyntaxStringHelper
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
Methods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
Field Details
-
PSY_CONTAINS
Context action of thecontains
operator. -
PSY_INTERSECTS
Context action of theintersects
operator. -
PSY_REMOVE
Context action of theremove
operator. -
PSY_REMOVEALL
Context action of theremoveall
operator. -
PSY_RETAINALL
Context action of theretainall
operator.
-
-
Method Details
-
psyRemove
Removes anobject
from this set. If a given object is not present in this set, error does not occur.- Parameters:
o
- anobject
.
-
psyRemoveAll
Removes all theobject
s in a giveniterable
enumeration from this set. If some object is not present in this set, error does not occur.- Parameters:
oEnumeration
- aniterable
enumeration.
-
psyRetainAll
- Throws:
PsyErrorException
-
psyContains
Returns aboolean
object indicating whether a givenobject
belongs to this set.- Parameters:
o
- anobject
.- Returns:
boolean
indicating whether an object belongs to this set.
-
psyClear
default void psyClear()Removes all the elements from this set.- Specified by:
psyClear
in interfacePsyClearable
-
psyAppendAll
default void psyAppendAll(PsyIterable<? extends T> oEnumeration) throws PsyLimitCheckException, PsyRangeCheckException Appends all theobject
s from a giveniterable
enumeration to this set. When a given enumeration is the same as this set, first clone the enumeration, and then appends all the elements from the clone.- Specified by:
psyAppendAll
in interfacePsyAppendable<T extends PsyObject>
- Parameters:
oEnumeration
- aniterable
enumeration.- Throws:
PsyLimitCheckException
- when TODO.PsyRangeCheckException
- when TODO.
-
psyIntersects
Returns aboolean
object indicating whether a givenformalset
set intersects with this set.- Parameters:
oSet
- aformalset
set.- Returns:
boolean
indicating whether a givenformalset
intersects with this set.
-
psyReplicate
default PsyFormalSet<T> psyReplicate(PsyInteger oCount) throws PsyLimitCheckException, PsyRangeCheckException, PsyUnsupportedException - Specified by:
psyReplicate
in interfacePsyAppendable<T extends PsyObject>
- Throws:
PsyLimitCheckException
PsyRangeCheckException
PsyUnsupportedException
-
toSyntaxString
Description copied from interface:PsyObject
Returns the syntactic representation of this object.- Specified by:
toSyntaxString
in interfacePsyObject
- Returns:
- the syntactic representation of this object.
-
toSyntaxStringHelper
-