예제 #1
0
  /**
   * Return TRUE if <code>x</code> and <code>y</code> represent the same set of key/value pairs.
   *
   * @param y
   * @return boolean
   */
  public boolean objectEqualP(Stella_Object y) {
    {
      StellaHashTable x = this;

      if (Surrogate.subtypeOfP(
          Stella_Object.safePrimaryType(y), Stella.SGT_STELLA_STELLA_HASH_TABLE)) {
        {
          StellaHashTable y000 = ((StellaHashTable) (y));

          if (x.length() == y000.length()) {
            {
              Stella_Object key = null;
              Stella_Object value = null;
              StellaHashTableIterator iter000 = ((StellaHashTableIterator) (x.allocateIterator()));

              while (iter000.nextP()) {
                key = iter000.key;
                value = iter000.value;
                if (!Stella_Object.equalP(value, y000.lookup(key))) {
                  return (false);
                }
              }
            }
            return (true);
          }
        }
      } else {
      }
      return (false);
    }
  }
예제 #2
0
  /**
   * Return TRUE if <code>self</code> has zero entries.
   *
   * @return boolean
   */
  public boolean emptyP() {
    {
      StellaHashTable self = this;

      return (self.length() == 0);
    }
  }