BSHPackageDeclaration (BeanShell 2.0b6)
Date: 2016-09-25

bsh

## Class BSHPackageDeclaration

- java.lang.Object
- - bsh.BSHPackageDeclaration

-     public class BSHPackageDeclaration
      extends java.lang.Object

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected bsh.Node[]` | `children`
    `protected int` | `id`
    `static bsh.SimpleNode` | `JAVACODE`
    `protected bsh.Node` | `parent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BSHPackageDeclaration(int id)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dump(java.lang.String prefix)`
    `java.lang.Object` | `eval(CallStack callstack, Interpreter interpreter)` This is the general signature for evaluation of a node.
    `bsh.SimpleNode` | `getChild(int i)`
    `int` | `getLineNumber()` Get the line number of the starting token
    `java.lang.String` | `getSourceFile()` Get the name of the source file (or more generally source) of the text from which this node was parsed.
    `java.lang.String` | `getText()` Get the text of the tokens comprising this node.
    `void` | `jjtAddChild(bsh.Node n, int i)` This method tells the node to add its argument to the node's list of children.
    `void` | `jjtClose()` This method is called after all the child nodes have been added.
    `bsh.Node` | `jjtGetChild(int i)` This method returns a child node.
    `int` | `jjtGetNumChildren()` Return the number of children the node has.
    `bsh.Node` | `jjtGetParent()`
    `void` | `jjtOpen()` This method is called after the node has been made the current node.
    `void` | `jjtSetParent(bsh.Node n)` This pair of methods are used to inform the node of its parent.
    `void` | `prune()` Detach this node from its parent.
    `void` | `setSourceFile(java.lang.String sourceFile)` Set the name of the source file (or more generally source) of the text from which this node was parsed.
    `java.lang.String` | `toString()`
    `java.lang.String` | `toString(java.lang.String prefix)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### JAVACODE

          public static bsh.SimpleNode JAVACODE

    - #### parent

          protected bsh.Node parent

    - #### children

          protected bsh.Node[] children

    - #### id

          protected int id

  - ### Constructor Detail

    - #### BSHPackageDeclaration

          public BSHPackageDeclaration(int id)

  - ### Method Detail

    - #### eval

          public java.lang.Object eval(CallStack callstack,
                              Interpreter interpreter)
                                throws EvalError

      This is the general signature for evaluation of a node.
      Throws:
        `EvalError`

    - #### jjtOpen

          public void jjtOpen()

      This method is called after the node has been made the current node. It indicates that child nodes can now be added to it.

    - #### jjtClose

          public void jjtClose()

      This method is called after all the child nodes have been added.

    - #### jjtSetParent

          public void jjtSetParent(bsh.Node n)

      This pair of methods are used to inform the node of its parent.

    - #### jjtGetParent

          public bsh.Node jjtGetParent()

    - #### jjtAddChild

          public void jjtAddChild(bsh.Node n,
                         int i)

      This method tells the node to add its argument to the node's list of children.

    - #### jjtGetChild

          public bsh.Node jjtGetChild(int i)

      This method returns a child node. The children are numbered from zero, left to right.

    - #### getChild

          public bsh.SimpleNode getChild(int i)

    - #### jjtGetNumChildren

          public int jjtGetNumChildren()

      Return the number of children the node has.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString(java.lang.String prefix)

    - #### dump

          public void dump(java.lang.String prefix)

    - #### prune

          public void prune()

      Detach this node from its parent. This is primarily useful in node serialization. (see BSHMethodDeclaration)

    - #### setSourceFile

          public void setSourceFile(java.lang.String sourceFile)

      Set the name of the source file (or more generally source) of the text from which this node was parsed.

    - #### getSourceFile

          public java.lang.String getSourceFile()

      Get the name of the source file (or more generally source) of the text from which this node was parsed. This will recursively search up the chain of parent nodes until a source is found or return a string indicating that the source is unknown.

    - #### getLineNumber

          public int getLineNumber()

      Get the line number of the starting token

    - #### getText

          public java.lang.String getText()

      Get the text of the tokens comprising this node.

? 2000-2005 pat@pat.net :-)