Package java.util

Examples of java.util.Stack.peek()


                        }
                    } 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


          //variables or constants are pushed onto the stack
          stack.push(token);
        }
      }
     
      if ((stack.size() == 1) && (!(stack.peek() instanceof Rule))) {
        //while this may be an attempt at creating an expression,
        //for ease of use, convert this single entry to a partial-text
        //match on the MSG field
        Object o = stack.pop();
        stack.push("MSG");
View Full Code Here

        stack.push(o);
        return factory.getRule("~=", stack);
      }

      //stack should contain a single rule if the expression is valid
      if ((stack.size() != 1) || (!(stack.peek() instanceof Rule))) {
        throw new IllegalArgumentException("invalid expression: " + expression);
      } else {
        return (Rule) stack.pop();
      }
    }
View Full Code Here

     */
    public String lookupNamespace(String prefix)
    {
        final Stack stack = (Stack) m_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ?
            ((MappingRecord) stack.peek()).m_uri : null;
    }

    MappingRecord getMappingFromPrefix(String prefix) {
        final Stack stack = (Stack) m_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ?
View Full Code Here

    }

    MappingRecord getMappingFromPrefix(String prefix) {
        final Stack stack = (Stack) m_namespaces.get(prefix);
        return stack != null && !stack.isEmpty() ?
            ((MappingRecord) stack.peek()) : null;
    }

    /**
     * Given a namespace uri, and the namespaces mappings for the
     * current element, return the current prefix for that uri.
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

            String currentLoc = null;
            //-- Wrapper/Location cleanup
            if (wrappers != null) {
                try {
                    while (!wrappers.empty()) {
                        WrapperInfo wInfo = (WrapperInfo)wrappers.peek();
                        if (path != null) {
                            if (wInfo.location.equals(path)) {
                                path = null;
                                break;
                            }
View Full Code Here

        //-- Wrapper/Location cleanup for elements
        if (wrappers != null) {
            try {
                while (!wrappers.empty()) {
                    WrapperInfo wInfo = (WrapperInfo) wrappers.peek();
                    boolean popStack = true;
                    if (nestedAttCount > 0) {
                        for (int na = 0; na < nestedAtts.length; na++) {
                            // TODO[LL]: refactor to avoid check against null
                            if (nestedAtts[na] == null) continue;
View Full Code Here

                                     opr.setLeftChild((infosapient.system.FzyClauseComponent)stack.pop());
                                     stack.push(opr);
                                   }
        fcc = parenClause(r);
                                   if (!stack.isEmpty()) {
                                     if (stack.peek() instanceof infosapient.opr.FzyOperator) {
                                       ((infosapient.opr.FzyOperator)stack.peek()).setRightChild(fcc);
                                     }
                                   }
      }
    {if (true) return((FzyClauseComponent)stack.pop());}
View Full Code Here

                                     stack.push(opr);
                                   }
        fcc = parenClause(r);
                                   if (!stack.isEmpty()) {
                                     if (stack.peek() instanceof infosapient.opr.FzyOperator) {
                                       ((infosapient.opr.FzyOperator)stack.peek()).setRightChild(fcc);
                                     }
                                   }
      }
    {if (true) return((FzyClauseComponent)stack.pop());}
    throw new Error("Missing return statement in function");
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.