Package nexj.core.util

Examples of nexj.core.util.HashTab


    * @return A map (String[String]) from Java class name to its scripting type
    *         alias.
    */
   protected Lookup findTypeAliases(List classDocList)
   {
      Lookup typeAliasMap = new HashTab();

      for (Iterator iterator = classDocList.iterator(); iterator.hasNext();)
      {
         ClassDoc classDoc = (ClassDoc)iterator.next();

         if (classDoc.tags(TYPE_ALIAS_TAG).length == 1)
         {
            typeAliasMap.put(classDoc.name(), classDoc.tags(TYPE_ALIAS_TAG)[0].text());
         }
      }

      return typeAliasMap;
   }
View Full Code Here


   {
      // Sort topologically the aspects, the least dependency distance
      // first, and then by name within the aspects with the same distance

      ClassAspect[] aspectArray = new ClassAspect[metadata.getClassAspectCount()];
      Lookup predCountMap = new HashTab(metadata.getClassAspectCount());
      int nStart = 0;
      int nEnd = 0;

      for (Iterator itr = metadata.getClassAspectIterator(); itr.hasNext();)
      {
         ClassAspect aspect = (ClassAspect)itr.next();
         int nCount = aspect.getAspectCount();

         if (nCount == 0)
         {
            aspectArray[nEnd++] = aspect;
         }
         else
         {
            predCountMap.put(aspect, Primitive.createInteger(nCount));
         }
      }

      while (nStart < nEnd)
      {
         Arrays.sort(aspectArray, nStart, nEnd, Named.COMPARATOR);

         int nNewEnd;

         for (nNewEnd = nEnd; nStart < nEnd; ++nStart)
         {
            ClassAspect aspect = aspectArray[nStart];

            for (Iterator itr = metadata.getClassAspectIterator(); itr.hasNext();)
            {
               ClassAspect successor = (ClassAspect)itr.next();

               if (successor.hasAspect(aspect))
               {
                  Integer predCount = (Integer)predCountMap.get(successor);

                  if (predCount != null)
                  {
                     int nPredCount = predCount.intValue();

                     if (--nPredCount == 0)
                     {
                        predCountMap.remove(successor);
                        aspectArray[nNewEnd++] = successor;
                     }
                     else
                     {
                        predCountMap.put(successor, Primitive.createInteger(nPredCount));
                     }
                  }
               }
            }
         }

         nEnd = nNewEnd;
      }

      ExceptionHolder eh = null;

      if (predCountMap.size() != 0)
      {
         for (Iterator itr = predCountMap.iterator(); itr.hasNext();)
         {
            ClassAspect aspect = (ClassAspect)itr.next();
            MetadataValidationException e = new MetadataValidationException("err.meta.classAspectCircularDep",
               new Object[]{aspect.getName()});
View Full Code Here

   {
      verifyNotReadOnly();
     
      if (m_propertyMap == null)
      {
         m_propertyMap = new HashTab(4);
      }

      Object oldValue = m_propertyMap.put(sName, sValue);

      if (oldValue != null)
View Full Code Here

      if (optionArray == null || optionArray.length == 0)
      {
         return 0;
      }

      Lookup optionLookup = new HashTab(optionArray.length);

      for (int i = 0; i < optionArray.length; i++)
      {
         Option option = optionArray[i];

         optionLookup.put(option.getName(), option);
      }

      while (nArg < sArgArray.length)
      {
         String sArg = sArgArray[nArg];

         if (sArg.charAt(0) != '-')
         {
            break;
         }

         nArg++;

         String sName = sArg.substring(1);
         Option option = (Option)optionLookup.get(sName);
         String sValue = option.getValue();

         if (option.isArgRequired())
         {
            if (nArg >= sArgArray.length)
View Full Code Here

   public TransferObject transform(PropertyMap obj, Transformation transformation, Pair arguments) throws IntegrationException
   {
      Logger logger = transformation.getLogger();

      m_output = new TransferObject();
      m_listMap = new HashTab();

      try
      {
         if (logger.isDebugEnabled())
         {
View Full Code Here

               Input in = new ObjectInput(value);
               MessageParser parser;

               if (m_parserMap == null)
               {
                  m_parserMap = new HashTab(m_context.getMetadata().getFormatCount());
               }

               parser = (MessageParser)m_parserMap.get(message.getFormat());

               if (parser == null)
               {
                  parser = (MessageParser)message.getFormat().getParser().getInstance(m_context);
                  m_parserMap.put(message.getFormat(), parser);
               }

               value = parser.parse(in, message);
            }
            else
            {
               ObjectOutput out = new ObjectOutput();
               MessageFormatter formatter;

               if (m_formatterMap == null)
               {
                  m_formatterMap = new HashTab(m_context.getMetadata().getFormatCount());
               }

               formatter = (MessageFormatter)m_formatterMap.get(message.getFormat());

               if (formatter == null)
View Full Code Here

    */
   public void addException(Throwable e, Serializable obj)
   {
      if (m_exceptionMap == null)
      {
         m_exceptionMap = new HashTab();
      }
     
      m_exceptionMap.put(e, obj);
     
      if (getCause() == null)
View Full Code Here

         while (!parents.isEmpty());

      }

      // Keep track of which root directories have been written
      Lookup installDirIdSet = new HashTab();

      // Write out each of the non-subdirectory install directories
      for (Iterator it = m_archiveGroupList.iterator(); it.hasNext();)
      {
         ArchiveGroup archiveGroup = (ArchiveGroup)it.next();
         String sInstallDirId = archiveGroup.getInstallDirId();
         String sSubdir = archiveGroup.getSubdir();

         // Check the install directory
         if (sInstallDirId == null)
         {
            throw new BuildException("Undefined 'installdirid' attribute of archivegroup");
         }

         // Only write each install directory once
         if (sSubdir == null && !installDirIdSet.contains(sInstallDirId))
         {
            // Write out the ID'd top directory
            openDirectoryElement(sInstallDirChild, sInstallDirId);
            closeDirectoryElement();

            installDirIdSet.put(sInstallDirId, null);
         }
      }

      // Write out each of the subdirectory install directories
      openDirectoryElement(sInstallDirChild, identifierFactory.getUniqueId(m_sInstallDirectory));

      for (Iterator it = m_archiveGroupList.iterator(); it.hasNext();)
      {
         ArchiveGroup archiveGroup = (ArchiveGroup)it.next();
         String sInstallDirId = archiveGroup.getInstallDirId();
         String sSubdir = archiveGroup.getSubdir();

         // Only write each install directory once
         if (sSubdir != null && !installDirIdSet.contains(sInstallDirId))
         {
            // Write out the ID'd top directory
            openDirectoryElement(sSubdir, sInstallDirId);
            closeDirectoryElement();

            installDirIdSet.put(sInstallDirId, null);
         }
      }

      closeDirectoryElement();
View Full Code Here

         {
            "EnumTypeDisplay", "EnumUserPickList", "EnumType", "EnumCode",
            "EnumDisplay", "EnumBase", "EnumDependency", "EnumDependencyType"
         };

         whereMap = new HashTab(names.length);

         for (int i = 0; i < names.length; ++i)
         {
            Metaclass metaclass = m_context.getMetadata().findMetaclass(names[i]);
View Full Code Here

      assert sAttribute != null;
      assert t != null;

      if (m_exceptionMap == null)
      {
         m_exceptionMap = new HashTab(4);
      }

      m_exceptionMap.put(sAttribute, t);

      if (getCause() == null && t != this)
View Full Code Here

TOP

Related Classes of nexj.core.util.HashTab

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.