ref_send API 2.17
defensive programming in Java

org.joe_e
Interface Selfless

All Known Subinterfaces:
Record
All Known Implementing Classes:
AllTypes, Amount, Anchor, BooleanArray, ByteArray, CallSite, CharArray, Comment, ConstArray, Deferred, Do, DoubleArray, DrumFactory, Event, Eventual, Export, FloatArray, Fulfilled, Got, ImmutableArray, IntArray, JSONDeserializer, JSONSerializer, Layout, Link, LongArray, Pipelined, PowerlessArray, Problem, Progressed, Rejected, Resolved, Returned, Scope, Sent, SentIf, SeriesFactory, ShortArray, Struct, Syntax, Trace, Turn, TurnCounter, Vat, Verbose

public interface Selfless

Marker interface for annotating classes that are indistinguishable from a shallow copy of themselves.

Joe-E requires that classes that implement this interface must meet all of the following obligations:

  1. All instance fields must be final.
  2. The class cannot be equatable.
  3. The object identity of instances of the class is not visible This can be satisfied by either of:
    1. The superclass implements Selfless; or,
    2. The class's superclass is java.lang.Object, the class overrides equals(), and doesn't call super.equals().
  4. The object provides a hash code that does not reveal object identity. This requirement is enforced by including hashCode() in the interface.

The Joe-E verifier ensures that Joe-E code cannot distinguish a shallow copy of a Selfless object from the original object.

See Also:
Equatable

Method Summary
 int hashCode()
           
 

Method Detail

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.