Class SentenceBuilder

java.lang.Object
games.stendhal.common.parser.SentenceBuilder

public final class SentenceBuilder extends Object
This utility class is used to create string representations of sentences by separating words by space characters.
Author:
Martin Fuchs
  • Constructor Details

    • SentenceBuilder

      public SentenceBuilder()
    • SentenceBuilder

      public SentenceBuilder(char separator)
  • Method Details

    • append

      public void append(String s)
      Append string separated by space.
      Parameters:
      s -
    • append

      public void append(char c)
      Directly append the given character.
      Parameters:
      c -
    • appendUntilBreak

      public int appendUntilBreak(Iterator<Expression> it)
      Append a sequence of Expressions until we find a break flag or there is no more Expression.
      Parameters:
      it - Expression iterator
      Returns:
      amount of appended tokens
    • isEmpty

      public boolean isEmpty()
      Check for empty buffer content.
      Returns:
      true, if the builder is empty
    • toString

      public String toString()
      Overrides:
      toString in class Object