Package org.apache.commons.collections

Examples of org.apache.commons.collections.MultiHashMap$ValueIterator$Values


   * @return the process maps
   */
  public static Map[] getProcessMaps(int pid)
  {
    Map processMap = new HashMap();
    Map childrenMap = new MultiHashMap();
    Map[] result = new Map[]
    { processMap, childrenMap };

    Pointer processes = MyKernel32.INSTANCE.CreateToolhelp32Snapshot(MyKernel32.TH32CS_SNAPPROCESS, 0);
    if (processes == null)
    {
      System.out.println("note: task list is empty ");
      return result;
    }

    PROCESSENTRY32 me = new PROCESSENTRY32();
    me.szExeFile = new char[MyKernel32.MAX_PATH];
    int size = me.size();
    // System.out.println("size: " + size);
    me.dwSize = size;
    if (MyKernel32.INSTANCE.Process32First(processes, me))
    {
      System.out.println("ProcessList:");
      do
      {
        // System.out.println(/* new String(next.szExeFile) + */" " +
        // me.th32ModuleID + " " + me.th32DefaultHeapID + " " +
        // me.th32ProcessID
        // + " -> " + me.th32ParentProcessID);
        if (me.th32ProcessID > 0)
          processMap.put(new Integer(me.th32ProcessID), me);
        if (me.th32ParentProcessID > 0 && processMap.get(new Integer(me.th32ParentProcessID)) != null)
        {
          childrenMap.put(new Integer(me.th32ParentProcessID), new Integer(me.th32ProcessID));
        }
        System.out.println("\tProcessID=" + me.th32ProcessID + "\t\t -> ParentProcessID=" + me.th32ParentProcessID);

        // else
        // System.out.println("not added");
View Full Code Here


    setState(state);
  }

  public void reset()
  {
    _listeners = Collections.synchronizedMap(new MultiHashMap());
    setState(STATE_IDLE);

  }
View Full Code Here

    }
   
  }

  private static void bindMetaAttributes(Element element, Table table, OverrideRepository repository) {
    MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiHashMap());
    if(map!=null && !map.isEmpty()) {
      repository.addMetaAttributeInfo( table, map);
    }
  }
View Full Code Here

      TableIdentifier tableIdentifier = TableIdentifier.create(table);
      if(table.getColumn(column)!=null) {
        throw new MappingException("Column " + column.getName() + " already exists in table " + tableIdentifier );
      }
     
      MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiHashMap());
      if(map!=null && !map.isEmpty()) {
        repository.addMetaAttributeInfo( tableIdentifier, column.getName(), map);
      }
     
      table.addColumn(column);
View Full Code Here

      filter.setMatchSchema(element.attributeValue("match-schema") );
      filter.setMatchName(element.attributeValue("match-name") );
      filter.setExclude(Boolean.valueOf(element.attributeValue("exclude") ) );
      filter.setPackage(element.attributeValue("package") );
     
      MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiHashMap());
      if(map!=null && !map.isEmpty()) {
        filter.setMetaAttributes( map );
      } else {
        filter.setMetaAttributes( null );       
      }
