package com.treelight.krnl;

import java.util.LinkedList;
/**
 * A node that stores text, and that's all.
 *
 * @version 0.1
 * @author Eric Armstrong
 * @see ../NodesAndLists.html
 */
public class InlineNode extends ContentNode {
  static final String nodetype = INLINE_NODE;

  // Defined when the node is constructed
  private String name;
  public String getName() { return name; }

  private List contentList;

  /** 
   * Construct a node, specifying the subtype.
   */
  public InlineNode(String name) {
    this.name = name;
  }

  /**
   * Return the node's content string.
   * <p>
   * (Getter, but no setter. We always want to create
   * a new node and do the appropriate versioning.
   */
  public String getContent() {
    return contentList.getContent();
  }  

  public void add(ContentNode node) {
    if (contentList == null) contentList = new LinkedList();
    contentList.add(node);
  }

}//InlineNode
