Package org.apache.commons.collections

Examples of org.apache.commons.collections.ArrayStack


    }

    public void putAll(Map mapToCopy) {
        modified = true;
        if (!localContexts.empty()) {
            ArrayStack entries = (ArrayStack)localContexts.peek();
            for (Iterator keysIterator = mapToCopy.keySet().iterator(); keysIterator.hasNext();) {
                Object key = keysIterator.next();
                entries.push(new DefaultKeyValue(key, mapToCopy.get(key)));
            }
        }

        singleValueMap.putAll(mapToCopy);
        multiValueMap.putAll(mapToCopy);
View Full Code Here


    public void cleanupLocalContext() {
        if (localContexts.empty()) {
            throw new IllegalStateException("Local contexts stack is empty");
        }

        ArrayStack removeEntries = (ArrayStack)localContexts.pop();
        while (!removeEntries.isEmpty()) {
            if (removeEntries.peek() instanceof PathValue) {
                PathValue entry = (PathValue)removeEntries.pop();
                removeAt(entry.getPath(), entry.getValue());
            } else {
                KeyValue entry = (KeyValue)removeEntries.pop();
                Object key = entry.getKey();
                Object value = entry.getValue();

                multiValueMap.remove(key, value);
                if (multiValueMap.containsKey(key)) {
View Full Code Here

            }
        }
    }

    public void markLocalContext() {
        localContexts.push(new ArrayStack());
    }
View Full Code Here

        throws Exception
    {
        this.db = db;
        currentParentId = parentId;
        currentCursor = cursor;
        cursorStack = new ArrayStack();
        parentIdStack = new ArrayStack();
        this.baseId = baseId;
        this.topLevel = topLevel;

      if ( IS_DEBUG )
      {
View Full Code Here

     * go dynamically as the document is parsed.
     *
     * @param prefix Prefix to look up
     */
    public String findNamespaceURI(String prefix) {
        ArrayStack stack = (ArrayStack) namespaces.get(prefix);
        if (stack == null) {
            return (null);
        }
        try {
            return ((String) stack.peek());
        }
        catch (EmptyStackException e) {
            return (null);
        }
    }
View Full Code Here

     * @exception SAXException if a parsing error is to be reported
     */
    public void startPrefixMapping(String prefix, String namespaceURI)
        throws SAXException {
        // Register this prefix mapping
        ArrayStack stack = (ArrayStack) namespaces.get(prefix);
        if (stack == null) {
            stack = new ArrayStack();
            namespaces.put(prefix, stack);
        }
        stack.push(namespaceURI);
       
        if ( elementNamespaces == null ) {
            elementNamespaces = new HashMap();
        }
        elementNamespaces.put(prefix, namespaceURI);
View Full Code Here

     *
     * @exception SAXException if a parsing error is to be reported
     */
    public void endPrefixMapping(String prefix) throws SAXException {
        // Deregister this prefix mapping
        ArrayStack stack = (ArrayStack) namespaces.get(prefix);
        if (stack == null) {
            return;
        }
        try {
            stack.pop();
            if (stack.empty()) {
                namespaces.remove(prefix);
            }
        }
        catch (EmptyStackException e) {
            throw createSAXException("endPrefixMapping popped too many times");
View Full Code Here

        Transaction currentTransaction = transactions.get();
        if (currentTransaction != null)
        {
            if (isolatedTransactions.get() == null)
            {
                isolatedTransactions.set(new ArrayStack());
            }
            isolatedTransactions.get().push(transactions.get());
            transactions.set(null);
        }
    }
View Full Code Here

     * go dynamically as the document is parsed.
     *
     * @param prefix Prefix to look up
     */
    public String findNamespaceURI(String prefix) {
        ArrayStack stack = (ArrayStack) namespaces.get(prefix);
        if (stack == null) {
            return (null);
        }
        try {
            return ((String) stack.peek());
        }
        catch (EmptyStackException e) {
            return (null);
        }
    }
View Full Code Here

     * @exception SAXException if a parsing error is to be reported
     */
    public void startPrefixMapping(String prefix, String namespaceURI)
        throws SAXException {
        // Register this prefix mapping
        ArrayStack stack = (ArrayStack) namespaces.get(prefix);
        if (stack == null) {
            stack = new ArrayStack();
            namespaces.put(prefix, stack);
        }
        stack.push(namespaceURI);

        if ( elementNamespaces == null ) {
            elementNamespaces = new HashMap();
        }
        elementNamespaces.put(prefix, namespaceURI);
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.ArrayStack

Copyright © 2018 www.massapicom. 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.