## net.percederberg.mib.asn1.node
Class Production

    java.lang.Object
      |
      +--net.percederberg.mib.asn1.node.Node
            |
            +--net.percederberg.mib.asn1.node.Production

All Implemented Interfaces:
  NodeConstants, Switchable

public class Production
extends Node

This class represents a production node in the parse tree. A production node is equivalent to a grammar rule (or production), sometimes also referred to as a syntesized node.

Author:
  Per Cederberg, per@percederberg.net

Fields inherited from class net.percederberg.mib.asn1.node.Node
`kind`

Fields inherited from interface net.percederberg.mib.asn1.node.NodeConstants

`ALPHABETCONSTRAINT, ANYTYPE, ASSIGNMENT, ASSIGNMENTLIST, BINARYSTRING, BITSTRINGTYPE, BOOLEANVALUE, BUILTINTYPE, BUILTINVALUE, CHARSTRING, CHOICETYPE, CLASS, CLASSNUMBER, CONSTRAINT, CONSTRAINTLIST, DEFINEDMACRONAME, DEFINEDMACROTYPE, DEFINEDTYPE, DEFINEDVALUE, ELEMENTTYPE, ELEMENTTYPELIST, ENUMERATEDTYPE, EOF, EXPORTS, HEXSTRING, IDENTIFIER, IMPORTS, INTEGERTYPE, LOWERENDPOINT, MACROBODY, MACRODEFINITION, MACROREFERENCE, MODULEBODY, MODULEDEFINITION, MODULEIDENTIFIER, MODULEREFERENCE, NAMEANDNUMBERFORM, NAMEDNUMBER, NAMEDNUMBERLIST, NAMEDTYPE, NAMEDVALUE, NULLVALUE, NUMBER, OBJECTIDENTIFIERVALUE, OBJIDCOMPONENT, OBJIDCOMPONENTLIST, productionNodeName, SELECTIONTYPE, SEQUENCEOFTYPE, SEQUENCETYPE, SETOFTYPE, SETTYPE, SIGNEDNUMBER, SIZECONSTRAINT, SKIPTOEND, SNMPACCESSPART, SNMPDEFVALPART, SNMPDESCRPART, SNMPINDEXPART, SNMPOBJECTTYPEMACROTYPE, SNMPREFERPART, SNMPSTATUSPART, SNMPTRAPTYPEMACROTYPE, SNMPVARPART, SPECIALREALVALUE, START, STRINGTYPE, SYMBOL, SYMBOLLIST, SYMBOLSFROMMODULE, SYMBOLSFROMMODULELIST, TABSENT, TACCESS, TAG, TAGDEFAULT, TAGGEDTYPE, TANY, TAPPLICATION, TASSIGN, TBAR, TBEGIN, TBINSTRING, TBIT, TBOOLEAN, TBY, TCHOICE, TCOMMA, TCOMPONENT, TCOMPONENTS, TCSTRING, TDEFAULT, TDEFINED, TDEFINITIONS, TDEFVAL, TDESCRIPTION, TDOT, TEND, TENTERPRISE, TENUMERATED, TEXPLICIT, TEXPORTS, TFALSE, TFROM, THEXSTRING, TIDENTIFIER, TIMPLICIT, TIMPORTS, TINCLUDES, TINDEX, TINTEGER, TLCASEFIRST_IDENT, TLEFTBRACE, TLEFTBRACKET, TLEFTPAREN, TLESSTHAN, TMACRO, TMAX, TMIN, TMINUS, TMINUS_INFINITY, TNULL, TNUMBER, TOBJECT, TOBJECT_TYPE, TOCTET, TOF, tokenNodeName, TOPTIONAL, TPLUS_INFINITY, TPRESENT, TPRIVATE, TREAL, TREFERENCE, TRIGHTBRACE, TRIGHTBRACKET, TRIGHTPAREN, TSEMI_COLON, TSEQUENCE, TSET, TSIZE, TSTATUS, TSTRING, TSYNTAX, TTAGS, TTRAP_TYPE, TTRUE, TUCASEFIRST_IDENT, TUNIVERSAL, TVARIABLES, TWITH, TYPE, TYPEASSIGNMENT, TYPEORVALUE, TYPEORVALUELIST, TYPEREFERENCE, UPPERENDPOINT, VALUE, VALUEASSIGNMENT, VALUECONSTRAINT, VALUERANGE, VARTYPES`

Constructor Summary
`Production(int kind)` Create a new node without children or parent.
`Production(int kind, Node parent)` Create a new node with the given parent, but without children.

Method Summary
`void` `addChild(Node child)` Adds a child to the node.
`Node` `childAfter(Node child)` Returns the child coming after the given child.
`Node` `childAt(int index)` Returns a child with the given index.
`Node` `childOfType(int type)` Returns the first child of the given type.
`int` `children()` Returns the number of children to the current node.
`int` `childrenOfType(int type)` Returns the number of children of a given type to the current node.
`int` `firstColumn()` Finds the first column for the node.
`int` `firstLine()` Finds the first line for the node.
`int` `lastColumn()` Finds the last column for the node.
`int` `lastLine()` Finds the last line for the node.

Methods inherited from class net.percederberg.mib.asn1.node.Node
`apply, getParent, isAncestor, isParent, isType, setParent, toName, toName, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Production

    public Production(int kind)

  Create a new node without children or parent.
  Parameters:
    `kind` - the kind of node (a node constant value)

### Production

    public Production(int kind,
                      Node parent)

  Create a new node with the given parent, but without children.
  Parameters:
    `kind` - the kind of node
    `parent` - the node parent

Method Detail

### addChild

    public void addChild(Node child)

  Adds a child to the node. The child will be added last, i.e. as the rightmost child.
  Parameters:
    `child` - the child to add

### childAfter

    public Node childAfter(Node child)

  Returns the child coming after the given child.
  Overrides:
    `childAfter` in class `Node`
  Parameters:
    `child` - a child node
  Returns:
    the next child, or null if no next child

### childAt

    public Node childAt(int index)

  Returns a child with the given index.
  Overrides:
    `childAt` in class `Node`
  Parameters:
    `index` - a child index, from 0 to children()-1
  Returns:
    a child node, or null

### childOfType

    public Node childOfType(int type)

  Returns the first child of the given type.
  Overrides:
    `childOfType` in class `Node`
  Parameters:
    `type` - a node type constant value
  Returns:
    a child node, or null

### children

    public int children()

  Returns the number of children to the current node.
  Overrides:
    `children` in class `Node`
  Returns:
    the number of children, or zero for no children

### childrenOfType

    public int childrenOfType(int type)

  Returns the number of children of a given type to the current node.
  Overrides:
    `childrenOfType` in class `Node`
  Parameters:
    `type` - the type number
  Returns:
    the number of children, or zero for no children

### firstLine

    public int firstLine()

  Finds the first line for the node.
  Overrides:
    `firstLine` in class `Node`
  Returns:
    the first line, or -1 if no token present

### firstColumn

    public int firstColumn()

  Finds the first column for the node.
  Overrides:
    `firstColumn` in class `Node`
  Returns:
    the first column, or -1 if no token present

### lastLine

    public int lastLine()

  Finds the last line for the node.
  Overrides:
    `lastLine` in class `Node`
  Returns:
    the last line, or -1 if no token present

### lastColumn

    public int lastColumn()

  Finds the last column for the node.
  Overrides:
    `lastColumn` in class `Node`
  Returns:
    the last column, or -1 if no token present