PATH  Documentation > Mac OS X > Foundation Reference: Java



Table of Contents

NSObject


Inherits from:
java.lang.Object
Implements:
Cloneable
NSKeyValueCoding
java.io.Serializable
Package:
com.apple.yellow.foundation


Class Description


NSObject, along with java.lang.Object, is the root class for all things Cocoa in Java, including Foundation, Application Kit, Web Objects, and Enterprise Objects.

The NSObject class is mostly an abstract class; programs use instances of classes that inherit from NSObject, but rarely instances of NSObject itself.

Java subclassers of Objective C classes absolutely must without fail:

  1. be sure to call super.finalize() if you override finalize(), and
  2. never "reconstitute" the Java object from the finalize() method.




Method Types


Constructors
NSObject
Comparing objects
equals
hashCode


Constructors



NSObject

public NSObject()

Description forthcoming.


Static Methods



load library

public static void loadLibrary(String libraryName)

Description forthcoming.


Instance Methods



clone

public Object clone()

Description forthcoming. Throws java.lang.CloneNotSupportedException

equals

public boolean equals(Object anObject)

Returns true if the receiver and anObject are equal, false otherwise. NSObject's implementation compares the id of anObject and the receiver to determine equality. Subclasses can override this method to redefine what it means for objects to be equal. For example, a container object might define two containers as equal if they contain the same contents. See the NSData, NSDictionary, NSArray, and String class specifications for examples of the use of this method. Note that equality as defined by this method is not necessarily reflexive. For example, A is equal to B, does not imply B is equal to A, especially if B is a subclass of A.

hashCode

public int hashCode()

Returns an integer that can be used as a table address in a hash table structure. NSObject's implementation returns a value based on the object's id. If two objects are equal (as determined by the equals method), they must return the same hash value. This last point is particularly important if you define hashCode in a subclass and intend to put instances of that subclass into a collection.

mutableClone

public Object mutableClone()

Description forthcoming.

takeValueForKey

public void takeValueForKey( Object anObject, String keyName)

Description forthcoming.

toString

public String toString()

Description forthcoming.

valueForKey

public Object valueForKey(String keyName)

Description forthcoming.


Table of Contents