CONTENTS | PREV | NEXT A Collection of Jini(TM) Technology Helper Utilities and Services Specifications



EU - JiniTM Entry Utilities Specification

EU.1 Entry Utilities

Entries are designed to be used in distributed algorithms for which exact-match lookup semantics are useful. An entry is a typed set of objects, each of which may be tested for exact match with a template. The details of entries and their semantics are discussed in Jini Technology Core Platform Specification, "Entry".

When designing entries, certain tasks are commonly done in similar ways. This specification defines a utility class for such common tasks.

EU.1.1 AbstractEntry

The class net.jini.entry.AbstractEntry is a specific implementation of Entry that provides useful implementations of equals, hashCode, and toString:

package net.jini.entry;

public abstract class AbstractEntry implements Entry {
    public boolean equals(Object o) {...}
    public int hashCode() {...}
    public String toString() {...}
    public static boolean equals(Entry e1, Entry e2) {...}
    public static int hashCode(Entry entry) {...}
    public static String toString(Entry entry) {...}
}

The static method AbstractEntry.equals returns true if and only if the two entries are of the same class and for each field F, the two objects' values for F are either both null or the invocation of equals on one object's value for F with the other object's value for F as its parameter returns true. The static method hashCode returns zero XOR the hashCode invoked on each non-null field of the entry. The static method toString returns a string that contains each field's name and value. The non-static methods equals, hashCode, and toString return a result equivalent to invoking the corresponding static method with this as the first argument.

EU.1.2 Serialized Form

Class
serialVersionUID
Serialized Fields
AbstractEntry
5071868345060424804L
none

EU.1.3 Comments

Please direct comments to jini-comments@java.sun.com.


CONTENTS | PREV | NEXT A Collection of Jini(TM) Technology Helper Utilities and Services Specifications

Copyright 2003, Sun Microsystems, Inc.
Licensed under the Apache License, Version 2.0.