Package org.apache.commons.collections.map

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


    }
    public void prepareEventProcessing(Base tag) {
       
       
        SessionContext sessionContext = getSessionContext();
        LinkedMap list = TMLPortlet.getFiredEventsQueue(tag.getPageContext().getSession());
       
        // Look if the event queue proceeded since the last processed event
        if (list.size() > 0) {
            PortletEvent lastEvent = (PortletEvent) list.get(list.lastKey());
            if (lastEvent != null) {
                if (lastEvent.getIndex() > sessionContext.getLastProcessedEventIndex()) {
                   
                    // Find the start index for processing new events
                    Long startIndex;
                    Long lastProcessedIndex = new Long(sessionContext.getLastProcessedEventIndex());
                    if (list.containsKey(lastProcessedIndex)) {
                        startIndex = (Long) list.nextKey(lastProcessedIndex);
                    }
                    else {
                        startIndex = (Long) list.firstKey();
                    }
                   
                    // Set start index as WebTML option
                    tag.getStatus().setOption(Base.OPTION_PORTLET_EVENT_STARTINDEX, new Long(sessionContext.getLastProcessedEventIndex()), null);
                   
View Full Code Here


            throw new WGQueryException("Exception retrieving or parsing feed", query, e);
    }
   
   
    List items = new ArrayList(channel.getItems());
    Map itemMap = new LinkedMap();
    Iterator iter = items.iterator();
   
    while(iter.hasNext()){
      Item item = (Item) iter.next();
      itemMap.put( (new Long(item.getId())).toString() , new ItemWrapper(item) );
      }
    return itemMap;
  }
View Full Code Here

    }

    public void usageTestData() {

        LinkedMap day = new LinkedMap();
        HourStatistic stat = new HourStatistic();

        for (int i = 0; i <= 23; i++) {
            stat.increment();
            day.put(new Integer(i), stat);
        }

        _requestsPerDay.clear();
        _requestsPerDay.put("01.01.2006", day);
        _requestsPerDay.put("02.01.2006", day);
View Full Code Here

            calendar.setTime(date);
       
            String dayKey = DAY_KEY_FORMAT.format(date);
            Map<Integer, HourStatistic> requestsPerHour = (Map<Integer, HourStatistic>) _requestsPerDay.get(dayKey);
            if (requestsPerHour == null) {
                requestsPerHour = new LinkedMap();
                _requestsPerDay.put(dayKey, requestsPerHour);
            }
       
            Integer hourKey = new Integer(calendar.get(GregorianCalendar.HOUR_OF_DAY));
            HourStatistic requestsThisHour = requestsPerHour.get(hourKey);
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<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

     * modifiable.
     */
    private void ensureModifiable() {
        if (nameMap == Collections.EMPTY_MAP) {
            nameMap = new HashMap<Name, Object>();
            entries = new LinkedMap();
        } else if (shared) {
            entries = (LinkedMap) entries.clone();
            nameMap = (Map<Name, Object>) ((HashMap<Name, Object>) nameMap).clone();
            for (Iterator it = nameMap.entrySet().iterator(); it.hasNext(); ) {
                Map.Entry entry = (Map.Entry) it.next();
View Full Code Here

        {
            throw new IllegalArgumentException(
                    "Configuration must not be null!");
        }
        configuration = config;
        layoutData = new LinkedMap();
        config.addConfigurationListener(this);

        if (c != null)
        {
            copyFrom(c);
View Full Code Here

         * Add the given instance to the dirty cache.
         */
        public void addDirty(StateManagerImpl sm) {
            if (_dirty == null) {
                if (_orderDirty)
                    _dirty = MapBackedSet.decorate(new LinkedMap());
                else
                    _dirty = new HashSet();
            }
            if (_dirty.add(sm))
                removeCleanInternal(sm);
View Full Code Here

                    ("savepoint-flush-not-supported"));

            OpenJPASavepoint save = _spm.newSavepoint(name, this);
            if (_savepoints == null || _savepoints.isEmpty()) {
                save.save(getTransactionalStates());
                _savepoints = new LinkedMap();
            } else {
                if (_savepointCache == null)
                    save.save(Collections.EMPTY_LIST);
                else {
                    save.save(_savepointCache);
View Full Code Here

    /**
     * Validate that the types of the parameters are correct.
     */
    private void validateParameters() {
        if (_positional != null) {
            LinkedMap types = _query.getParameterTypes();
            for (int i = 0,
                size = Math.min(_positional.size(), types.size());
                i < size; i++)
                validateParameter(String.valueOf(i),
                    (Class) types.getValue(i), _positional.get(i));
        } else if (_named != null) {
            Map types = _query.getParameterTypes();
            for (Iterator i = _named.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry) i.next();
                String name = (String) entry.getKey();
                validateParameter(name, (Class) types.get(name),
                    entry.getValue());
            }
        }
    }
View Full Code Here

TOP

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

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.