Пример #1
0
  public void testSetShortValue() {
    for (int j = 0; j < 128; j++) {
      assertEquals(bf_multi.getShortValue(bf_multi.setShortValue((short) 0, (short) j)), (short) j);
      assertEquals(bf_multi.setShortValue((short) 0, (short) j), (short) (j << 7));
    }

    // verify that excess bits are stripped off
    assertEquals(bf_multi.setShortValue((short) 0x3f80, (short) 128), (short) 0);
    for (int j = 0; j < 2; j++) {
      assertEquals(
          bf_single.getShortValue(bf_single.setShortValue((short) 0, (short) j)), (short) j);
      assertEquals(bf_single.setShortValue((short) 0, (short) j), (short) (j << 14));
    }

    // verify that excess bits are stripped off
    assertEquals(bf_single.setShortValue((short) 0x4000, (short) 2), (short) 0);
  }
Пример #2
0
 /**
  * Sets the version part of record
  *
  * @param value version part value
  */
 public void setVersion(short value) {
   _options = fVersion.setShortValue(_options, value);
 }
Пример #3
0
 /**
  * Sets the instance part of record
  *
  * @param value instance part value
  */
 public void setInstance(short value) {
   _options = fInstance.setShortValue(_options, value);
 }