Package coneforest.psylla.core
Class PsyBitArray
- java.lang.Object
-
- coneforest.psylla.core.PsyBitArray
-
- All Implemented Interfaces:
PsyAppendable<PsyBoolean>,PsyBitwise<PsyBitArray>,PsyClearable,PsyContainer<PsyBoolean>,PsyConvertableToName,PsyConvertableToString,PsyFormalArray<PsyBoolean>,PsyIndexed<PsyInteger,PsyBoolean>,PsyIterable<PsyBoolean>,PsyLengthy,PsyLogical<PsyBitArray>,PsyObject,PsySequential<PsyBoolean>,PsyStreamable<PsyBoolean>,Iterable<PsyBoolean>
public class PsyBitArray extends Object implements PsyFormalArray<PsyBoolean>, PsyBitwise<PsyBitArray>
A representation of Ψ-bitarrayobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
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 voiddelete(int index)PsyBooleanextract(int indexValue)PsyBooleanget(int index)voidinsert(int index, PsyBoolean oBoolean)Inserts the specified Ψ-objectinto this array at the position specified by a given index.Iterator<PsyBoolean>iterator()intlength()Returns a length of this object.PsyBitArraypsyAnd(PsyBitArray oBitArray)Returns a result of logical conjunction of this object and given object.voidpsyAppend(PsyBoolean oBoolean)Appends a given Ψ-objectto this container.PsyBitArraypsyBitShift(PsyInteger oShift)voidpsyClear()Clear this object.PsyBitArraypsyClearBit(PsyInteger oBit)PsyBitArraypsyClone()Returns a clone of this object.PsyBitArraypsyExtractInterval(PsyInteger oStart, PsyInteger oCount)PsyBitArraypsyFlipBit(PsyInteger oBit)PsyBitArraypsyGetInterval(PsyInteger oIndex, PsyInteger oCount)PsyBitArraypsyNot()Returns a result of logical negation of this object.PsyBitArraypsyOr(PsyBitArray oBitArray)Returns a result of logical disjunction of this object and given object.voidpsyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyBoolean> oIterable)PsyBitArraypsySetBit(PsyInteger oBit)voidpsySetLength(PsyInteger oLength)PsyBitArraypsySlice(PsyIterable<PsyInteger> oIndices)Returns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.PsyBooleanpsyTestBit(PsyInteger oBit)PsyBitArraypsyXor(PsyBitArray oBitArray)Returns a result of logical exclusive disjunction of this object and given object.voidput(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.PsyContainer
psyNewEmpty
-
Methods inherited from interface coneforest.psylla.core.PsyFormalArray
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.PsyIterable
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.PsyStreamable
psyForAll
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
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:
getin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
psyGetInterval
public PsyBitArray psyGetInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyException
- Specified by:
psyGetIntervalin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
put
public void put(int index, PsyBoolean oBoolean) throws PsyException- Specified by:
putin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyBoolean> oIterable) throws PsyException
- Specified by:
psyPutIntervalin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
psyAppend
public void psyAppend(PsyBoolean oBoolean)
Description copied from interface:PsyAppendableAppends a given Ψ-objectto this container.- Specified by:
psyAppendin interfacePsyAppendable<PsyBoolean>- Parameters:
oBoolean- a given Ψ-objectto append.
-
insert
public void insert(int index, PsyBoolean oBoolean)Description copied from interface:PsyFormalArrayInserts the specified Ψ-objectinto this array at the position specified by a given index.- Specified by:
insertin interfacePsyFormalArray<PsyBoolean>- Parameters:
index- a Ψ-integerindex.oBoolean- a Ψ-object.
-
delete
public void delete(int index) throws PsyException- Specified by:
deletein interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
extract
public PsyBoolean extract(int indexValue) throws PsyException
- Specified by:
extractin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
psyExtractInterval
public PsyBitArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyException
- Specified by:
psyExtractIntervalin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
psyNot
public PsyBitArray psyNot()
Description copied from interface:PsyLogicalReturns a result of logical negation of this object.- Specified by:
psyNotin interfacePsyLogical<PsyBitArray>- Returns:
- a result.
-
psyOr
public PsyBitArray psyOr(PsyBitArray oBitArray)
Description copied from interface:PsyLogicalReturns a result of logical disjunction of this object and given object.- Specified by:
psyOrin interfacePsyLogical<PsyBitArray>- Parameters:
oBitArray- given object.- Returns:
- a result.
-
psyAnd
public PsyBitArray psyAnd(PsyBitArray oBitArray)
Description copied from interface:PsyLogicalReturns a result of logical conjunction of this object and given object.- Specified by:
psyAndin interfacePsyLogical<PsyBitArray>- Parameters:
oBitArray- given object.- Returns:
- a result.
-
psyXor
public PsyBitArray psyXor(PsyBitArray oBitArray)
Description copied from interface:PsyLogicalReturns a result of logical exclusive disjunction of this object and given object.- Specified by:
psyXorin interfacePsyLogical<PsyBitArray>- Parameters:
oBitArray- given object.- Returns:
- a result.
-
psyBitShift
public PsyBitArray psyBitShift(PsyInteger oShift)
- Specified by:
psyBitShiftin interfacePsyBitwise<PsyBitArray>
-
psyTestBit
public PsyBoolean psyTestBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psyTestBitin interfacePsyBitwise<PsyBitArray>- Throws:
PsyRangeCheckException
-
psySetBit
public PsyBitArray psySetBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psySetBitin interfacePsyBitwise<PsyBitArray>- Throws:
PsyRangeCheckException
-
psyFlipBit
public PsyBitArray psyFlipBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psyFlipBitin interfacePsyBitwise<PsyBitArray>- Throws:
PsyRangeCheckException
-
psyClearBit
public PsyBitArray psyClearBit(PsyInteger oBit) throws PsyRangeCheckException
- Specified by:
psyClearBitin interfacePsyBitwise<PsyBitArray>- Throws:
PsyRangeCheckException
-
iterator
public Iterator<PsyBoolean> iterator()
- Specified by:
iteratorin interfaceIterable<PsyBoolean>
-
length
public int length()
Description copied from interface:PsyLengthyReturns a length of this object.- Specified by:
lengthin interfacePsyLengthy- Returns:
- a length.
-
psySlice
public PsyBitArray psySlice(PsyIterable<PsyInteger> oIndices) throws PsyException
Description copied from interface:PsyIndexedReturns a container of the same type as this object consisting of keys or indices from given Ψ-iterableand of associated values.- Specified by:
psySlicein interfacePsyFormalArray<PsyBoolean>- Specified by:
psySlicein 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:
psySetLengthin interfacePsyFormalArray<PsyBoolean>- Throws:
PsyException
-
psyClone
public PsyBitArray psyClone()
Description copied from interface:PsyObjectReturns a clone of this object.- Specified by:
psyClonein interfacePsyFormalArray<PsyBoolean>- Specified by:
psyClonein interfacePsyObject- Returns:
- a clone of this object.
-
psyClear
public void psyClear()
Description copied from interface:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable
-
-