Package java.util

Examples of java.util.Stack.peek()


  if (existing instanceof VariableBase) {
      return((VariableBase)existing);
  }
  else if (existing instanceof Stack) {
      Stack stack = (Stack)existing;
      return((VariableBase)stack.peek());
  }
  return(null);
    }

    public void setXSLTC(XSLTC xsltc) {
View Full Code Here


      if (chain.isEmpty()) {
        // all done
        break outer;
      }

      List grants = (List) chain.peek();
      if (grants.isEmpty()) {
        // pop this list of granted locks and back to the previous one
        rollback(chain);
        continue outer;
      }
View Full Code Here

      if (uriStack.isEmpty()) {
    _sax.startPrefixMapping(prefix, uri);
    uriStack.push(uri);
      }
      else {
    final String lastUri = (String) uriStack.peek();
    if (!lastUri.equals(uri)) {
        _sax.startPrefixMapping(prefix, uri);
        uriStack.push(uri);
    }
    else {
View Full Code Here

    public static IvyContext getContext() {
        Stack cur = getCurrentStack();
        if (cur.isEmpty()) {
            cur.push(new IvyContext());
        }
        return (IvyContext) cur.peek();
    }

    private static Stack/* <IvyContext> */getCurrentStack() {
        Stack cur = (Stack) current.get();
        if (cur == null) {
View Full Code Here

      if (chain.isEmpty()) {
        // all done
        break outer;
      }

      List grants = (List) chain.peek();
      if (grants.isEmpty()) {
        // pop this list of granted locks and back to the previous one
        rollback(chain);
        continue outer;
      }
View Full Code Here

                    }
                } else { // opening tag
                    if (doc.charAt(offset + 1) != '!' && doc.charAt(offset + 1) != '?') {
                        // not a doc tag or xml
                        if (!stack.isEmpty()) { // we found the closing tag before
                            String closedName = (String) stack.peek();
                            if (closedName.equalsIgnoreCase(doc.substring(offset + 1, offset + 1
                                    + closedName.length()))) {
                                stack.pop();
                                continue;
                            }
View Full Code Here

  if (existing instanceof VariableBase) {
      return((VariableBase)existing);
  }
  else if (existing instanceof Stack) {
      Stack stack = (Stack)existing;
      return((VariableBase)stack.peek());
  }
  return(null);
    }

    public void setXSLTC(XSLTC xsltc) {
View Full Code Here

  if ((stack = (Stack)_namespaces.get(prefix)) == null) {
      stack = new Stack();
      _namespaces.put(prefix, stack);
  }
  // Quit now if the URI the prefix currently maps to is the same as this
  if (!stack.empty() && uri.equals(stack.peek())) return;
  // Put this URI on top of the stack for this prefix
  stack.push(uri);

  _prefixStack.push(prefix);
  _nodeStack.push(new Integer(_depth));
View Full Code Here

    /**
     * Use a namespace prefix to lookup a namespace URI
     */
    private String lookupNamespace(String prefix) {
  final Stack stack = (Stack)_namespaces.get(prefix);
  return stack != null && !stack.isEmpty() ? (String)stack.peek() : null;
    }

    /**
     * Send a namespace declaration in the output document. The namespace
     * declaration will not be include if the namespace is already in scope
View Full Code Here

  if (existing instanceof VariableBase) {
      return((VariableBase)existing);
  }
  else if (existing instanceof Stack) {
      Stack stack = (Stack)existing;
      return((VariableBase)stack.peek());
  }
  return(null);
    }

    public void setXSLTC(XSLTC xsltc) {
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.