- 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 objects.
This interface declares methods for appending, removal and set operations.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextActionContext action of thecontainsoperator.static final ContextActionContext action of theintersectsoperator.static final ContextActionContext action of theremoveoperator.static final ContextActionContext action of theremovealloperator.static final ContextActionContext action of theretainalloperator.Fields inherited from interface coneforest.psylla.core.PsyAppendable
PSY_APPEND, PSY_APPENDALLFields inherited from interface coneforest.psylla.core.PsyClearable
PSY_CLEARFields inherited from interface coneforest.psylla.core.PsyLengthy
PSY_ISEMPTY, PSY_LENGTHFields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPEFields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALLFields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM -
Method Summary
Modifier and TypeMethodDescriptiondefault voidpsyAppendAll(PsyIterable<? extends T> oEnumeration) Appends all theobjects from a giveniterableenumeration to this set.default voidpsyClear()Removes all the elements from this set.psyContains(T o) Returns abooleanobject indicating whether a givenobjectbelongs to this set.default PsyBooleanpsyIntersects(PsyFormalSet<? extends T> oSet) Returns abooleanobject indicating whether a givenformalsetset intersects with this set.voidRemoves anobjectfrom this set.default voidpsyRemoveAll(PsyIterable<? extends T> oEnumeration) Removes all theobjects in a giveniterableenumeration from this set.default PsyFormalSet<T>psyReplicate(PsyInteger oCount) default voidpsyRetainAll(PsyIterable<? extends T> oEnumeration) default StringReturns the syntactic representation of this object.default StringtoSyntaxStringHelper(PsyLengthy oLengthy) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface coneforest.psylla.core.PsyAppendable
psyAppendMethods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty, toSyntaxStringHelperMethods inherited from interface coneforest.psylla.core.PsyIterable
psyStream, psyToArray, psyUniteMethods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, length, psyIsEmpty, psyLengthMethods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeNameMethods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
Field Details
-
PSY_CONTAINS
Context action of thecontainsoperator. -
PSY_INTERSECTS
Context action of theintersectsoperator. -
PSY_REMOVE
Context action of theremoveoperator. -
PSY_REMOVEALL
Context action of theremovealloperator. -
PSY_RETAINALL
Context action of theretainalloperator.
-
-
Method Details
-
psyRemove
Removes anobjectfrom this set. If a given object is not present in this set, error does not occur.- Parameters:
o- anobject.
-
psyRemoveAll
Removes all theobjects in a giveniterableenumeration from this set. If some object is not present in this set, error does not occur.- Parameters:
oEnumeration- aniterableenumeration.
-
psyRetainAll
- Throws:
PsyErrorException
-
psyContains
Returns abooleanobject indicating whether a givenobjectbelongs to this set.- Parameters:
o- anobject.- Returns:
booleanindicating whether an object belongs to this set.
-
psyClear
default void psyClear()Removes all the elements from this set.- Specified by:
psyClearin interfacePsyClearable
-
psyAppendAll
default void psyAppendAll(PsyIterable<? extends T> oEnumeration) throws PsyLimitCheckException, PsyRangeCheckException Appends all theobjects from a giveniterableenumeration 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:
psyAppendAllin interfacePsyAppendable<T extends PsyObject>- Parameters:
oEnumeration- aniterableenumeration.- Throws:
PsyLimitCheckException- when TODO.PsyRangeCheckException- when TODO.
-
psyIntersects
Returns abooleanobject indicating whether a givenformalsetset intersects with this set.- Parameters:
oSet- aformalsetset.- Returns:
booleanindicating whether a givenformalsetintersects with this set.
-
psyReplicate
default PsyFormalSet<T> psyReplicate(PsyInteger oCount) throws PsyLimitCheckException, PsyRangeCheckException, PsyUnsupportedException - Specified by:
psyReplicatein interfacePsyAppendable<T extends PsyObject>- Throws:
PsyLimitCheckExceptionPsyRangeCheckExceptionPsyUnsupportedException
-
toSyntaxString
Description copied from interface:PsyObjectReturns the syntactic representation of this object.- Specified by:
toSyntaxStringin interfacePsyObject- Returns:
- the syntactic representation of this object.
-
toSyntaxStringHelper
-