Help
Class MyMenu

java.lang.Object
  |
  +--Help.MyMenu

public class MyMenu
extends Object
implements Serializable

This class provides the menus structure. The menu contains a name, text and, if so, an array of submenu.

Version:
1.0
Author:
Sebastien baehni
See Also:
Serialized Form

Field Summary
protected  String name
          The name of the menu.
protected  MyMenu[] subMenu
          The array of sub menu.
protected  String text
          The text of the menu
 
Constructor Summary
MyMenu(String name, String text)
          The other constructor.
MyMenu(String name, String text, MyMenu[] subMenu)
          The main constructor.
 
Method Summary
 boolean hasSubMenu()
          This method return if the menu has sub menu or not.
 String name()
          This method return the name of the menu.
 MyMenu[] subMenu()
          Return the array of submenus of a menu.
 String text()
          This method return the text of the menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name
The name of the menu.

text

protected String text
The text of the menu

subMenu

protected MyMenu[] subMenu
The array of sub menu.
Constructor Detail

MyMenu

public MyMenu(String name,
              String text,
              MyMenu[] subMenu)
The main constructor. It initialises the instances variables with the parameters.
Parameters:
name - The name of the menu.
text - The text of the menu.
subMenu - The array of sub menus.

MyMenu

public MyMenu(String name,
              String text)
The other constructor. This menu has no sub menu.
Parameters:
name - The name of the menu.
text - The text of the menu.
Method Detail

name

public String name()
This method return the name of the menu.
Returns:
The name of the menu.

text

public String text()
This method return the text of the menu.
Returns:
The text of the menu.

hasSubMenu

public boolean hasSubMenu()
This method return if the menu has sub menu or not.
Returns:
True if the menu has sub menu, False otherwise.

subMenu

public MyMenu[] subMenu()
Return the array of submenus of a menu.
Returns:
The sub menus of a menu.