예제 #1
0
  public Lock(final String lockId, final int lockType) {
    if (lockType != Manager.LOCK_TYPE_SYNCHRONOUS_WRITE && lockType != Manager.LOCK_TYPE_WRITE) {
      throw new AssertionError(
          "Trying to set lockType to "
              + lockType
              + " -- must be either write or synchronous-write");
    }

    this.lockType = lockType;
    Assert.pre(lockId != null && lockId.length() > 0);
    this.lockId = lockId;
  }
 public Instruction(int opcode, int address) {
   Assert.pre(0 < opcode && opcode <= GO, "Bad opcode");
   this.opcode = opcode;
   this.address = address;
 }
예제 #3
0
 /**
  * Constructs a pair from a key and value.
  *
  * @pre Key is non-null
  * @post Constructs a key-value pair
  * @param key A non-null object.
  * @param value A (possibly null) object.
  */
 public Entry(K key, V value) {
   Assert.pre(key != null, "Key must not be null.");
   theKey = key;
   theValue = value;
 }