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 ofbitset, a set of nonnegativeintegerobjects.
-
-
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 givenobjectto this container.voidpsyAppendAll(PsyIterable<? extends PsyInteger> oIterable)Appends all theobjects from a giveniterableenumeration to this set.voidpsyClear()Removes all the elements from this set.PsyBitSetpsyClone()Returns a clone of this object.PsyBooleanpsyContains(PsyInteger oElement)Returns abooleanobject indicating whether a givenobjectbelongs to this set.PsyBooleanpsyEq(PsyObject o)PsyBooleanpsyIntersects(PsyFormalSet oSet)Returns abooleanobject indicating whether a givenformalsetset intersects with this set.voidpsyRemove(PsyInteger oIndex)Removes anobjectfrom this set.voidpsyRemoveAll(PsyIterable<? extends PsyInteger> oIterable)Removes all theobjects in a giveniterableenumeration 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 givenobjectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyInteger>- Parameters:
oIndex- anobjectto append.- Throws:
PsyLimitCheckExceptionPsyRangeCheckException
-
psyAppendAll
public void psyAppendAll(PsyIterable<? extends PsyInteger> oIterable) throws PsyErrorException
Description copied from interface:PsyFormalSetAppends 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<PsyInteger>- Specified by:
psyAppendAllin interfacePsyFormalSet<PsyInteger>- Parameters:
oIterable- aniterableenumeration.- Throws:
PsyErrorException- when an error occurs.
-
psyRemove
public void psyRemove(PsyInteger oIndex)
Description copied from interface:PsyFormalSetRemoves anobjectfrom this set. If a given object is not present in this set, error does not occur.- Specified by:
psyRemovein interfacePsyFormalSet<PsyInteger>- Parameters:
oIndex- anobject.
-
psyRemoveAll
public void psyRemoveAll(PsyIterable<? extends PsyInteger> oIterable)
Description copied from interface:PsyFormalSetRemoves all theobjects in a giveniterableenumeration from this set. If some object is not present in this set, error does not occur.- Specified by:
psyRemoveAllin interfacePsyFormalSet<PsyInteger>- Parameters:
oIterable- aniterableenumeration.
-
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 abooleanobject indicating whether a givenobjectbelongs to this set.- Specified by:
psyContainsin interfacePsyFormalSet<PsyInteger>- Parameters:
oElement- anobject.- Returns:
PsyBoolean.TRUE, if an object belongs to this set, andPsyBoolean.FALSEotherwise.
-
psyIntersects
public PsyBoolean psyIntersects(PsyFormalSet oSet)
Description copied from interface:PsyFormalSetReturns abooleanobject indicating whether a givenformalsetset intersects with this set.- Specified by:
psyIntersectsin interfacePsyFormalSet<PsyInteger>- Parameters:
oSet- aformalsetset.- Returns:
PsyBoolean.TRUE, if a givenformalsetset 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>
-
-