Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.LinkedMap


    /**
     * Record the names and order of implicit parameters.
     */
    private Parameter getParameter(String id, boolean positional) {
        if (parameterTypes == null)
            parameterTypes = new LinkedMap(6);
        if (!parameterTypes.containsKey(id))
            parameterTypes.put(id, TYPE_OBJECT);

        Class type = Object.class;
        ClassMetaData meta = null;
View Full Code Here


    protected void assertParameters(StoreQuery q, StoreQuery.Executor ex,
        Object[] params) {
        if (!q.requiresParameterDeclarations())
            return;

        LinkedMap paramTypes = ex.getParameterTypes(q);
        int typeCount = paramTypes.size();
        if (typeCount > params.length)
            throw new UserException(_loc.get("unbound-params",
                paramTypes.keySet()));

        Iterator itr = paramTypes.entrySet().iterator();
        Map.Entry entry;
        for (int i = 0; itr.hasNext(); i++) {
            entry = (Map.Entry) itr.next();
            if (((Class) entry.getValue()).isPrimitive() && params[i] == null)
                throw new UserException(_loc.get("null-primitive-param",
View Full Code Here

            if (params == null)
                return EMPTY_PARAMS;

            List decs = Filters.parseDeclaration(params, ',', "parameters");
            if (_params == null)
                _params = new LinkedMap((int) (decs.size() / 2 * 1.33 + 1));
            String name;
            Class cls;
            for (int i = 0; i < decs.size(); i += 2) {
                name = (String) decs.get(i);
                cls = ctx.classForName(name, null);
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    private void ensureModifiable() {
        if (nameMap == Collections.EMPTY_MAP) {
            nameMap = new HashMap<Name, Object>();
            entries = new LinkedMap();
        } else if (shared) {
            entries = (LinkedMap) entries.clone();
            nameMap = new HashMap<Name, Object>(nameMap);
            for (Map.Entry<Name, Object> entry : nameMap.entrySet()) {
                Object value = entry.getValue();
View Full Code Here

     * add and remove operations on nodes with the same UUID into a move
     * operation.
     */
    @SuppressWarnings("unchecked")
  private Iterator<HierarchyEvent> consolidateEvents(EventIterator events) {
        LinkedMap eventMap = new LinkedMap();

        while (events.hasNext()) {
            EventImpl event = (EventImpl) events.nextEvent();
            HierarchyEvent he;

            try {
                he = new HierarchyEvent(event.getChildId(),
                        sysSession.getQPath(event.getPath()).getNormalizedPath(),
                        event.getType());
            } catch (MalformedPathException e) {
                log.info("Unable to get event's path: " + e.getMessage());
                continue;
            } catch (RepositoryException e) {
                log.info("Unable to get event's path: " + e.getMessage());
                continue;
            }

            HierarchyEvent heExisting = (HierarchyEvent) eventMap.get(he.id);
            if (heExisting != null) {
                heExisting.merge(he);
            } else {
                eventMap.put(he.id, he);
            }
        }
        return eventMap.values().iterator();
    }
View Full Code Here

     * @param cacheSize
     */
    public ItemInfoCacheImpl(int cacheSize) {
        super();
        this.cacheSize = cacheSize;
        entries = new LinkedMap(cacheSize);
    }
View Full Code Here

     * Consolidate an event iterator obtained from observation, merging
     * add and remove operations on nodes with the same UUID into a move
     * operation.
     */
    private Iterator consolidateEvents(EventIterator events) {
        LinkedMap eventMap = new LinkedMap();

        while (events.hasNext()) {
            EventImpl event = (EventImpl) events.nextEvent();
            HierarchyEvent he;

            try {
                he = new HierarchyEvent(event.getChildId(),
                        resolver.getQPath(event.getPath()).getNormalizedPath(),
                        event.getType());
            } catch (MalformedPathException e) {
                log.info("Unable to get event's path: " + e.getMessage());
                continue;
            } catch (RepositoryException e) {
                log.info("Unable to get event's path: " + e.getMessage());
                continue;
            }

            HierarchyEvent heExisting = (HierarchyEvent) eventMap.get(he.id);
            if (heExisting != null) {
                heExisting.merge(he);
            } else {
                eventMap.put(he.id, he);
            }
        }
        return eventMap.values().iterator();
    }
View Full Code Here

        // map used for lookup by name
        // (key=name, value=either a single entry or a list of sns entries)
        private HashMap nameMap;

        ChildNodeEntries() {
            entries = new LinkedMap();
            nameMap = new HashMap();
        }
View Full Code Here

                out.writeUTF(entry.getId().toString())// id
            }
        }

        private void readObject(ObjectInputStream in) throws IOException {
            entries = new LinkedMap();
            nameMap = new HashMap();
            // important: fields must be read in same order as they are
            // written in writeObject(ObjectOutputStream)
            short count = in.readShort();   // count
            for (int i = 0; i < count; i++) {
View Full Code Here

    protected Object clone() throws CloneNotSupportedException {
        AbstractLayout clone = (AbstractLayout)super.clone();
       
        // we don't clone the parent; we just set it to null
        clone.rendererName = this.rendererName;
        clone.parameters = new LinkedMap(this.parameters);
        clone.parent = null;
       
        return clone;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.LinkedMap

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.