Package java.util

Examples of java.util.Stack.empty()


        if (parentElement == null) {
            Stack threadStack
                    = (Stack) threadStacks.get(Thread.currentThread());
            if (threadStack != null) {
                if (!threadStack.empty()) {
                    parentElement = (TimedElement) threadStack.peek();
                }
            }
        }
View Full Code Here


   * Returns the namespace URI that a prefix currently maps to
   */
  private String getNamespaceURI(String prefix) {
      // Get the stack associated with this namespace prefix
      final Stack stack = (Stack)_nsPrefixes.get(prefix);
      return (stack != null && !stack.empty()) ? (String) stack.peek()
    : EMPTYSTRING;
  }

  /**
   * Call this when an xml:space attribute is encountered to
View Full Code Here

   * SAX2: End the scope of a prefix-URI Namespace mapping.
   */
  public void endPrefixMapping(String prefix) {
      // Get the stack associated with this namespace prefix
      final Stack stack = (Stack)_nsPrefixes.get(prefix);
      if ((stack != null) && (!stack.empty())) stack.pop();
  }

  /**
   * SAX2: Report an XML comment anywhere in the document.
   */
 
View Full Code Here

        if ((stack = (Stack) m_namespaces.get(prefix)) == null)
        {
            m_namespaces.put(prefix, stack = new Stack());
        }

        if (!stack.empty() && uri.equals(((MappingRecord)stack.peek()).m_uri))
        {
            return false;
        }
        MappingRecord map = new MappingRecord(prefix,uri,elemDepth);
        stack.push(map);
View Full Code Here

        StringBuffer buff = new StringBuffer();
        while (parent != null) {
            stk.push(parent.getName());
            parent = parent.getParent();
        }
        while (!stk.empty()) {
            buff.append("/" + stk.pop());
        }
        buff.append(getName());
        namingContextName = buff.toString();
        }
View Full Code Here

      return;
    }
    Stack stack = new Stack();
    if ( ast != null ) {
      stack.push( ast );
      while (!stack.empty()) {
        ast = (AST) stack.pop();
        strategy.visit( ast );
        if ( ast.getNextSibling() != null )
          stack.push( ast.getNextSibling() );
        if ( ast.getFirstChild() != null )
View Full Code Here

        StringBuffer buff = new StringBuffer();
        while (parent != null) {
            stk.push(parent.getName());
            parent = parent.getParent();
        }
        while (!stk.empty()) {
            buff.append("/" + stk.pop());
        }
        buff.append(getName());
        namingContextName = buff.toString();
        }
View Full Code Here

        // locked subject's children to see if any of them has been
        // locked with an incompatible lock.
        if (token.isInheritable()) {
            Stack childrenStack = new Stack();
            childrenStack.push(initialObject);
            while (!isLocked && !childrenStack.empty()) {
                ObjectNode currentObject = (ObjectNode) childrenStack.pop();
                Uri currentObjectUri =
                    namespace.getUri(slideToken, currentObject.getUri(), false);
                // We test the compatibility of the child
                Enumeration locks = currentObjectUri.getStore()
View Full Code Here

  rtfEmitter.endElement(elem.getNameCode());
  saveStack.push(elem);
  tempStack.push(elem);
      }

      while (!tempStack.empty()) {
  StartElementInfo elem = (StartElementInfo) tempStack.pop();
  elementStack.push(elem);
      }
    }
View Full Code Here

            targetElement.element.setAttribute(TIME_ATTR,
                    DefaultLogger.formatTime(totalTime));

            TimedElement parentElement = null;
            Stack threadStack = getStack();
            if (!threadStack.empty()) {
                TimedElement poppedStack = (TimedElement) threadStack.pop();
                if (poppedStack != targetElement) {
                    throw new RuntimeException("Mismatch - popped element = "
                            + poppedStack.element
                            + " finished target element = "
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.