Package coneforest.psylla.core
Class PsyBitSet
- java.lang.Object
-
- coneforest.psylla.core.PsyBitSet
-
- All Implemented Interfaces:
PsyAppendable<PsyInteger>,PsyClearable,PsyContainer<PsyInteger>,PsyConvertableToName,PsyConvertableToString,PsyFormalSet<PsyInteger>,PsyIterable<PsyInteger>,PsyLengthy,PsyObject,PsySequential<PsyInteger>,PsyStreamable<PsyInteger>,Iterable<PsyInteger>
public class PsyBitSet extends Object implements PsyFormalSet<PsyInteger>
A representation of Ψ-bitset, a set of nonnegative Ψ-integerobjects.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitSetgetBitSet()Iterator<PsyInteger>iterator()intlength()Returns a length of this object.voidpsyAppend(PsyInteger oIndex)Appends a given Ψ-objectto this container.voidpsyAppendAll(PsyIterable<? extends PsyInteger> oIterable)Appends all the Ψ-objects from a given Ψ-iterableenumeration to this set.voidpsyClear()Removes all the elements from this set.PsyBitSetpsyClone()Returns a clone of this object.PsyBooleanpsyContains(PsyInteger oElement)Returns a Ψ-booleanobject indicating whether a given Ψ-objectbelongs to this set.PsyBooleanpsyEq(PsyObject o)PsyBooleanpsyIntersects(PsyFormalSet oSet)Returns a Ψ-booleanobject indicating whether a given Ψ-formalsetset intersects with this set.voidpsyRemove(PsyInteger oIndex)Removes a Ψ-objectfrom this set.voidpsyRemoveAll(PsyIterable<? extends PsyInteger> oIterable)Removes all the Ψ-objects in a given Ψ-iterableenumeration from this set.PsyStreampsyStream()StringtoSyntaxString()-
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, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyFormalSet
psyReplicate, psyRetainAll, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyToArray, psyUnite
-
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLength
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
Methods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Method Detail
-
psyClone
public PsyBitSet psyClone()
Description copied from interface:PsyObjectReturns a clone of this object.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxStringin interfacePsyFormalSet<PsyInteger>- Specified by:
toSyntaxStringin interfacePsyObject
-
getBitSet
public BitSet getBitSet()
-
psyAppend
public void psyAppend(PsyInteger oIndex) throws PsyLimitCheckException, PsyRangeCheckException
Description copied from interface:PsyAppendableAppends a given Ψ-objectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyInteger>- Parameters:
oIndex- a given Ψ-objectto append.- Throws:
PsyLimitCheckExceptionPsyRangeCheckException
-
psyAppendAll
public void psyAppendAll(PsyIterable<? extends PsyInteger> oIterable) throws PsyException
Description copied from interface:PsyFormalSetAppends all the Ψ-objects from a given Ψ-iterableenumeration 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<PsyInteger>- Specified by:
psyAppendAllin interfacePsyFormalSet<PsyInteger>- Parameters:
oIterable- a Ψ-iterableenumeration.- Throws:
PsyException- when an error occurs.
-
psyRemove
public void psyRemove(PsyInteger oIndex)
Description copied from interface:PsyFormalSetRemoves a Ψ-objectfrom this set. If a given object is not present in this set, error does not occur.- Specified by:
psyRemovein interfacePsyFormalSet<PsyInteger>- Parameters:
oIndex- a given Ψ-object.
-
psyRemoveAll
public void psyRemoveAll(PsyIterable<? extends PsyInteger> oIterable)
Description copied from interface:PsyFormalSetRemoves all the Ψ-objects in a given Ψ-iterableenumeration from this set. If some object is not present in this set, error does not occur.- Specified by:
psyRemoveAllin interfacePsyFormalSet<PsyInteger>- Parameters:
oIterable- a given Ψ-iterableenumeration.
-
iterator
public Iterator<PsyInteger> iterator()
- Specified by:
iteratorin interfaceIterable<PsyInteger>
-
psyClear
public void psyClear()
Description copied from interface:PsyFormalSetRemoves all the elements from this set.- Specified by:
psyClearin interfacePsyClearable- Specified by:
psyClearin interfacePsyFormalSet<PsyInteger>
-
length
public int length()
Description copied from interface:PsyLengthyReturns a length of this object.- Specified by:
lengthin interfacePsyLengthy- Returns:
- a length.
-
psyContains
public PsyBoolean psyContains(PsyInteger oElement)
Description copied from interface:PsyFormalSetReturns a Ψ-booleanobject indicating whether a given Ψ-objectbelongs to this set.- Specified by:
psyContainsin interfacePsyFormalSet<PsyInteger>- Parameters:
oElement- a given Ψ-object.- Returns:
PsyBoolean.TRUE, if an object belongs to this set, andPsyBoolean.FALSEotherwise.
-
psyIntersects
public PsyBoolean psyIntersects(PsyFormalSet oSet)
Description copied from interface:PsyFormalSetReturns a Ψ-booleanobject indicating whether a given Ψ-formalsetset intersects with this set.- Specified by:
psyIntersectsin interfacePsyFormalSet<PsyInteger>- Parameters:
oSet- a given Ψ-formalsetset.- Returns:
PsyBoolean.TRUE, if a given Ψ-formalsetset intersects with this set, andPsyBoolean.FALSEotherwise.
-
psyEq
public PsyBoolean psyEq(PsyObject o)
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStreamin interfacePsyIterable<PsyInteger>- Specified by:
psyStreamin interfacePsyStreamable<PsyInteger>
-
-