/**
   * Output an instance after filtering and remove from the output queue.
   *
   * @return the instance that has most recently been filtered (or null if the queue is empty).
   * @exception NullPointerException if no output structure has been defined
   */
  public M5Instance output() {

    if (m_OutputFormat == null) {
      throw new NullPointerException("No output instance format defined");
    }
    if (m_OutputQueue.empty()) {
      return null;
    }
    M5Instance result = (M5Instance) m_OutputQueue.pop();
    // Clear out references to old strings occasionally
    if (m_OutputQueue.empty() && m_NewBatch) {
      if (m_OutputStringAtts.length > 0) {
        m_OutputFormat = m_OutputFormat.stringFreeStructure();
      }
    }
    return result;
  }
  /**
   * Output an instance after filtering but do not remove from the output queue.
   *
   * @return the instance that has most recently been filtered (or null if the queue is empty).
   * @exception NullPointerException if no input structure has been defined
   */
  public M5Instance outputPeek() {

    if (m_OutputFormat == null) {
      throw new NullPointerException("No output instance format defined");
    }
    if (m_OutputQueue.empty()) {
      return null;
    }
    M5Instance result = (M5Instance) m_OutputQueue.peek();
    return result;
  }
 // Return true if there is a message in the queue
 public boolean hasMessage() {
   return !messageQueue.empty();
 }