Class CMLModuleStack


  • public class CMLModuleStack
    extends Object
    Low weight alternative to Sun's Stack class.
    Source code:
    main
    Belongs to CDK module:
    io
    Keywords:
    stack
    • Constructor Detail

      • CMLModuleStack

        public CMLModuleStack()
    • Method Detail

      • push

        public void push​(ICMLModule item)
        Adds an entry to the stack.
      • length

        public int length()
      • current

        public ICMLModule current()
        Returns the last added entry.
        See Also:
        pop()
      • toString

        public String toString()
        Returns a String representation of the stack.
        Overrides:
        toString in class Object
      • endsWith

        public boolean endsWith​(ICMLModule lastElement)
        Convenience method to check the last added elements.
      • endsWith

        public boolean endsWith​(ICMLModule oneButLast,
                                ICMLModule lastElement)
        Convenience method to check the last two added elements.
      • endsWith

        public boolean endsWith​(ICMLModule twoButLast,
                                ICMLModule oneButLast,
                                ICMLModule lastElement)
        Convenience method to check the last three added elements.