Class ClassStack


  • public class ClassStack
    extends java.lang.Object
    Utility class implementing a (typesafe) stack of JavaClass objects.
    See Also:
    Stack
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Stack<JavaClass> stack  
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassStack()
      Constructs a new ClassStack.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean empty()
      Checks if the stack is empty.
      JavaClass pop()
      Pops a JavaClass from the stack.
      void push​(JavaClass clazz)
      Pushes a JavaClass onto the stack.
      JavaClass top()
      Gets the top JavaClass from the stack without removing it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • stack

        private final java.util.Stack<JavaClass> stack
    • Constructor Detail

      • ClassStack

        public ClassStack()
        Constructs a new ClassStack.
    • Method Detail

      • empty

        public boolean empty()
        Checks if the stack is empty.
        Returns:
        true if the stack is empty.
      • pop

        public JavaClass pop()
        Pops a JavaClass from the stack.
        Returns:
        the JavaClass from the top of the stack.
      • push

        public void push​(JavaClass clazz)
        Pushes a JavaClass onto the stack.
        Parameters:
        clazz - the JavaClass to push.
      • top

        public JavaClass top()
        Gets the top JavaClass from the stack without removing it.
        Returns:
        the JavaClass at the top of the stack.