## edu.stanford.nlp.trees
Interface TreeFactory

All Known Implementing Classes:
  LabeledScoredTreeFactory, SimpleTreeFactory, TreeGraphNodeFactory

    public interface TreeFactory

A `TreeFactory` acts as a factory for creating objects of class `Tree`, or some descendant class. Methods implementing this interface may assume that the `List` of children passed to them is a list that actually contains trees, but this can't be enforced in Java without polymorphic types. The methods with a String argument do not guarantee that the tree label() will be a String -- the TreeFactory may convert it into some other type.

Author:
  Christopher Manning

Method Summary
`Tree` `newLeaf(Label label)` Create a new tree leaf node, with the given label.
`Tree` `newLeaf(String word)` Create a new tree leaf node, where the label is formed from the `String` passed in.
`Tree` `newTreeNode(Label label, List<Tree> children)` Create a new tree nonleaf node, with the given label.
`Tree` `newTreeNode(String parent, List<Tree> children)` Create a new tree nonleaf node, where the label is formed from the `String` passed in.

Method Detail

### newLeaf

    Tree newLeaf(String word)

  Create a new tree leaf node, where the label is formed from the `String` passed in.

  Parameters:
    `word` - The word that will go into the tree label.
  Returns:
    The new leaf

### newTreeNode

    Tree newTreeNode(String parent,
                     List<Tree> children)

  Create a new tree nonleaf node, where the label is formed from the `String` passed in.

  Parameters:
    `parent` - The string that will go into the parent tree label.
    `children` - The list of daughters of this tree. The children may be a (possibly empty) `List` of children or `null`
  Returns:
    The new interior tree node

### newLeaf

    Tree newLeaf(Label label)

  Create a new tree leaf node, with the given label.

  Parameters:
    `label` - The label for the leaf node
  Returns:
    The new leaf

### newTreeNode

    Tree newTreeNode(Label label,
                     List<Tree> children)

  Create a new tree nonleaf node, with the given label.

  Parameters:
    `label` - The label for the parent tree node.
    `children` - The list of daughters of this tree. The children may be a (possibly empty) `List` of children or `null`
  Returns:
    The new interior tree node

Stanford NLP Group