com.novell.application.console.snapin
Class ObjectEntry

java.lang.Object
  extended bycom.novell.application.console.snapin.ObjectEntry
All Implemented Interfaces:
java.io.Serializable

public class ObjectEntry
extends java.lang.Object
implements java.io.Serializable

Defines an entry that represents each object inside of a namespace.

An ObjectEntry is a lightweight representation of a named object in a namespace. This class is made final so that it cannot be subclassed. Each ObjectEntry contains a reference to an ObjectType.

See Also:
ObjectType, Serialized Form

Constructor Summary
ObjectEntry(java.lang.String name, ObjectType type)
          Contructs an ObjectEntry of the specified ObjectType.
ObjectEntry(java.lang.String name, ObjectType type, long objectFlags)
          Contructs an ObjectEntry of the specified ObjectType with objectFlags.
ObjectEntry(java.lang.String name, ObjectType type, ObjectEntry parent)
          Contructs an ObjectEntry of the specified ObjectType with the object parent.
ObjectEntry(java.lang.String name, ObjectType type, ObjectEntry parent, long objectFlags)
          Contructs an ObjectEntry of the specified ObjectType with objectFlags and object parent.
 
Method Summary
 void addSubType(ObjectType type)
          Adds an ObjectType to the array of subtypes for this entry.
 boolean equals(java.lang.Object object)
          Compares this ObjectEntry to the ObjectEntry passed in and returns true if their full names, ObjectType names, and namespace unique IDs are the same.
 java.lang.String getFullName()
          Returns the object's full name as a String.
 java.lang.String getName()
          Returns the object's name as a String.
 long getObjectFlags()
          Returns the flags associated with an object.
 ObjectType getObjectType()
          Returns the object's class or type as an ObjectType.
 ObjectType[] getObjectTypes()
          Deprecated. As of ConsoleOne version 1.2, use getSubTypes() instead.
 ObjectEntry getParent()
          Returns the specified ObjectEntry's parent object.
 ObjectEntry getRoot()
          Returns the root object in the lineage of this ObjectEntry.
 ObjectType[] getSubTypes()
          Returns the subtypes of this ObjectEntry.
 int hashCode()
          Returns the hash code for this ObjectEntry for use in hash tables.
 boolean removeSubType(ObjectType type)
          Removes an ObjectType from the array of subtypes for this entry.
 void setObjectFlags(long objectFlags)
          Sets the flags to be associated with an object.
 void setSubTypes(ObjectType[] types)
          Sets all of the subtypes for this ObjectEntry.
 java.lang.String toString()
          Returns the object's name as a String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectEntry

public ObjectEntry(java.lang.String name,
                   ObjectType type)
Contructs an ObjectEntry of the specified ObjectType.

Parameters:
name - The name (RDN) of the object.
type - The ObjectType of the object.

ObjectEntry

public ObjectEntry(java.lang.String name,
                   ObjectType type,
                   long objectFlags)
Contructs an ObjectEntry of the specified ObjectType with objectFlags.

Parameters:
name - The name (RDN) of the object.
type - The ObjectType of the object.
objectFlags - The flags associated with the object.

ObjectEntry

public ObjectEntry(java.lang.String name,
                   ObjectType type,
                   ObjectEntry parent)
Contructs an ObjectEntry of the specified ObjectType with the object parent.

Parameters:
name - The name (RDN) of the object.
type - The ObjectType of the object.
parent - The parent of the object.

ObjectEntry

public ObjectEntry(java.lang.String name,
                   ObjectType type,
                   ObjectEntry parent,
                   long objectFlags)
Contructs an ObjectEntry of the specified ObjectType with objectFlags and object parent.

Parameters:
name - The name (RDN) of the object.
type - The ObjectType of the object.
parent - The parent of the object.
objectFlags - The flags associated with the object.
Method Detail

addSubType

public void addSubType(ObjectType type)
Adds an ObjectType to the array of subtypes for this entry.

Parameters:
type - The ObjectType to add as a subtype for this entry.

equals

public boolean equals(java.lang.Object object)
Compares this ObjectEntry to the ObjectEntry passed in and returns true if their full names, ObjectType names, and namespace unique IDs are the same.

This is preferred over == for comparing ObjectEntries because there may be two different instances of the same logical ObjectEntry.

Parameters:
object - The ObjectEntry passed in to be used in the comparison.
Returns:
True if the ObjectEntries are equal, otherwise false.

getFullName

public java.lang.String getFullName()
Returns the object's full name as a String.

Returns:
The full name of the object.

getName

public java.lang.String getName()
Returns the object's name as a String.

Returns:
The name of the object.

getObjectFlags

public long getObjectFlags()
Returns the flags associated with an object.

Returns:
The flags associated with the object.
See Also:
setObjectFlags(long)

getObjectType

public ObjectType getObjectType()
Returns the object's class or type as an ObjectType.

Returns:
The class or type of the object.

getObjectTypes

public ObjectType[] getObjectTypes()
Deprecated. As of ConsoleOne version 1.2, use getSubTypes() instead.


getParent

public ObjectEntry getParent()
Returns the specified ObjectEntry's parent object.

When the getParent() method is called it assumes the first ObjectType is being used. If there is no parent to return, ObjectEntry returns null.

Returns:
The parent of the given ObjectEntry, or null if there is no parent.

getRoot

public ObjectEntry getRoot()
Returns the root object in the lineage of this ObjectEntry.

The root is defined as the object with a null parent or the object that returns a parent object from another namespace.

Returns:
The root ObjectEntry of this object.

getSubTypes

public ObjectType[] getSubTypes()
Returns the subtypes of this ObjectEntry. Subtypes should be of the same namespace as the base ObjectType. Snap-ins registered to subtypes appear in such areas as the toolbar menu when an entry is selected.

Returns:
The array of ObjectTypes that represent this entry's subtypes.

hashCode

public int hashCode()
Returns the hash code for this ObjectEntry for use in hash tables. Two ObjectEntries compare to true, using the equals method, will return the same hash code.

Returns:
The 32-bit hash code for this ObjectEntry.

removeSubType

public boolean removeSubType(ObjectType type)
Removes an ObjectType from the array of subtypes for this entry.

Parameters:
type - The ObjectType to remove as a subtype for this entry.
Returns:
True if the subtype was removed, or false if the type could not be removed.

setObjectFlags

public void setObjectFlags(long objectFlags)
Sets the flags to be associated with an object.

Parameters:
objectFlags - The flags to be associated with the object.
See Also:
getObjectFlags()

setSubTypes

public void setSubTypes(ObjectType[] types)
Sets all of the subtypes for this ObjectEntry.

Parameters:
types - The array of ObjectTypes that represent this entry's subtypes.

toString

public java.lang.String toString()
Returns the object's name as a String.

Returns:
The name of the object.


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.