/**
* <p>Returns a descriptor which is equal to this descriptor.
* Changes to the returned descriptor will have no effect on this
* descriptor, and vice versa. If this descriptor is immutable,
* it may fulfill this condition by returning itself.</p>
* @exception RuntimeOperationsException for illegal value for field names
* or field values.
* If the descriptor construction fails for any reason, this exception will
* be thrown.
* @return A descriptor which is equal to this descriptor.
*/
public Object clone() throws RuntimeOperationsException;
/**
* Returns true if all of the fields have legal values given their
* names.
*
* @return true if the values are legal.
*
* @exception RuntimeOperationsException If the validity checking fails for
* any reason, this exception will be thrown.
* The method returns false if the descriptor is not valid, but throws
* this exception if the attempt to determine validity fails.
*/
public boolean isValid() throws RuntimeOperationsException;
/**
* Compares this descriptor to the given object. The objects are equal if
* the given object is also a Descriptor, and if the two Descriptors have
* the same field names (possibly differing in case) and the same
* associated values. The respective values for a field in the two
* Descriptors are equal if the following conditions hold:</p>
*
* <ul>
* <li>If one value is null then the other must be too.</li>
* <li>If one value is a primitive array then the other must be a primitive
* array of the same type with the same elements.</li>
* <li>If one value is an object array then the other must be too and
* {@link Arrays#deepEquals(Object[],Object[])} must return true.</li>
* <li>Otherwise {@link Object#equals(Object)} must return true.</li>
* </ul>
*
* @param obj the object to compare with.
*
* @return {@code true} if the objects are the same; {@code false}
* otherwise.
*
* @since 1.6
*/
public boolean equals(Object obj);
/**
* <p>Returns the hash code value for this descriptor. The hash
* code is computed as the sum of the hash codes for each field in
* the descriptor. The hash code of a field with name {@code n}
* and value {@code v} is {@code n.toLowerCase().hashCode() ^ h}.
* Here {@code h} is the hash code of {@code v}, computed as
* follows:</p>
*
* <ul>
* <li>If {@code v} is null then {@code h} is 0.</li>
* <li>If {@code v} is a primitive array then {@code h} is computed using
* the appropriate overloading of {@code java.util.Arrays.hashCode}.</li>
* <li>If {@code v} is an object array then {@code h} is computed using
* {@link Arrays#deepHashCode(Object[])}.</li>
* <li>Otherwise {@code h} is {@code v.hashCode()}.</li>
* </ul>
*
* @return A hash code value for this object.
*
* @since 1.6
*/
public int hashCode();
}
=5=
THE END |