Class BooleanBigList.BooleanBlock
- java.lang.Object
-
- org.magicwerk.brownies.collections.primitive.IBooleanList
-
- org.magicwerk.brownies.collections.primitive.BooleanGapList
-
- org.magicwerk.brownies.collections.primitive.BooleanBigList.BooleanBlock
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,IBooleanListable
- Enclosing class:
- BooleanBigList
static class BooleanBigList.BooleanBlock extends BooleanGapList
A block stores in maximum blockSize number of elements. The first block in a BooleanBigList will grow until reaches this limit, all other blocks are directly allocated with a capacity of blockSize. A block maintains a reference count which allows a block to be shared among different BooleanBigList instances with a copy-on-write approach.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.magicwerk.brownies.collections.primitive.BooleanGapList
BooleanGapList.ReadOnlyList
-
Nested classes/interfaces inherited from class org.magicwerk.brownies.collections.primitive.IBooleanList
IBooleanList.IBooleanListableFromArray, IBooleanList.IBooleanListableFromCollection, IBooleanList.IBooleanListableFromList, IBooleanList.IBooleanListableFromMult
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicInteger
refCount
-
Fields inherited from class org.magicwerk.brownies.collections.primitive.BooleanGapList
DEFAULT_CAPACITY
-
-
Constructor Summary
Constructors Constructor Description BooleanBlock()
BooleanBlock(int capacity)
BooleanBlock(BooleanBigList.BooleanBlock that)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isShared()
BooleanBigList.BooleanBlock
ref()
Increment reference count as block is used by one BooleanBigList instance more.void
unref()
Decrement reference count as block is no longer used by one BooleanBigList instance.-
Methods inherited from class org.magicwerk.brownies.collections.primitive.BooleanGapList
add, add, binarySearch, calculateNewCapacity, capacity, clone, copy, create, create, create, crop, doAdd, doAssign, doClear, doClone, doCreate, doEnsureCapacity, doGet, doGetAll, doRemove, doRemoveAll, doRemoveAllFast, doReSet, doSet, EMPTY, ensureNormalized, get, getAll, getAll, getDefaultElem, immutable, immutable, immutableList, init, init, init, init, isNormalized, isReadOnly, map, prepareAddBuffer, releaseAddBuffer, remove, size, sort, trimToSize, unmodifiableList
-
Methods inherited from class org.magicwerk.brownies.collections.primitive.IBooleanList
addAll, addAll, addAll, addAll, addArray, addArray, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, asIBooleanListable, binarySearch, checkIndex, checkIndexAdd, checkLength, checkLengths, checkNonNull, checkRange, clear, contains, containsAll, containsAny, containsIf, copy, count, countIf, doAddAll, doCreateArray, doIndexOf, doIndexOfIf, doInitAll, doLastIndexOf, doLastIndexOfIf, doModify, doPutAll, doReplace, doRotate, doTransfer, doTransferSwap, drag, element, ensureCapacity, equals, equalsElem, extract, extractIf, fill, filter, filterMap, flatMap, getDistinct, getFirst, getFirstOrNull, getIf, getLast, getLastOrNull, getSingle, getSingleOrNull, hashCode, hashCodeElem, indexOf, indexOf, indexOfIf, indexOfIf, initAll, initAll, initArray, initMult, isEmpty, lastIndexOf, lastIndexOf, lastIndexOfIf, lastIndexOfIf, mapFilter, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, removeAll, removeAll, removeAll, removeElem, removeFirst, removeFirstOccurrence, removeIf, removeLast, removeLastOccurrence, replace, replaceAll, replaceAll, replaceArray, replaceMult, resize, retain, retainAll, retainAll, retainIf, reverse, reverse, rotate, rotate, set, setAll, setAll, setArray, setArray, setMult, sort, swap, toArray, toArray, toArray, toArray, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwap, transform, transformedList
-
-
-
-
Constructor Detail
-
BooleanBlock
public BooleanBlock()
-
BooleanBlock
public BooleanBlock(int capacity)
-
BooleanBlock
public BooleanBlock(BooleanBigList.BooleanBlock that)
-
-
Method Detail
-
isShared
public boolean isShared()
- Returns:
- true if block is shared by several BooleanBigList instances
-
ref
public BooleanBigList.BooleanBlock ref()
Increment reference count as block is used by one BooleanBigList instance more.
-
unref
public void unref()
Decrement reference count as block is no longer used by one BooleanBigList instance.
-
-