Package coneforest.psylla.core
Class PsyBitSet
- java.lang.Object
-
- coneforest.psylla.core.PsyBitSet
-
- All Implemented Interfaces:
PsyAppendable<PsyInteger>
,PsyClearable
,PsyContainer<PsyInteger>
,PsyConvertableToName
,PsyConvertableToString
,PsyIterable<PsyInteger>
,PsyLengthy
,PsyObject
,PsySetlike<PsyInteger>
,PsyStreamlike<PsyInteger>
,Iterable<PsyInteger>
public class PsyBitSet extends Object implements PsySetlike<PsyInteger>
A representation of Ψ-bitset
, a set of nonnegative Ψ-integer
objects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitSet
getBitSet()
Iterator<PsyInteger>
iterator()
int
length()
Returns a length of this object.void
psyAppend(PsyInteger oIndex)
Appends a given Ψ-object
to this container.void
psyAppendAll(PsyIterable<? extends PsyInteger> oIterable)
Appends all the Ψ-object
s from a given Ψ-iterable
enumeration to this set.void
psyClear()
Removes all the elements from this set.PsyBitSet
psyClone()
Returns a clone of this object.PsyBoolean
psyContains(PsyInteger oElement)
Returns a Ψ-boolean
object indicating whether a given Ψ-object
belongs to this set.PsyBoolean
psyEq(PsyObject o)
PsyBoolean
psyIntersects(PsySetlike oSet)
Returns a Ψ-boolean
object indicating whether a given Ψ-setlike
set intersects with this set.void
psyRemove(PsyInteger oIndex)
Removes a Ψ-object
from this set.void
psyRemoveAll(PsyIterable<? extends PsyInteger> oIterable)
Removes all the Ψ-object
s in a given Ψ-iterable
enumeration from this set.PsyStream
psyStream()
String
toSyntaxString()
-
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.PsyIterable
psyCount, psyFilter, psyForAll, psyMap, 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.PsySetlike
psyReplicate, psyRetainAll, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyStreamlike
psyConcat
-
-
-
-
Method Detail
-
psyClone
public PsyBitSet psyClone()
Description copied from interface:PsyObject
Returns a clone of this object.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyObject
- Specified by:
toSyntaxString
in interfacePsySetlike<PsyInteger>
-
getBitSet
public BitSet getBitSet()
-
psyAppend
public void psyAppend(PsyInteger oIndex) throws PsyLimitCheckException, PsyRangeCheckException
Description copied from interface:PsyAppendable
Appends a given Ψ-object
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyInteger>
- Parameters:
oIndex
- a given Ψ-object
to append.- Throws:
PsyLimitCheckException
PsyRangeCheckException
-
psyAppendAll
public void psyAppendAll(PsyIterable<? extends PsyInteger> oIterable) throws PsyException
Description copied from interface:PsySetlike
Appends all the Ψ-object
s from a given Ψ-iterable
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<PsyInteger>
- Specified by:
psyAppendAll
in interfacePsySetlike<PsyInteger>
- Parameters:
oIterable
- a Ψ-iterable
enumeration.- Throws:
PsyException
- when an error occurs.
-
psyRemove
public void psyRemove(PsyInteger oIndex)
Description copied from interface:PsySetlike
Removes a Ψ-object
from this set. If a given object is not present in this set, error does not occur.- Specified by:
psyRemove
in interfacePsySetlike<PsyInteger>
- Parameters:
oIndex
- a given Ψ-object
.
-
psyRemoveAll
public void psyRemoveAll(PsyIterable<? extends PsyInteger> oIterable)
Description copied from interface:PsySetlike
Removes all the Ψ-object
s in a given Ψ-iterable
enumeration from this set. If some object is not present in this set, error does not occur.- Specified by:
psyRemoveAll
in interfacePsySetlike<PsyInteger>
- Parameters:
oIterable
- a given Ψ-iterable
enumeration.
-
iterator
public Iterator<PsyInteger> iterator()
- Specified by:
iterator
in interfaceIterable<PsyInteger>
- Specified by:
iterator
in interfacePsyStreamlike<PsyInteger>
-
psyClear
public void psyClear()
Description copied from interface:PsySetlike
Removes all the elements from this set.- Specified by:
psyClear
in interfacePsyClearable
- Specified by:
psyClear
in interfacePsySetlike<PsyInteger>
-
length
public int length()
Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Returns:
- a length.
-
psyContains
public PsyBoolean psyContains(PsyInteger oElement)
Description copied from interface:PsySetlike
Returns a Ψ-boolean
object indicating whether a given Ψ-object
belongs to this set.- Specified by:
psyContains
in interfacePsySetlike<PsyInteger>
- Parameters:
oElement
- a given Ψ-object
.- Returns:
PsyBoolean.TRUE
, if an object belongs to this set, andPsyBoolean.FALSE
otherwise.
-
psyIntersects
public PsyBoolean psyIntersects(PsySetlike oSet)
Description copied from interface:PsySetlike
Returns a Ψ-boolean
object indicating whether a given Ψ-setlike
set intersects with this set.- Specified by:
psyIntersects
in interfacePsySetlike<PsyInteger>
- Parameters:
oSet
- a given Ψ-setlike
set.- Returns:
PsyBoolean.TRUE
, if a given Ψ-setlike
set intersects with this set, andPsyBoolean.FALSE
otherwise.
-
psyEq
public PsyBoolean psyEq(PsyObject o)
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStream
in interfacePsyIterable<PsyInteger>
-
-