Ejemplo n.º 1
0
  /**
   * Fills all values contained in the receiver into the specified list. Fills the list, starting at
   * index 0. After this call returns the specified list has a new size that equals
   * <tt>this.size()</tt>. Iteration order is guaranteed to be <i>identical</i> to the order used by
   * method {@link #forEachKey(DoubleProcedure)}.
   *
   * <p>This method can be used to iterate over the values of the receiver.
   *
   * @param list the list to be filled, can have any size.
   */
  @Override
  public void values(ByteArrayList list) {
    list.setSize(distinct);
    byte[] elements = list.elements();

    int j = 0;
    for (int i = state.length; i-- > 0; ) {
      if (state[i] == FULL) {
        elements[j++] = values[i];
      }
    }
  }