Package coneforest.psylla.core
Class PsyBitArray
- java.lang.Object
-
- coneforest.psylla.core.PsyBitArray
-
- All Implemented Interfaces:
PsyAppendable<PsyBoolean>
,PsyArraylike<PsyBoolean>
,PsyBitwise<PsyBitArray>
,PsyClearable
,PsyContainer<PsyBoolean>
,PsyConvertableToName
,PsyConvertableToString
,PsyIndexed<PsyInteger,PsyBoolean>
,PsyIterable<PsyBoolean>
,PsyLengthy
,PsyLogical<PsyBitArray>
,PsyObject
,PsyStreamlike<PsyBoolean>
,Iterable<PsyBoolean>
public class PsyBitArray extends Object implements PsyArraylike<PsyBoolean>, PsyBitwise<PsyBitArray>
A representation of Ψ-bitarray
object.
-
-
Constructor Summary
Constructors Constructor Description PsyBitArray()
Creates a new empty Ψ-bitarray
.PsyBitArray(BitSet bitarray, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(int index)
PsyBoolean
extract(int indexValue)
PsyBoolean
get(int index)
void
insert(int index, PsyBoolean oBoolean)
Inserts the specified Ψ-object
into this array at the position specified by a given index.Iterator<PsyBoolean>
iterator()
int
length()
Returns a length of this object.PsyBitArray
psyAnd(PsyBitArray oBitArray)
Returns a result of logical conjunction of this object and given object.void
psyAppend(PsyBoolean oBoolean)
Appends a given Ψ-object
to this container.PsyBitArray
psyBitShift(PsyInteger oShift)
void
psyClear()
Clear this object.PsyBitArray
psyClearBit(PsyInteger oBit)
PsyBitArray
psyClone()
Returns a clone of this object.PsyBitArray
psyExtractInterval(PsyInteger oStart, PsyInteger oCount)
PsyBitArray
psyFlipBit(PsyInteger oBit)
PsyBitArray
psyGetInterval(PsyInteger oIndex, PsyInteger oCount)
PsyBitArray
psyNot()
Returns a result of logical negation of this object.PsyBitArray
psyOr(PsyBitArray oBitArray)
Returns a result of logical disjunction of this object and given object.void
psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyBoolean> oIterable)
PsyBitArray
psySetBit(PsyInteger oBit)
void
psySetLength(PsyInteger oLength)
PsyBitArray
psySlice(PsyIterable<PsyInteger> oIndices)
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.PsyBoolean
psyTestBit(PsyInteger oBit)
PsyBitArray
psyXor(PsyBitArray oBitArray)
Returns a result of logical exclusive disjunction of this object and given object.void
put(int index, PsyBoolean oBoolean)
-
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.PsyAppendable
psyAppendAll
-
Methods inherited from interface coneforest.psylla.core.PsyArraylike
psyCount, psyDelete, psyEntries, psyExtract, psyGet, psyGetAll, psyInsert, psyInsertAll, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyReplicate, psyReverse, psyValues, toSyntaxString, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyFilter, psyForAll, psyMap, psyStream, psyToArray, psyUnite
-
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLength
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
Methods inherited from interface coneforest.psylla.core.PsyStreamlike
psyConcat
-
-
-
-
Constructor Detail
-
PsyBitArray
public PsyBitArray()
Creates a new empty Ψ-bitarray
.
-
PsyBitArray
public PsyBitArray(BitSet bitarray, int size)
-
-
Method Detail
-
get
public PsyBoolean get(int index) throws PsyException
- Specified by:
get
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
psyGetInterval
public PsyBitArray psyGetInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyException
- Specified by:
psyGetInterval
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
put
public void put(int index, PsyBoolean oBoolean) throws PsyException
- Specified by:
put
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyBoolean> oIterable) throws PsyException
- Specified by:
psyPutInterval
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
psyAppend
public void psyAppend(PsyBoolean oBoolean)
Description copied from interface:PsyAppendable
Appends a given Ψ-object
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyBoolean>
- Parameters:
oBoolean
- a given Ψ-object
to append.
-
insert
public void insert(int index, PsyBoolean oBoolean)
Description copied from interface:PsyArraylike
Inserts the specified Ψ-object
into this array at the position specified by a given index.- Specified by:
insert
in interfacePsyArraylike<PsyBoolean>
- Parameters:
index
- a Ψ-integer
index.oBoolean
- a Ψ-object
.
-
delete
public void delete(int index) throws PsyException
- Specified by:
delete
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
extract
public PsyBoolean extract(int indexValue) throws PsyException
- Specified by:
extract
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
psyExtractInterval
public PsyBitArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyException
- Specified by:
psyExtractInterval
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
psyNot
public PsyBitArray psyNot()
Description copied from interface:PsyLogical
Returns a result of logical negation of this object.- Specified by:
psyNot
in interfacePsyLogical<PsyBitArray>
- Returns:
- a result.
-
psyOr
public PsyBitArray psyOr(PsyBitArray oBitArray)
Description copied from interface:PsyLogical
Returns a result of logical disjunction of this object and given object.- Specified by:
psyOr
in interfacePsyLogical<PsyBitArray>
- Parameters:
oBitArray
- given object.- Returns:
- a result.
-
psyAnd
public PsyBitArray psyAnd(PsyBitArray oBitArray)
Description copied from interface:PsyLogical
Returns a result of logical conjunction of this object and given object.- Specified by:
psyAnd
in interfacePsyLogical<PsyBitArray>
- Parameters:
oBitArray
- given object.- Returns:
- a result.
-
psyXor
public PsyBitArray psyXor(PsyBitArray oBitArray)
Description copied from interface:PsyLogical
Returns a result of logical exclusive disjunction of this object and given object.- Specified by:
psyXor
in interfacePsyLogical<PsyBitArray>
- Parameters:
oBitArray
- given object.- Returns:
- a result.
-
psyBitShift
public PsyBitArray psyBitShift(PsyInteger oShift)
- Specified by:
psyBitShift
in interfacePsyBitwise<PsyBitArray>
-
psyTestBit
public PsyBoolean psyTestBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psyTestBit
in interfacePsyBitwise<PsyBitArray>
- Throws:
PsyRangeCheckException
-
psySetBit
public PsyBitArray psySetBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psySetBit
in interfacePsyBitwise<PsyBitArray>
- Throws:
PsyRangeCheckException
-
psyFlipBit
public PsyBitArray psyFlipBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psyFlipBit
in interfacePsyBitwise<PsyBitArray>
- Throws:
PsyRangeCheckException
-
psyClearBit
public PsyBitArray psyClearBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psyClearBit
in interfacePsyBitwise<PsyBitArray>
- Throws:
PsyRangeCheckException
-
iterator
public Iterator<PsyBoolean> iterator()
- Specified by:
iterator
in interfaceIterable<PsyBoolean>
- Specified by:
iterator
in interfacePsyStreamlike<PsyBoolean>
-
length
public int length()
Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Returns:
- a length.
-
psySlice
public PsyBitArray psySlice(PsyIterable<PsyInteger> oIndices) throws PsyException
Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterable
and of associated values.- Specified by:
psySlice
in interfacePsyArraylike<PsyBoolean>
- Specified by:
psySlice
in interfacePsyIndexed<PsyInteger,PsyBoolean>
- Parameters:
oIndices
- an enumeration of keys.- Returns:
- a container.
- Throws:
PsyException
- when key is absent or index is out of range.
-
psySetLength
public void psySetLength(PsyInteger oLength) throws PsyException
- Specified by:
psySetLength
in interfacePsyArraylike<PsyBoolean>
- Throws:
PsyException
-
psyClone
public PsyBitArray psyClone()
Description copied from interface:PsyObject
Returns a clone of this object.- Specified by:
psyClone
in interfacePsyArraylike<PsyBoolean>
- Specified by:
psyClone
in interfacePsyObject
- Returns:
- a clone of this object.
-
psyClear
public void psyClear()
Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
-