Package nexj.core.util

Examples of nexj.core.util.MultiMap$ValueIterator


    * @param classIter Class meta iterator
    * @return A lookup of ClassMeta arrays keyed by ClassMeta
    */
   public static Lookup createValueInverseDependencyMap(Iterator classIter)
   {
      MultiMap valueInvDepMap = new MultiMap();

      while (classIter.hasNext())
      {
         final ClassMeta clazz = (ClassMeta)classIter.next();

         for (Iterator attrIter = clazz.getAttributeMetaIterator(); attrIter.hasNext();)
         {
            final AttributeMeta startAttr = (AttributeMeta)attrIter.next();

            if (startAttr.isClientCalculable())
            {
               curDep: for (Pair depencies = startAttr.getValueDependencyAssociations(); depencies != null; depencies = depencies
                  .getNext())
               {
                  ClassMeta cur = clazz;

                  for (Pair path = (Pair)depencies.getHead(); path != null; path = path.getNext())
                  {
                     String sAttributeName = (String)path.getHead();
                     AttributeMeta segmentAttr = cur.findAttributeMeta(sAttributeName);

                     if (segmentAttr == null || segmentAttr.isCollection())
                     {
                        continue curDep;
                     }

                     valueInvDepMap.add(segmentAttr, startAttr);

                     if (!(segmentAttr.getType() instanceof ClassMeta))
                     {
                        continue curDep;
                     }

                     cur = (ClassMeta)segmentAttr.getType();
                  }
               }
            }
         }
      }

      Lookup out = new HashTab(valueInvDepMap.keyCount());

      // Transfer to a map of arrays
      for (Lookup.Iterator it = valueInvDepMap.iterator(); it.hasNext();)
      {
         AttributeMeta key = (AttributeMeta)it.next();
         Collection col = (Collection)it.getValue();

         out.put(key, col.toArray(new AttributeMeta[col.size()]));
View Full Code Here


         throw new MetadataException("err.meta.upgradeLoad", new Object[]{sVersion}, e);
      }

      if (m_addedResourceURLMap != null)
      {
         m_resourceAddedMap = new MultiMap(new HashTab(m_addedResourceURLMap.size()));

         for (Iterator itr = m_addedResourceURLMap.iterator(); itr.hasNext(); )
         {
            String sURI = (String)itr.next();
View Full Code Here

TOP

Related Classes of nexj.core.util.MultiMap$ValueIterator

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.