View Full Code Here

   * @param general
   * @return a MultiMap with all values from local and extra values
   * from inherited
   */
  public static MultiMap mergeMetaMaps(Map specific, Map general) {
    MultiHashMap result = new MultiHashMap();
    MetaAttributeHelper.copyMultiMap(result, specific);
   
    if (general != null) {
      for (Iterator iter = general.keySet().iterator();
        iter.hasNext();
        ) {
        String key = (String) iter.next();
 
        if (!specific.containsKey(key) ) {
          // inheriting a meta attribute only if it is inheritable
          Collection ml = (Collection) general.get(key);
          for (Iterator iterator = ml.iterator();
            iterator.hasNext();
            ) {
            MetaAttributeBinder.SimpleMetaAttribute element = (MetaAttributeBinder.SimpleMetaAttribute) iterator.next();
            if (element.inheritable) {
              result.put(key, element);
            }
          }
        }
      }
    }
View Full Code Here

   *
   * @param element
   * @return MultiMap
   */
   protected static MultiMap loadMetaMap(Element element) {
    MultiMap result = new MultiHashMap();
    List metaAttributeList = new ArrayList();
    metaAttributeList.addAll(element.elements("meta") );

    for (Iterator iter = metaAttributeList.iterator(); iter.hasNext();) {
      Element metaAttrib = (Element) iter.next();
      // does not use getTextNormalize() or getTextTrim() as that would remove the formatting in new lines in items like description for javadocs.
      String attribute = metaAttrib.attributeValue("attribute");
      String value = metaAttrib.getText();
      String inheritStr= metaAttrib.attributeValue("inherit");
      boolean inherit = true;
      if(inheritStr!=null) {
        inherit = Boolean.valueOf(inheritStr).booleanValue();
      }     
     
      MetaAttributeBinder.SimpleMetaAttribute ma = new MetaAttributeBinder.SimpleMetaAttribute(value, inherit);
      result.put(attribute, ma);
    }
    return result;

  }
View Full Code Here

        return true;
    }

    // TODO: don't hardcode initial size
    private void createBlankCache() {
        this.m_eventMMap = new MultiHashMap(100);
        this.m_keyMMap = new MultiHashMap(100);
    }
View Full Code Here

        BaseRequestType gft = (BaseRequestType)getFeature.getParameters()[0];
       
        List featureCollections = results.getFeature();

        //round up the info objects for each feature collection
        MultiHashMap ns2metas = new MultiHashMap();
       
        for (Iterator fc = featureCollections.iterator(); fc.hasNext();) {
            FeatureCollection<SimpleFeatureType, SimpleFeature> features = (FeatureCollection) fc.next();
            SimpleFeatureType featureType = features.getSchema();

            //load the metadata for the feature type
            String namespaceURI = featureType.getName().getNamespaceURI();
            FeatureTypeInfo meta = catalog.getFeatureTypeByName( namespaceURI, featureType.getTypeName() );
            if(meta == null)
                throw new WFSException("Could not find feature type " + namespaceURI + ":" + featureType.getTypeName() + " in the GeoServer catalog");

            NamespaceInfo ns = catalog.getNamespaceByURI( namespaceURI );
            ns2metas.put( ns, meta );
        }

        Collection<FeatureTypeInfo> featureTypes = ns2metas.values();
       
        //create the encoder
        ApplicationSchemaXSD xsd = new ApplicationSchemaXSD( null, catalog, gft.getBaseUrl(),
            org.geotools.wfs.v1_0.WFS.getInstance(), featureTypes );
        Configuration configuration = new ApplicationSchemaConfiguration( xsd, new org.geotools.wfs.v1_0.WFSConfiguration() );
       
        Encoder encoder = new Encoder(configuration);
        //encoder.setEncoding(wfs.getCharSet());
       
       encoder.setSchemaLocation(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE,
               buildSchemaURL(gft.getBaseUrl(), "wfs/1.0.0/WFS-basic.xsd"));

        //declare application schema namespaces
        Map<String, String> params = params("service", "WFS", "version", "1.0.0", "request", "DescribeFeatureType");
        for (Iterator i = ns2metas.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();

            NamespaceInfo ns = (NamespaceInfo) entry.getKey();
            String namespaceURI = ns.getURI();
           
View Full Code Here

            return MultiHashMap.class.equals(type);
        }

        public void marshal(Object source, HierarchicalStreamWriter writer,
                MarshallingContext context) {
            MultiHashMap map = (MultiHashMap) source;
            for (Object v : map.values()) {
                if (v instanceof DataStoreInfo) {
                    writer.startNode("dataStore");
                    context.convertAnother(v);
                    writer.endNode();
                }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.MultiHashMap$ValueIterator$Values

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.