com.ibm.as400.opnav
Class ObjectNameBuilder

java.lang.Object
  |
  +--com.ibm.as400.opnav.ObjectNameBuilder

public class ObjectNameBuilder
extends java.lang.Object

A utility class that provides the ability to create fully-qualified Operations Navigator ObjectNames.

An ObjectName is a sequence of items. Each item contains a display name, a type and an index. ObjectNameBuilder may be used to build up a new sequence of items, an item at a time. When the sequence is complete, a call to getObjectName will return the new ObjectName.

An existing ObjectName can also be used as the initial value of an instance of ObjectNameBuilder. The methods on ObjectNameBuilder can be used to modify the sequence of items and their values. A new ObjectName may then be generated by calling getObjectName.

Since:
v5r1m0
See Also:
ObjectName

Constructor Summary
ObjectNameBuilder()
          Constructs an ObjectNameBuilder that is initially empty.
ObjectNameBuilder(java.awt.Frame frame)
          THIS METHOD IS CURRENTLY NOT SUPPORTED Constructs an ObjectNameBuilder that is initially empty.
ObjectNameBuilder(java.awt.Frame frame, ObjectName obj)
          THIS METHOD IS CURRENTLY NOT SUPPORTED Constructs an ObjectNameBuilder using the specified ObjectName as an initial value.
ObjectNameBuilder(ObjectName obj)
          Constructs an ObjectNameBuilder using the specified ObjectName as an initial value.
 
Method Summary
 void addItem(java.lang.String name, java.lang.String type, int itemIndex)
          Adds an item to this ObjectName.
 ObjectName getChildAt(int index)
          THIS METHOD IS CURRENTLY NOT SUPPORTED Returns the child node at the input index for the current folder of the current ObjectName Returns null if no child is found
 ObjectName[] getChildren()
          THIS METHOD IS CURRENTLY NOT SUPPORTED Returns the children nodes for the current folder of the current ObjectName Returns null if no children are found
 int getItemIndex(int index)
          Returns the index of the item in this ObjectName at the specified position.
 java.lang.String getItemName(int index)
          Returns the name of the item in this ObjectName at the specified position.
 java.lang.String getItemType(int index)
          Returns the type of the item in this ObjectName at the specified position.
 ObjectName getObjectName()
          Returns a new ObjectName constructed using the item values in this ObjectNameBuilder.
 ObjectName getRoot()
          THIS METHOD IS CURRENTLY NOT SUPPORTED Returns the root node of the current tree in the Java console Returns null if no root node exists
 int getSize()
          Returns the number of items that make up this ObjectName.
 void insertItem(int index, java.lang.String name, java.lang.String type, int itemIndex)
          Inserts an item in this ObjectName at the specified position.
 void removeAll()
          Removes all items in this ObjectName.
 void removeItem(int index)
          Removes the item in this ObjectName at the specified position.
 void setItem(int index, java.lang.String name, java.lang.String type, int itemIndex)
          Sets the value of an item in this ObjectName at the specified position.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectNameBuilder

public ObjectNameBuilder()
Constructs an ObjectNameBuilder that is initially empty.
Since:
v5r1m0

ObjectNameBuilder

public ObjectNameBuilder(ObjectName obj)
Constructs an ObjectNameBuilder using the specified ObjectName as an initial value.
Throws:
NullPointerException - If the specified ObjectName is null.
java.lang.IllegalArgumentException - If the specified ObjectName is not valid.
Since:
v5r1m0

ObjectNameBuilder

public ObjectNameBuilder(java.awt.Frame frame)
THIS METHOD IS CURRENTLY NOT SUPPORTED Constructs an ObjectNameBuilder that is initially empty.
Since:
v5r1m0

ObjectNameBuilder

public ObjectNameBuilder(java.awt.Frame frame,
                         ObjectName obj)
THIS METHOD IS CURRENTLY NOT SUPPORTED Constructs an ObjectNameBuilder using the specified ObjectName as an initial value.
Throws:
NullPointerException - If the specified ObjectName is null.
java.lang.IllegalArgumentException - If the specified ObjectName is not valid.
Since:
v5r1m0
Method Detail

getSize

public int getSize()
Returns the number of items that make up this ObjectName.
Returns:
The count of items.
Since:
v5r1m0

addItem

public void addItem(java.lang.String name,
                    java.lang.String type,
                    int itemIndex)
Adds an item to this ObjectName.
Parameters:
name - The name of the item.
type - The item type.
itemIndex - The item index.
Since:
v5r1m0

insertItem

public void insertItem(int index,
                       java.lang.String name,
                       java.lang.String type,
                       int itemIndex)
Inserts an item in this ObjectName at the specified position.
Parameters:
index - The position at which the new item should be inserted.
name - The name of the item.
type - The item type.
itemIndex - The item index.
Throws:
ArrayIndexOutOfBoundsException - If the specified index exceeds the value returned by getSize.
Since:
v5r1m0

setItem

public void setItem(int index,
                    java.lang.String name,
                    java.lang.String type,
                    int itemIndex)
Sets the value of an item in this ObjectName at the specified position.
Parameters:
index - The position at which the item values should be set.
name - The name of the item.
type - The item type.
itemIndex - The item index.
Throws:
ArrayIndexOutOfBoundsException - If the specified index is not less than the value returned by getSize.
Since:
v5r1m0

removeItem

public void removeItem(int index)
Removes the item in this ObjectName at the specified position.
Parameters:
index - The position of the item to be removed.
Throws:
ArrayIndexOutOfBoundsException - If the specified index is not less than the value returned by getSize.
Since:
v5r1m0

removeAll

public void removeAll()
Removes all items in this ObjectName.
Since:
v5r1m0

getItemName

public java.lang.String getItemName(int index)
Returns the name of the item in this ObjectName at the specified position.
Parameters:
index - The position of the item whose name is to be returned.
Returns:
The name of the item.
Throws:
ArrayIndexOutOfBoundsException - If the specified index is not less than the value returned by getSize.
Since:
v5r1m0

getItemType

public java.lang.String getItemType(int index)
Returns the type of the item in this ObjectName at the specified position.
Parameters:
index - The position of the item whose type is to be returned.
Returns:
The type of the item.
Throws:
ArrayIndexOutOfBoundsException - If the specified index is not less than the value returned by getSize.
Since:
v5r1m0

getItemIndex

public int getItemIndex(int index)
Returns the index of the item in this ObjectName at the specified position.
Parameters:
index - The position of the item whose index is to be returned.
Returns:
The index of the item.
Throws:
ArrayIndexOutOfBoundsException - If the specified index is not less than the value returned by getSize.
Since:
v5r1m0

getObjectName

public ObjectName getObjectName()
Returns a new ObjectName constructed using the item values in this ObjectNameBuilder.
Returns:
A new ObjectName.
Since:
v5r1m0

toString

public java.lang.String toString()
Returns a string representation of the object.
Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.
Since:
v5r1m0

getRoot

public ObjectName getRoot()
THIS METHOD IS CURRENTLY NOT SUPPORTED Returns the root node of the current tree in the Java console Returns null if no root node exists
Since:
v5r1m0

getChildren

public ObjectName[] getChildren()
THIS METHOD IS CURRENTLY NOT SUPPORTED Returns the children nodes for the current folder of the current ObjectName Returns null if no children are found
Since:
v5r1m0

getChildAt

public ObjectName getChildAt(int index)
THIS METHOD IS CURRENTLY NOT SUPPORTED Returns the child node at the input index for the current folder of the current ObjectName Returns null if no child is found
Parameters:
index - The index for the desired child node
Since:
v5r1m0