コード例 #1
0
  /**
   * Creates a new <code>TByteShortHashMap</code> instance containing all of the entries in the map
   * passed in.
   *
   * @param keys a <tt>byte</tt> array containing the keys for the matching values.
   * @param values a <tt>short</tt> array containing the values.
   */
  public TByteShortHashMap(byte[] keys, short[] values) {
    super(Math.max(keys.length, values.length));

    int size = Math.min(keys.length, values.length);
    for (int i = 0; i < size; i++) {
      this.put(keys[i], values[i]);
    }
  }
コード例 #2
0
  /**
   * Creates a new <code>TIntIntHashMap</code> instance containing all of the entries in the map
   * passed in.
   *
   * @param keys a <tt>int</tt> array containing the keys for the matching values.
   * @param values a <tt>int</tt> array containing the values.
   */
  public TIntIntHashMap(int[] keys, int[] values) {
    super(Math.max(keys.length, values.length));

    int size = Math.min(keys.length, values.length);
    for (int i = 0; i < size; i++) {
      this.put(keys[i], values[i]);
    }
  }
コード例 #3
0
  /**
   * Creates a new <code>TLongFloatHashMap</code> instance containing all of the entries in the map
   * passed in.
   *
   * @param keys a <tt>long</tt> array containing the keys for the matching values.
   * @param values a <tt>float</tt> array containing the values.
   */
  public TLongFloatHashMap(long[] keys, float[] values) {
    super(Math.max(keys.length, values.length));

    int size = Math.min(keys.length, values.length);
    for (int i = 0; i < size; i++) {
      this.put(keys[i], values[i]);
    }
  }
コード例 #4
0
  /**
   * Creates a new <code>TFloatByteHashMap</code> instance containing all of the entries in the map
   * passed in.
   *
   * @param keys a <tt>float</tt> array containing the keys for the matching values.
   * @param values a <tt>byte</tt> array containing the values.
   */
  public TFloatByteHashMap(float[] keys, byte[] values) {
    super(Math.max(keys.length, values.length));

    int size = Math.min(keys.length, values.length);
    for (int i = 0; i < size; i++) {
      this.put(keys[i], values[i]);
    }
  }
コード例 #5
0
 @NotNull
 private static String toVfString(@NotNull Collection<VirtualFile> list) {
   List<VirtualFile> sub = new ArrayList<VirtualFile>(list).subList(0, Math.min(list.size(), 100));
   return list.size()
       + " files: "
       + StringUtil.join(sub, file -> file.getName(), ", ")
       + (list.size() == sub.size() ? "" : "...");
 }
コード例 #6
0
  /**
   * Creates a new <code>TDoubleCharHashMap</code> instance containing all of the entries in the map
   * passed in.
   *
   * @param keys a <tt>double</tt> array containing the keys for the matching values.
   * @param values a <tt>char</tt> array containing the values.
   */
  public TDoubleCharHashMap(double[] keys, char[] values) {
    super(Math.max(keys.length, values.length));

    int size = Math.min(keys.length, values.length);
    for (int i = 0; i < size; i++) {
      this.put(keys[i], values[i]);
    }
  }
コード例 #7
0
 private void queueUnresolvedFilesSinceLastRestart() {
   PersistentFS fs = PersistentFS.getInstance();
   int maxId = FSRecords.getMaxId();
   TIntArrayList list = new TIntArrayList();
   for (int id = fileIsResolved.nextClearBit(1);
       id >= 0 && id < maxId;
       id = fileIsResolved.nextClearBit(id + 1)) {
     int nextSetBit = fileIsResolved.nextSetBit(id);
     int endOfRun = Math.min(maxId, nextSetBit == -1 ? maxId : nextSetBit);
     do {
       VirtualFile virtualFile = fs.findFileById(id);
       if (queueIfNeeded(virtualFile, myProject)) {
         list.add(id);
       } else {
         fileIsResolved.set(id);
       }
     } while (++id < endOfRun);
   }
   log("Initially added to resolve " + toVfString(list.toNativeArray()));
 }