AR System Java API

com.bmc.arsys.api
Class MenuItem

java.lang.Object
  extended by com.bmc.arsys.api.MenuItem
All Implemented Interfaces:
Serializable, Cloneable

public class MenuItem
extends Object
implements Cloneable, Serializable

Each MenuItem represents an individual menu item of a list menu. In this context, a menu item can be a value (a leaf-level item) or another menu (a top- or intermediate-level item).

See Also:
Serialized Form

Nested Class Summary
static class MenuItem.MENUTYPE
           
 
Field Summary
static char AR_DEF_MENU_COMMENT
           
static String AR_DEF_MENU_DELIMITER
           
static String AR_DEF_MENU_KEYWORD_ESCAPE
           
static String AR_DEF_MENU_KEYWORD_NO_ESCAPE
           
static char AR_DEF_MENU_LINE_INDENT
           
 
Constructor Summary
MenuItem()
           
MenuItem(String label, List<MenuItem> childMenu)
           
MenuItem(String label, String menuItem)
           
 
Method Summary
static List<MenuItem> bufferToMenuItemList(Scanner scanBuffer)
          This method converts contents of a buffer/file into list menu structure
 Object clone()
          Clone implementation that returns an Object with data cloned from self.
static List<MenuItem> decode(String encoded)
          This method converts contents of a string into list menu structure
 boolean equals(Object obj)
          Use this method for checking equality between the current object and the provided one.
 Object getContent()
          Returns value associated with the menu item.
 String getLabel()
          Returns label that identifies the menu item.
 List<MenuItem> getSubMenu()
           
 int getType()
          Returns the type of character menu item.
 String getValue()
           
 int hashCode()
          Returns the hash code value for this instance of the current class.
 void setLabel(String label)
          Sets label that identifies the menu item.
 void setSubMenu(List<MenuItem> subMenu)
           
 void setSubMenu(MenuItem menuItem)
           
 void setValue(String value)
           
 String toString()
          Returns a string description of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AR_DEF_MENU_DELIMITER

public static String AR_DEF_MENU_DELIMITER

AR_DEF_MENU_COMMENT

public static char AR_DEF_MENU_COMMENT

AR_DEF_MENU_LINE_INDENT

public static char AR_DEF_MENU_LINE_INDENT

AR_DEF_MENU_KEYWORD_ESCAPE

public static String AR_DEF_MENU_KEYWORD_ESCAPE

AR_DEF_MENU_KEYWORD_NO_ESCAPE

public static String AR_DEF_MENU_KEYWORD_NO_ESCAPE
Constructor Detail

MenuItem

public MenuItem()

MenuItem

public MenuItem(String label,
                String menuItem)

MenuItem

public MenuItem(String label,
                List<MenuItem> childMenu)
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Clone implementation that returns an Object with data cloned from self.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getType

public int getType()
Returns the type of character menu item. You can return the following constant values:


getLabel

public String getLabel()
Returns label that identifies the menu item.


setLabel

public void setLabel(String label)
Sets label that identifies the menu item.


getContent

public Object getContent()
Returns value associated with the menu item. For leaf-level items, the definition is a string containing the item text. For top- or intermediate-level items, the definition is a pointer to a child menu.


getSubMenu

public List<MenuItem> getSubMenu()

setSubMenu

public void setSubMenu(List<MenuItem> subMenu)

setSubMenu

public void setSubMenu(MenuItem menuItem)

getValue

public String getValue()

setValue

public void setValue(String value)

equals

public boolean equals(Object obj)
Use this method for checking equality between the current object and the provided one. The result is true only if the argument is not null, is of the same type and represents the same content.

Overrides:
equals in class Object
Parameters:
obj - the object that we are comparing to
Returns:
returns a boolean that tells if the two objects equal

hashCode

public int hashCode()
Returns the hash code value for this instance of the current class. This method is supported as required by the general contract of Object.hashCode, for the benefit of hash tables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class Object
Returns:
returns the hash code for this instance

decode

public static List<MenuItem> decode(String encoded)
                             throws ARException
This method converts contents of a string into list menu structure

Throws:
ARException

bufferToMenuItemList

public static List<MenuItem> bufferToMenuItemList(Scanner scanBuffer)
                                           throws ARException
This method converts contents of a buffer/file into list menu structure

Throws:
ARException

toString

public String toString()
Returns a string description of the object.

Overrides:
toString in class Object

AR System Java API

© Copyright 2006, 2007 BMC Software, Inc.