Class StringStack


  • public final class StringStack
    extends Object
    This class is a stack to keep in memory the structure of the GPX file.
    Author:
    Erwan Bocher and Antonin Piasco
    • Constructor Detail

      • StringStack

        public StringStack​(int capacity)
        Instantiates a StringStack with chosen max size.
        Parameters:
        capacity - max size
    • Method Detail

      • push

        public boolean push​(String newText)
        Puts string in the stack.
        Parameters:
        newText - A new string to put in the stack
        Returns:
        false if the stack is full
      • pop

        public String pop()
        Removes the last string of the stack.
        Returns:
        the last string of the stack, null if the stack is empty