コード例 #1
0
  public double getValue(final int address) {
    if (address < 0 || address >= size) {
      throw new IndexOutOfBoundsException("address = " + address + "; size = " + size);
    }

    return ((Maybe.Just<Double>) tree.get(address)).getValue();
  }
コード例 #2
0
 /**
  * Sets the given value at the insert position.
  *
  * @param value the value to set
  * @return a new memory instance
  */
 public IntAvlMemory setValue(final double value) {
   return new IntAvlMemory(tree.put(insertPos, value), status, advance(), size);
 }
コード例 #3
0
 /**
  * Creates a new memory.
  *
  * @param values a list of the values in the memory
  * @param status the value of the status register
  */
 IntAvlMemory(List.Element<Double> values, boolean status) {
   this(IntAvlTree.fromList(values), status, 0, values.size());
 }