Package gnu.trove

Examples of gnu.trove.TIntIntHashMap


        // did we visit some args(<name>) nodes ?

        if (!context.m_exprIndexToTargetIndex.isEmpty()) {

            TIntIntHashMap sourceToTargetArgIndexes = new TIntIntHashMap();

            int index = 0;

            for (Iterator it = m_expressionInfo.getArgumentNames().iterator(); it.hasNext(); index++) {

                String adviceParamName = (String) it.next();

                //look for adviceParamName in the expression name and get its index

                int exprArgIndex = ArgsIndexVisitor.getExprArgIndex(m_expression, adviceParamName);

                if (exprArgIndex < 0) {

                    //param of advice not found in pc signature - f.e. "joinPoint"

                    continue;

                }

                int adviceArgIndex = m_expressionInfo.getArgumentIndex(adviceParamName);

                int targetArgIndex = context.m_exprIndexToTargetIndex.get(exprArgIndex);

                //                System.out.println(" transitive arg" + adviceArgIndex + " " + adviceParamName + " -> " + exprArgIndex

                // + " -> " + targetArgIndex);

                sourceToTargetArgIndexes.put(adviceArgIndex, targetArgIndex);

            }

            context.m_exprIndexToTargetIndex = sourceToTargetArgIndexes;
View Full Code Here


        Boolean match = new Boolean(expression.match(context));

        // update the context mapping from this last visit
        // did we visit some args(<name>) nodes ?
        if (!context.m_exprIndexToTargetIndex.isEmpty()) {
            TIntIntHashMap sourceToTargetArgIndexes = new TIntIntHashMap();
            int index = 0;
            for (Iterator it = m_expressionInfo.getArgumentNames().iterator(); it.hasNext(); index++) {
                String adviceParamName = (String) it.next();
                //look for adviceParamName in the expression name and get its index
                int exprArgIndex = ArgsIndexVisitor.getExprArgIndex(m_expression, adviceParamName);
                if (exprArgIndex < 0) {
                    //param of advice not found in pc signature - f.e. "joinPoint"
                    continue;
                }
                int adviceArgIndex = m_expressionInfo.getArgumentIndex(adviceParamName);
                int targetArgIndex = context.m_exprIndexToTargetIndex.get(exprArgIndex);
                //                System.out.println(" transitive arg" + adviceArgIndex + " " + adviceParamName + " -> " + exprArgIndex
                // + " -> " + targetArgIndex);
                sourceToTargetArgIndexes.put(adviceArgIndex, targetArgIndex);
            }
            context.m_exprIndexToTargetIndex = sourceToTargetArgIndexes;

            //debug:
            //            if (m_expressionInfo.m_isAdviceBindingWithArgs) {
View Full Code Here

    analyzer = new WikipediaAnalyzer();
   
    ids = new int[maxConceptId];
    values = new double[maxConceptId];
   
    inlinkMap = new TIntIntHashMap(300);
  }
View Full Code Here

    assert i > 0 && i % 2 == 0;
    maxLeafNodesInHash = (short) i;

    if (hasCachedMappings) {
      myCachedMappings = new TIntIntHashMap(myCachedMappingsSize = 4 * maxLeafNodes);
    } else {
      myCachedMappings = null;
      myCachedMappingsSize = -1;
    }
  }
View Full Code Here

        //}

        if (defaultSplit) {
          hashLeafData.clean();

          final TIntIntHashMap map = hashLeafData.values;

          final int avg = keys.length / 2;
          medianKey = keys[avg];
          --btree.hashedPagesCount;
          setChildrenCount((short)0);
          newIndexNode.setChildrenCount((short)0);

          for(int i = 0; i < avg; ++i) {
            int key = keys[i];
            insert(key, map.get(key));
            key = keys[avg + i];
            newIndexNode.insert(key, map.get(key));
          }

          /*setHashedLeaf(false);
                  setChildrenCount((short)keys.length);

View Full Code Here

            parent.dump("parent before");
          }
         
          final int childrenCount = getChildrenCount();
          final int[] keys = hashLeafData.keys;
          final TIntIntHashMap map = hashLeafData.values;
         
          for(int i = 0; i < numberOfKeysToMove; ++i) {
            final int key = keys[i];
            sibling.insert(key, map.get(key));
          }
         
          if (doSanityCheck) {
            sibling.dump("Left sibling after");
          }
 
          parent.setKeyAt(indexInParent, keys[numberOfKeysToMove]);
         
          setChildrenCount((short)0);
          --btree.hashedPagesCount;
          hashLeafData.clean();
         
          for(int i = numberOfKeysToMove; i < childrenCount; ++i) {
            final int key = keys[i];
            insert(key, map.get(key));
          }
        } else if (indexInParent + 1 < parent.getChildrenCount()) {
          insertToRightSiblingWhenHashed(parent, hashLeafData, indexInParent, sibling);
        }
      } else if (indexInParent == -1) {
View Full Code Here

          sibling.dump("Offloading to right sibling");
          parent.dump("parent before");
        }

        final int[] keys = hashLeafData.keys;
        final TIntIntHashMap map = hashLeafData.values;

        final int childrenCount = getChildrenCount();
        final int lastChildIndex = childrenCount - numberOfKeysToMove;
        for(int i = lastChildIndex; i < childrenCount; ++i) {
          final int key = keys[i];
          sibling.insert(key, map.get(key));
        }
       
        if (doSanityCheck) {
          sibling.dump("Right sibling after");
        }
        parent.setKeyAt(indexInParent, keys[lastChildIndex]);

        setChildrenCount((short)0);
        --btree.hashedPagesCount;
        hashLeafData.clean();

        for(int i = 0; i < lastChildIndex; ++i) {
          final int key = keys[i];
          insert(key, map.get(key));
        }
      }
    }
View Full Code Here

        final int offset = nodeView.myAddressInBuffer + nodeView.indexToOffset(0);
        final ByteBuffer buffer = nodeView.myBuffer;
       
        keys = new int[recordCount];
        values = new TIntIntHashMap(recordCount);
        int keyNumber = 0;
       
        for(int i = 0; i < btree.hashPageCapacity; ++i) {
          if (nodeView.hashGetState(i) == HASH_FULL) {
            int key = buffer.getInt(offset + i * INTERIOR_SIZE + KEY_OFFSET);
View Full Code Here

  private final TIntIntHashMap mySingle;
  private final TIntObjectHashMap<TIntHashSet> myMulti;


  public IntToIntSetMap(int initialCapacity, float loadfactor) {
    mySingle = new TIntIntHashMap(initialCapacity, loadfactor);
    myMulti = new TIntObjectHashMap<TIntHashSet>(initialCapacity, loadfactor);
  }
View Full Code Here

    for (int i = 0; i < n; i++) { factorsByVar[i] = new ArrayList (); }
    vertexPots = new List [n];
    my2global = new int [n];

    if (projectionMap == null) {
      projectionMap = new TIntIntHashMap (n);
      // projectionMap.setDefaultValue (-1);
    } else {
      projectionMap.ensureCapacity (n);
    }
   
View Full Code Here

TOP

Related Classes of gnu.trove.TIntIntHashMap

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.