Interface TCharStack

  • All Known Implementing Classes:
    TCharArrayStack

    public interface TCharStack
    A stack of char primitives.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Clears the stack.
      char getNoEntryValue()
      Returns the value that is used to represent null.
      char peek()
      Returns the value at the top of the stack.
      char pop()
      Removes and returns the value at the top of the stack.
      void push​(char val)
      Pushes the value onto the top of the stack.
      int size()
      Returns the current depth of the stack.
      char[] toArray()
      Copies the contents of the stack into a native array.
      void toArray​(char[] dest)
      Copies a slice of the list into a native array.
    • Method Detail

      • getNoEntryValue

        char getNoEntryValue()
        Returns the value that is used to represent null. The default value is generally zero, but can be configured during construction of the collection.
        Returns:
        the value that represents null
      • push

        void push​(char val)
        Pushes the value onto the top of the stack.
        Parameters:
        val - an char value
      • pop

        char pop()
        Removes and returns the value at the top of the stack.
        Returns:
        an char value
      • peek

        char peek()
        Returns the value at the top of the stack.
        Returns:
        an char value
      • size

        int size()
        Returns the current depth of the stack.
      • clear

        void clear()
        Clears the stack.
      • toArray

        char[] toArray()
        Copies the contents of the stack into a native array. Note that this will NOT pop them out of the stack.
        Returns:
        an char[] value
      • toArray

        void toArray​(char[] dest)
        Copies a slice of the list into a native array. Note that this will NOT pop them out of the stack.
        Parameters:
        dest - the array to copy into.