java.lang
Class Object

java.lang.Object

public class Object

Object is the the base class for all objects. Under Ewe all methods except the wait() and notify() methods are supported.

The number of methods in this class is small since each method added to this class is added to all other classes in the system.

As with all classes in the ewe.lang package, you can't reference the Object class using the full specifier of ewe.lang.Object. The ewe.lang package is implicitly imported. Instead, you should simply access the Object class like this:

 Object obj = (Object)value;
 


Constructor Summary
Object()
           
 
Method Summary
protected  Object clone()
          Create a field for field copy of this Object if this Object implements the Cloneable interface.
 boolean equals(Object other)
          Returns if this object is considered equal to the other object.
protected  void finalize()
          This method (when overriden), will be called when the VM determines that the Object can be garbage collected.
 Class getClass()
          Return a Class object that represents the class of this object.
 int hashCode()
          Returns a hashCode for the object.
 String toString()
          Return a String representation of this object.
 

Constructor Detail

Object

public Object()
Method Detail

toString

public String toString()
Return a String representation of this object.

Returns:
a String representing this object.

getClass

public Class getClass()
Return a Class object that represents the class of this object. Note: under a Ewe VM Class objects returned by this method are not static. Therefore when comparing class objects you should use the equals() method and never the '==' operator.

Returns:
A Class object representing the class of this object.

equals

public boolean equals(Object other)
Returns if this object is considered equal to the other object.

Parameters:
other - Another object to compare to.
Returns:
true if this object is considered equal to the other object.

hashCode

public int hashCode()
Returns a hashCode for the object. The general contract of hashCode is:
  • An object must return the same hash code for its entire existence.
  • If two objects are considered equal by the equals() method, they should return the same hash code. Not all Objects will do this and you should only use hashCode() from Objects which declare an overrided version of hashCode(). The only Objects which provide consistent and correct hash codes under Ewe are Object, String and Class.


  • finalize

    protected void finalize()
                     throws Throwable
    This method (when overriden), will be called when the VM determines that the Object can be garbage collected. Any action can be taken by the finalize() method, including making the Object available to other Threads (which would stop the garbage collection of the Object).

    The finalize() method of a Class is only called if it overrides finalize() - the finalize() method java.lang.Object is never called by the Ewe VM.

    Note that under a native Ewe VM, the call to finalize() will be synchronized with the Ewe library, but under a Java VM, the finalize() method may be called by a separate Thread that is not synchronized with the Ewe library. To ensure that the execution of the finalize() method is sychronized with the Ewe library your finalize() method should look like this:

     protected void finalize()
     {
       synchronized(ewe.sys.Vm.getSyncObject()){
       //
       // Put your finalize() code here.
       //
       }
     }
     
    Under Ewe the synchronized keyword is silently ignored.

    Throws:
    Throwable

    clone

    protected Object clone()
                    throws CloneNotSupportedException
    Create a field for field copy of this Object if this Object implements the Cloneable interface.

    Returns:
    A clone of this Object.
    Throws:
    CloneNotSupportedException - if this Object does not implement the Cloneable interface.