类 ArrayContainer

java.lang.Object
org.bitlap.roaringbitmap.Container
org.bitlap.roaringbitmap.ArrayContainer
所有已实现的接口:
Externalizable, Serializable, Cloneable, Iterable<Character>, WordStorage<Container>

public final class ArrayContainer extends Container implements Cloneable
Simple container made of an array of 16-bit integers
另请参阅:
  • 字段详细资料

    • cardinality

      protected int cardinality
  • 构造器详细资料

    • ArrayContainer

      public ArrayContainer()
      Create an array container with default capacity
    • ArrayContainer

      public ArrayContainer(int capacity)
      Create an array container with specified capacity
      参数:
      capacity - The capacity of the container
    • ArrayContainer

      public ArrayContainer(int firstOfRun, int lastOfRun)
      Create an array container with a run of ones from firstOfRun to lastOfRun, inclusive. Caller is responsible for making sure the range is small enough that ArrayContainer is appropriate.
      参数:
      firstOfRun - first index
      lastOfRun - last index (range is exclusive)
    • ArrayContainer

      public ArrayContainer(int newCard, char[] newContent)
      Create a new container from existing values array. This copies the data.
      参数:
      newCard - desired cardinality
      newContent - actual values (length should equal or exceed cardinality)
    • ArrayContainer

      public ArrayContainer(MappeableArrayContainer bc)
      Creates a new non-mappeable container from a mappeable one. This copies the data.
      参数:
      bc - the original container
    • ArrayContainer

      public ArrayContainer(char[] newContent)
  • 方法详细资料

    • serializedSizeInBytes

      protected static int serializedSizeInBytes(int cardinality)
    • empty

      public static ArrayContainer empty()
    • add

      public Container add(int begin, int end)
      从类复制的说明: Container
      Return a new container with all shorts in [begin,end) added using an unsigned interpretation.
      指定者:
      add 在类中 Container
      参数:
      begin - start of range (inclusive)
      end - end of range (exclusive)
      返回:
      the new container
    • add

      public Container add(char x)
      running time is in O(n) time if insert is not in order.
      指定者:
      add 在接口中 WordStorage<Container>
      指定者:
      add 在类中 Container
      参数:
      x - short to be added
      返回:
      the new container
    • and

      public ArrayContainer and(ArrayContainer value2)
      从类复制的说明: Container
      Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
      指定者:
      and 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • and

      public Container and(BitmapContainer x)
      从类复制的说明: Container
      Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
      指定者:
      and 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • and

      public Container and(RunContainer x)
      从类复制的说明: Container
      Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
      指定者:
      and 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • andCardinality

      public int andCardinality(ArrayContainer value2)
      指定者:
      andCardinality 在类中 Container
    • andCardinality

      public int andCardinality(BitmapContainer x)
      指定者:
      andCardinality 在类中 Container
    • andCardinality

      public int andCardinality(RunContainer x)
      指定者:
      andCardinality 在类中 Container
    • andNot

      public ArrayContainer andNot(ArrayContainer value2)
      从类复制的说明: Container
      Computes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected.
      指定者:
      andNot 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • andNot

      public ArrayContainer andNot(BitmapContainer value2)
      从类复制的说明: Container
      Computes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected.
      指定者:
      andNot 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • andNot

      public ArrayContainer andNot(RunContainer x)
      从类复制的说明: Container
      Computes the bitwise ANDNOT of this container with another (difference). This container as well as the provided container are left unaffected.
      指定者:
      andNot 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • clear

      public void clear()
      从类复制的说明: Container
      Empties the container
      指定者:
      clear 在类中 Container
    • clone

      public ArrayContainer clone()
      指定者:
      clone 在类中 Container
    • isEmpty

      public boolean isEmpty()
      从类复制的说明: Container
      Checks whether the container is empty or not.
      指定者:
      isEmpty 在接口中 WordStorage<Container>
      指定者:
      isEmpty 在类中 Container
      返回:
      true if the container is empty.
    • isFull

      public boolean isFull()
      从类复制的说明: Container
      Checks whether the container is full or not.
      指定者:
      isFull 在类中 Container
      返回:
      true if the container is full.
    • contains

      public boolean contains(char x)
      从类复制的说明: Container
      Checks whether the contain contains the provided value
      指定者:
      contains 在类中 Container
      参数:
      x - value to check
      返回:
      whether the value is in the container
    • contains

      public boolean contains(int minimum, int supremum)
      从类复制的说明: Container
      Checks whether the container contains the entire range
      指定者:
      contains 在类中 Container
      参数:
      minimum - the inclusive lower bound of the range
      supremum - the exclusive upper bound of the range
      返回:
      true if the container contains the range
    • contains

      protected boolean contains(RunContainer runContainer)
      指定者:
      contains 在类中 Container
    • contains

      protected boolean contains(ArrayContainer arrayContainer)
      指定者:
      contains 在类中 Container
    • contains

      protected boolean contains(BitmapContainer bitmapContainer)
      指定者:
      contains 在类中 Container
    • deserialize

      public void deserialize(DataInput in) throws IOException
      从类复制的说明: Container
      Deserialize (recover) the container.
      指定者:
      deserialize 在类中 Container
      参数:
      in - the DataInput stream
      抛出:
      IOException - Signals that an I/O exception has occurred.
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • fillLeastSignificant16bits

      public void fillLeastSignificant16bits(int[] x, int i, int mask)
      从类复制的说明: Container
      Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.
      指定者:
      fillLeastSignificant16bits 在类中 Container
      参数:
      x - provided array
      i - starting index
      mask - indicates most significant bits
    • flip

      public Container flip(char x)
      从类复制的说明: Container
      Add a short to the container if it is not present, otherwise remove it. May generate a new container.
      指定者:
      flip 在类中 Container
      参数:
      x - short to be added
      返回:
      the new container
    • getArraySizeInBytes

      public int getArraySizeInBytes()
      从类复制的说明: Container
      Size of the underlying array
      指定者:
      getArraySizeInBytes 在类中 Container
      返回:
      size in bytes
    • getCardinality

      public int getCardinality()
      从类复制的说明: Container
      Computes the distinct number of char values in the container. Can be expected to run in constant time.
      指定者:
      getCardinality 在类中 Container
      返回:
      the cardinality
    • getReverseCharIterator

      public PeekableCharIterator getReverseCharIterator()
      从类复制的说明: Container
      Iterator to visit the char values in the container in descending order.
      指定者:
      getReverseCharIterator 在类中 Container
      返回:
      iterator
    • getCharIterator

      public PeekableCharIterator getCharIterator()
      从类复制的说明: Container
      Iterator to visit the char values in the container in ascending order.
      指定者:
      getCharIterator 在类中 Container
      返回:
      iterator
    • getCharRankIterator

      public PeekableCharRankIterator getCharRankIterator()
      从类复制的说明: Container
      Iterator to visit the short values in container and pre-compute ranks
      指定者:
      getCharRankIterator 在类中 Container
      返回:
      iterator
    • getBatchIterator

      public ContainerBatchIterator getBatchIterator()
      从类复制的说明: Container
      Gets an iterator to visit the contents of the container in batches
      指定者:
      getBatchIterator 在类中 Container
      返回:
      iterator
    • getSizeInBytes

      public int getSizeInBytes()
      从类复制的说明: Container
      Computes an estimate of the memory usage of this container. The estimate is not meant to be exact.
      指定者:
      getSizeInBytes 在类中 Container
      返回:
      estimated memory usage in bytes
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • iadd

      public Container iadd(int begin, int end)
      从类复制的说明: Container
      Add all shorts in [begin,end) using an unsigned interpretation. May generate a new container.
      指定者:
      iadd 在类中 Container
      参数:
      begin - start of range (inclusive)
      end - end of range (exclusive)
      返回:
      the new container
    • iand

      public ArrayContainer iand(ArrayContainer value2)
      从类复制的说明: Container
      Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      iand 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • iand

      public Container iand(BitmapContainer value2)
      从类复制的说明: Container
      Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      iand 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • iand

      public Container iand(RunContainer x)
      从类复制的说明: Container
      Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      iand 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • iandNot

      public ArrayContainer iandNot(ArrayContainer value2)
      从类复制的说明: Container
      Computes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      iandNot 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • iandNot

      public ArrayContainer iandNot(BitmapContainer value2)
      从类复制的说明: Container
      Computes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      iandNot 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • iandNot

      public Container iandNot(RunContainer x)
      从类复制的说明: Container
      Computes the in-place bitwise ANDNOT of this container with another (difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      iandNot 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • inot

      public Container inot(int firstOfRange, int lastOfRange)
      从类复制的说明: Container
      Computes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected. The current container is generally modified. May generate a new container.
      指定者:
      inot 在类中 Container
      参数:
      firstOfRange - beginning of range (inclusive); 0 is beginning of this container.
      lastOfRange - ending of range (exclusive)
      返回:
      (partially) complemented container
    • intersects

      public boolean intersects(ArrayContainer value2)
      从类复制的说明: Container
      Returns true if the current container intersects the other container.
      指定者:
      intersects 在类中 Container
      参数:
      value2 - other container
      返回:
      whether they intersect
    • intersects

      public boolean intersects(BitmapContainer x)
      从类复制的说明: Container
      Returns true if the current container intersects the other container.
      指定者:
      intersects 在类中 Container
      参数:
      x - other container
      返回:
      whether they intersect
    • intersects

      public boolean intersects(RunContainer x)
      从类复制的说明: Container
      Returns true if the current container intersects the other container.
      指定者:
      intersects 在类中 Container
      参数:
      x - other container
      返回:
      whether they intersect
    • intersects

      public boolean intersects(int minimum, int supremum)
      从类复制的说明: Container
      Checks if the container intersects with a range
      指定者:
      intersects 在类中 Container
      参数:
      minimum - the inclusive unsigned lower bound of the range
      supremum - the exclusive unsigned upper bound of the range
      返回:
      true if the container intersects the range
    • ior

      public Container ior(ArrayContainer value2)
      从类复制的说明: Container
      Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      ior 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • ior

      public Container ior(BitmapContainer x)
      从类复制的说明: Container
      Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      ior 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • ior

      public Container ior(RunContainer x)
      从类复制的说明: Container
      Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      ior 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • iremove

      public Container iremove(int begin, int end)
      从类复制的说明: Container
      Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container.
      指定者:
      iremove 在类中 Container
      参数:
      begin - start of range (inclusive)
      end - end of range (exclusive)
      返回:
      the new container
    • iterator

      public Iterator<Character> iterator()
      指定者:
      iterator 在接口中 Iterable<Character>
    • ixor

      public Container ixor(ArrayContainer value2)
      从类复制的说明: Container
      Computes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      ixor 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • ixor

      public Container ixor(BitmapContainer x)
      从类复制的说明: Container
      Computes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      ixor 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • ixor

      public Container ixor(RunContainer x)
      从类复制的说明: Container
      Computes the in-place bitwise XOR of this container with another (symmetric difference). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
      指定者:
      ixor 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • limit

      public Container limit(int maxcardinality)
      从类复制的说明: Container
      Create a new Container containing at most maxcardinality integers.
      指定者:
      limit 在类中 Container
      参数:
      maxcardinality - maximal cardinality
      返回:
      a new bitmap with cardinality no more than maxcardinality
    • not

      public Container not(int firstOfRange, int lastOfRange)
      从类复制的说明: Container
      Computes the bitwise NOT of this container (complement). Only those bits within the range are affected. The current container is left unaffected.
      指定者:
      not 在类中 Container
      参数:
      firstOfRange - beginning of range (inclusive); 0 is beginning of this container.
      lastOfRange - ending of range (exclusive)
      返回:
      (partially) complemented container
    • or

      public Container or(ArrayContainer value2)
      从类复制的说明: Container
      Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
      指定者:
      or 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • or

      public Container or(BitmapContainer x)
      从类复制的说明: Container
      Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
      指定者:
      or 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • or

      public Container or(RunContainer x)
      从类复制的说明: Container
      Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
      指定者:
      or 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • or

      protected Container or(CharIterator it)
    • rank

      public int rank(char lowbits)
      从类复制的说明: Container
      Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).
      指定者:
      rank 在类中 Container
      参数:
      lowbits - upper limit
      返回:
      the rank
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      指定者:
      readExternal 在接口中 Externalizable
      抛出:
      IOException
    • remove

      public Container remove(int begin, int end)
      从类复制的说明: Container
      Return a new container with all chars in [begin,end) remove using an unsigned interpretation.
      指定者:
      remove 在类中 Container
      参数:
      begin - start of range (inclusive)
      end - end of range (exclusive)
      返回:
      the new container
    • remove

      public Container remove(char x)
      从类复制的说明: Container
      Remove the char from this container. May create a new container.
      指定者:
      remove 在类中 Container
      参数:
      x - to be removed
      返回:
      New container
    • repairAfterLazy

      public Container repairAfterLazy()
      从类复制的说明: Container
      The output of a lazyOR or lazyIOR might be an invalid container, this should be called on it.
      指定者:
      repairAfterLazy 在类中 Container
      返回:
      a new valid container
    • runOptimize

      public Container runOptimize()
      从类复制的说明: Container
      Convert to RunContainers, when the result is smaller. Overridden by RunContainer to possibility switch from RunContainer to a smaller alternative. Overridden by BitmapContainer with a more efficient approach.
      指定者:
      runOptimize 在接口中 WordStorage<Container>
      指定者:
      runOptimize 在类中 Container
      返回:
      the new container
    • select

      public char select(int j)
      从类复制的说明: Container
      Return the jth value
      指定者:
      select 在类中 Container
      参数:
      j - index of the value
      返回:
      the value
    • serialize

      public void serialize(DataOutput out) throws IOException
      从类复制的说明: Container
      Serialize the container.
      指定者:
      serialize 在类中 Container
      参数:
      out - the DataOutput stream
      抛出:
      IOException - Signals that an I/O exception has occurred.
    • serializedSizeInBytes

      public int serializedSizeInBytes()
      从类复制的说明: Container
      Report the number of bytes required to serialize this container.
      指定者:
      serializedSizeInBytes 在类中 Container
      返回:
      the size in bytes
    • toBitmapContainer

      public BitmapContainer toBitmapContainer()
      Copies the data in a bitmap container.
      指定者:
      toBitmapContainer 在类中 Container
      返回:
      the bitmap container
    • nextValue

      public int nextValue(char fromValue)
      从类复制的说明: Container
      Gets the first value greater than or equal to the lower bound, or -1 if no such value exists.
      指定者:
      nextValue 在类中 Container
      参数:
      fromValue - the lower bound (inclusive)
      返回:
      the next value
    • previousValue

      public int previousValue(char fromValue)
      从类复制的说明: Container
      Gets the last value less than or equal to the upper bound, or -1 if no such value exists.
      指定者:
      previousValue 在类中 Container
      参数:
      fromValue - the upper bound (inclusive)
      返回:
      the previous value
    • nextAbsentValue

      public int nextAbsentValue(char fromValue)
      从类复制的说明: Container
      Gets the first absent value greater than or equal to the lower bound.
      指定者:
      nextAbsentValue 在类中 Container
      参数:
      fromValue - the lower bound (inclusive)
      返回:
      the next absent value
    • previousAbsentValue

      public int previousAbsentValue(char fromValue)
      从类复制的说明: Container
      Gets the last value less than or equal to the upper bound.
      指定者:
      previousAbsentValue 在类中 Container
      参数:
      fromValue - the upper bound (inclusive)
      返回:
      the previous absent value
    • first

      public int first()
      从类复制的说明: Container
      Get the first integer held in the container
      指定者:
      first 在类中 Container
      返回:
      the first integer in the container
    • last

      public int last()
      从类复制的说明: Container
      Get the last integer held in the container
      指定者:
      last 在类中 Container
      返回:
      the last integer in the container
    • toMappeableContainer

      public MappeableContainer toMappeableContainer()
      从类复制的说明: Container
      Convert to a mappeable container.
      指定者:
      toMappeableContainer 在类中 Container
      返回:
      the mappeable container
    • toCharBuffer

      public CharBuffer toCharBuffer()
      Return the content of this container as a ShortBuffer. This creates a copy and might be relatively slow.
      返回:
      the ShortBuffer
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • trim

      public void trim()
      从类复制的说明: Container
      If possible, recover wasted memory.
      指定者:
      trim 在类中 Container
    • writeArray

      public void writeArray(DataOutput out) throws IOException
      从类复制的说明: Container
      Write just the underlying array.
      指定者:
      writeArray 在类中 Container
      参数:
      out - output stream
      抛出:
      IOException - in case of failure
    • writeArray

      public void writeArray(ByteBuffer buffer)
      从类复制的说明: Container
      Write just the underlying array.
      指定者:
      writeArray 在类中 Container
      参数:
      buffer - ByteBuffer to write to
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      指定者:
      writeExternal 在接口中 Externalizable
      抛出:
      IOException
    • xor

      public Container xor(ArrayContainer value2)
      从类复制的说明: Container
      Computes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected.
      指定者:
      xor 在类中 Container
      参数:
      value2 - other container
      返回:
      aggregated container
    • xor

      public Container xor(BitmapContainer x)
      从类复制的说明: Container
      Computes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected.
      指定者:
      xor 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • xor

      public Container xor(RunContainer x)
      从类复制的说明: Container
      Computes the bitwise XOR of this container with another (symmetric difference). This container as well as the provided container are left unaffected.
      指定者:
      xor 在类中 Container
      参数:
      x - other container
      返回:
      aggregated container
    • xor

      protected Container xor(CharIterator it)
    • forEach

      public void forEach(char msb, IntConsumer ic)
      从类复制的说明: Container
      Iterate through the values of this container and pass them along to the IntConsumer, using msb as the 16 most significant bits.
      指定者:
      forEach 在类中 Container
      参数:
      msb - 16 most significant bits
      ic - consumer
    • forAll

      public void forAll(int offset, RelativeRangeConsumer rrc)
      从类复制的说明: Container
      Consume presence information for all values in this container.
      指定者:
      forAll 在类中 Container
      参数:
      offset - First value in this container corresponds to this relativePos in the range consumer.
      rrc - consumer
    • forAllFrom

      public void forAllFrom(char startValue, RelativeRangeConsumer rrc)
      从类复制的说明: Container
      Consume presence information for all values greater or equal to startValue in this container.
      指定者:
      forAllFrom 在类中 Container
      参数:
      startValue - First value to consume. Corresponds to relativePos=0 in the range consumer.
      rrc - consumer
    • forAllUntil

      public void forAllUntil(int offset, char endValue, RelativeRangeConsumer rrc)
      从类复制的说明: Container
      Consume presence information for all values smaller than endValue in this container.
      指定者:
      forAllUntil 在类中 Container
      参数:
      offset - First value in this container corresponds to this relativePos in the range consumer.
      endValue - First value greater than last value to consume.
      rrc - consumer
    • forAllInRange

      public void forAllInRange(char startValue, char endValue, RelativeRangeConsumer rrc)
      从类复制的说明: Container
      Consumer presence information for all values in the range [startValue, endValue) in this container.
      指定者:
      forAllInRange 在类中 Container
      参数:
      startValue - First value to consume. Corresponds to relativePos=0 in the range consumer.
      endValue - First value greater than last value to consume.
      rrc - consumer
    • lazyor

      protected Container lazyor(ArrayContainer value2)