org.joe_e
Class JoeE

java.lang.Object
  extended by org.joe_e.JoeE

public class JoeE
extends Object

Joe-E core library functions. These provide fundamental features, similar to the methods in java.lang.System, such as the interface to the overlay type system.


Method Summary
static Error abort(Error reason)
          Aborts the current flow of control.
static boolean instanceOf(Object obj, Class<?> type)
          Tests whether the specified object belongs to the specified type in the overlay type system.
static boolean isFrozen(Object x)
          Is the object one-level deep immutable?
static boolean isSubtypeOf(Class<?> c1, Class<?> c2)
          Tests whether the first class is a subtype of the second in the overlay type system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instanceOf

public static boolean instanceOf(Object obj,
                                 Class<?> type)
Tests whether the specified object belongs to the specified type in the overlay type system. The equivalent of the Java instanceof operator, for the overlay type system.

Parameters:
obj - the object to test
type - the type to test membership of
Returns:
true if the specified object belongs to the specified type in the overlay type system.

isSubtypeOf

public static boolean isSubtypeOf(Class<?> c1,
                                  Class<?> c2)
Tests whether the first class is a subtype of the second in the overlay type system.

Parameters:
c1 - the potential subtype
c2 - the potential supertype
Returns:
true if the first argument is a subtype of the second in the overlay type system

abort

public static Error abort(Error reason)
Aborts the current flow of control. This method invokes the currently registered error handler, which should preclude continued execution of Joe-E code.

Parameters:
reason - reason for the abort
Returns:
an error to throw

isFrozen

public static boolean isFrozen(Object x)
Is the object one-level deep immutable?

Parameters:
x - candidate object
Returns:
true if x is one-level deep immutable, false if it might not be