java.lang.Object
coneforest.psylla.core.PsyBitArray
- All Implemented Interfaces:
PsyAppendable<PsyBoolean>
,PsyBitwise<PsyBitArray>
,PsyClearable
,PsyContainer<PsyBoolean>
,PsyFormalArray<PsyBoolean>
,PsyIndexed<PsyInteger,
,PsyBoolean> PsyIterable<PsyBoolean>
,PsyLengthy
,PsyLogical<PsyBitArray>
,PsyObject
,PsySequential<PsyBoolean>
,PsyStreamable<PsyBoolean>
,Iterable<PsyBoolean>
@Type("bitarray")
public class PsyBitArray
extends Object
implements PsyFormalArray<PsyBoolean>, PsyBitwise<PsyBitArray>
The representation of
bitarray
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thebitarray
operator.Fields inherited from interface coneforest.psylla.core.PsyAppendable
PSY_APPEND, PSY_APPENDALL, PSY_REPLICATE
Fields inherited from interface coneforest.psylla.core.PsyBitwise
PSY_BITSHIFT, PSY_CLEARBIT, PSY_FLIPBIT, PSY_SETBIT, PSY_TESTBIT
Fields inherited from interface coneforest.psylla.core.PsyClearable
PSY_CLEAR
Fields inherited from interface coneforest.psylla.core.PsyFormalArray
PSY_EXTRACTINTERVAL, PSY_GETINTERVAL, PSY_INSERT, PSY_INSERTALL, PSY_POSTCHOP, PSY_PRECHOP, PSY_PREPEND, PSY_PREPENDALL, PSY_PUTINTERVAL, PSY_REVERSE, PSY_SETLENGTH
Fields inherited from interface coneforest.psylla.core.PsyIndexed
PSY_DELETE, PSY_ENTRIES, PSY_EXTRACT, PSY_GET, PSY_GETALL, PSY_KEYS, PSY_KNOWN, PSY_PUT, PSY_SLICE, PSY_VALUES
Fields inherited from interface coneforest.psylla.core.PsyLengthy
PSY_ISEMPTY, PSY_LENGTH
Fields inherited from interface coneforest.psylla.core.PsyLogical
PSY_AND, PSY_NOT, PSY_OR, PSY_XOR
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TOSTRING, PSY_TOSTRINGBUFFER, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALL
Fields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int index) Removes the element at the specified position in this array.extract
(int indexValue) get
(int index) Returns the element at the specified position in this array.void
insert
(int index, PsyBoolean oBoolean) Inserts the specifiedobject
into this array at the position specified by a given index.iterator()
int
length()
Returns a length of this object.psyAnd
(PsyBitArray oBitArray) Returns a result of logical conjunction of this object and given object.void
psyAppend
(PsyBoolean oBoolean) Appends a givenobject
to this container.psyBitShift
(PsyInteger oShift) Returns abitwise
whose value is equivalent to this value with bits shifted at the given distance.void
psyClear()
Clear this object.psyClearBit
(PsyInteger oBit) Returns abitwise
whose value is equivalent to this value with the designated bit cleared.psyClone()
Returns a clone of this object.psyExtractInterval
(PsyInteger oStart, PsyInteger oCount) psyFlipBit
(PsyInteger oBit) Returns abitwise
whose value is equivalent to this value with the designated bit flipped.psyGetInterval
(PsyInteger oIndex, PsyInteger oCount) psyNot()
Returns a result of logical negation of this object.psyOr
(PsyBitArray oBitArray) Returns a result of logical disjunction of this object and given object.void
psyPutInterval
(PsyInteger oIndex, PsyIterable<? extends PsyBoolean> oIterable) psySetBit
(PsyInteger oBit) Returns abitwise
whose value is equivalent to this value with the designated bit set.void
psySetLength
(PsyInteger oLength) psySlice
(PsyIterable<PsyInteger> oIndices) Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.psyTestBit
(PsyInteger oBit) Returns aboolean
indicating if the designated bit is set.psyXor
(PsyBitArray oBitArray) Returns a result of logical exclusive disjunction of this object and given object.void
put
(int index, PsyBoolean oBoolean) Returns the syntactic representation of this object.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, psyInsert, psyInsertAll, psyKeys, psyKnown, psyPostChop, psyPreChop, psyPrepend, psyPrependAll, psyPut, psyReplicate, psyReverse, psyValues, toSyntaxStringHelper
Methods inherited from interface coneforest.psylla.core.PsyIndexed
psyGetAll
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, psyToString, psyToStringBuffer, psyType, typeName
Methods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
Field Details
-
PSY_BITARRAY
Context action of thebitarray
operator.
-
-
Constructor Details
-
PsyBitArray
public PsyBitArray()Creates a new emptybitarray
. -
PsyBitArray
-
-
Method Details
-
get
Description copied from interface:PsyFormalArray
Returns the element at the specified position in this array.- Specified by:
get
in interfacePsyFormalArray<PsyBoolean>
- Parameters:
index
- the index of the element.- Returns:
- the element at the specified position in this list.
- Throws:
PsyRangeCheckException
- if the index is out of range.
-
psyGetInterval
public PsyBitArray psyGetInterval(PsyInteger oIndex, PsyInteger oCount) throws PsyRangeCheckException - Specified by:
psyGetInterval
in interfacePsyFormalArray<PsyBoolean>
- Throws:
PsyRangeCheckException
-
put
- Specified by:
put
in interfacePsyFormalArray<PsyBoolean>
- Throws:
PsyRangeCheckException
-
psyPutInterval
public void psyPutInterval(PsyInteger oIndex, PsyIterable<? extends PsyBoolean> oIterable) throws PsyRangeCheckException - Specified by:
psyPutInterval
in interfacePsyFormalArray<PsyBoolean>
- Throws:
PsyRangeCheckException
-
psyAppend
Description copied from interface:PsyAppendable
Appends a givenobject
to this container.- Specified by:
psyAppend
in interfacePsyAppendable<PsyBoolean>
- Parameters:
oBoolean
- anobject
to append.- Throws:
PsyLimitCheckException
- when TODO.PsyRangeCheckException
- when TODO.
-
insert
Description copied from interface:PsyFormalArray
Inserts the specifiedobject
into this array at the position specified by a given index.- Specified by:
insert
in interfacePsyFormalArray<PsyBoolean>
- Parameters:
index
- ainteger
index.oBoolean
- aobject
.
-
delete
Description copied from interface:PsyFormalArray
Removes the element at the specified position in this array.- Specified by:
delete
in interfacePsyFormalArray<PsyBoolean>
- Parameters:
index
- the index of the element to be removed.- Throws:
PsyRangeCheckException
- if the index is out of range.
-
extract
- Specified by:
extract
in interfacePsyFormalArray<PsyBoolean>
- Throws:
PsyRangeCheckException
-
psyExtractInterval
public PsyBitArray psyExtractInterval(PsyInteger oStart, PsyInteger oCount) throws PsyRangeCheckException - Specified by:
psyExtractInterval
in interfacePsyFormalArray<PsyBoolean>
- Throws:
PsyRangeCheckException
-
psyNot
Description copied from interface:PsyLogical
Returns a result of logical negation of this object.- Specified by:
psyNot
in interfacePsyLogical<PsyBitArray>
- Returns:
- a result of logical negation of this object
-
psyOr
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 of logical disjunction of this object and given object
-
psyAnd
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 of logical conjunction of this object and given object
-
psyXor
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 of logical exclusive disjunction of this object and given object
-
psyBitShift
Description copied from interface:PsyBitwise
Returns abitwise
whose value is equivalent to this value with bits shifted at the given distance. If the distance is negative, the left shift is preformed. If the distance is positive, the right shift is preformed. If the distance is zero, returns this.- Specified by:
psyBitShift
in interfacePsyBitwise<PsyBitArray>
- Parameters:
oShift
- the shift distance.- Returns:
- a
bitwise
whose value is equivalent to this value with bits shifted at the given distance
-
psyTestBit
Description copied from interface:PsyBitwise
Returns aboolean
indicating if the designated bit is set.- Specified by:
psyTestBit
in interfacePsyBitwise<PsyBitArray>
- Parameters:
oBit
- the index of bit to test.- Returns:
- a
boolean
indicating if the designated bit is set - Throws:
PsyRangeCheckException
- if the index is out of range.
-
psySetBit
Description copied from interface:PsyBitwise
Returns abitwise
whose value is equivalent to this value with the designated bit set.- Specified by:
psySetBit
in interfacePsyBitwise<PsyBitArray>
- Parameters:
oBit
- the index of bit to set.- Returns:
- a
bitwise
whose value is equivalent to this value with the designated bit set - Throws:
PsyRangeCheckException
- if the index is out of range.
-
psyFlipBit
Description copied from interface:PsyBitwise
Returns abitwise
whose value is equivalent to this value with the designated bit flipped.- Specified by:
psyFlipBit
in interfacePsyBitwise<PsyBitArray>
- Parameters:
oBit
- the index of bit to flip.- Returns:
- a
bitwise
whose value is equivalent to this value with the designated bit flipped - Throws:
PsyRangeCheckException
- if the index is out of range.
-
psyClearBit
Description copied from interface:PsyBitwise
Returns abitwise
whose value is equivalent to this value with the designated bit cleared.- Specified by:
psyClearBit
in interfacePsyBitwise<PsyBitArray>
- Parameters:
oBit
- the index of bit to clear.- Returns:
- a
bitwise
whose value is equivalent to this value with the designated bit cleared - Throws:
PsyRangeCheckException
- if the index is out of range.
-
iterator
- Specified by:
iterator
in interfaceIterable<PsyBoolean>
-
length
public int length()Description copied from interface:PsyLengthy
Returns a length of this object.- Specified by:
length
in interfacePsyLengthy
- Returns:
- a length of this object
-
psySlice
public PsyBitArray psySlice(PsyIterable<PsyInteger> oIndices) throws PsyRangeCheckException, PsyLimitCheckException Description copied from interface:PsyIndexed
Returns a container of the same type as this object consisting of keys or indices from giveniterable
and of associated values.- Specified by:
psySlice
in interfacePsyFormalArray<PsyBoolean>
- Specified by:
psySlice
in interfacePsyIndexed<PsyInteger,
PsyBoolean> - Parameters:
oIndices
- an enumeration of keys.- Returns:
- a container of the same type as this object consisting of keys or indices from given
iterable
and of associated values - Throws:
PsyRangeCheckException
- when the index is out of range.PsyLimitCheckException
- when TODO
-
psySetLength
- Specified by:
psySetLength
in interfacePsyFormalArray<PsyBoolean>
- Throws:
PsyLimitCheckException
PsyRangeCheckException
-
psyClone
Description copied from interface:PsyObject
Returns a clone of this object.- Specified by:
psyClone
in interfacePsyFormalArray<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
-
toSyntaxString
Description copied from interface:PsyObject
Returns the syntactic representation of this object.- Specified by:
toSyntaxString
in interfacePsyFormalArray<PsyBoolean>
- Specified by:
toSyntaxString
in interfacePsyObject
- Returns:
- the syntactic representation of this object
-