gnu.trove.list.TIntList.sort()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中gnu.trove.list.TIntList.sort()方法的一些代码示例,展示了TIntList.sort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TIntList.sort()方法的具体详情如下:
包路径:gnu.trove.list.TIntList
类名称:TIntList
方法名:sort

TIntList.sort介绍

[英]Sort the values in the list (ascending) using the Sun quicksort implementation.
[中]使用Sun quicksort实现对列表中的值进行排序(升序)。

代码示例

代码示例来源:origin: alibaba/mdrill

public void sort() {
  synchronized( mutex ) { list.sort(); }
}
public void sort( int fromIndex, int toIndex ) {

代码示例来源:origin: alibaba/mdrill

public void sort( int fromIndex, int toIndex ) {
  synchronized( mutex ) { list.sort( fromIndex, toIndex ); }
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

/**
 * Add a variable number of int arguments or an array of ints to the bag for a given stopcluster.
 * Optionally sort all the entries after a bulk add.
 */
public void add(StopCluster stopCluster, boolean sort, int... time) {
  TIntList times = timesForCluster.get(stopCluster);
  if (times == null) {
    times = new TIntArrayList();
    timesForCluster.put(stopCluster, times);
  }
  times.add(time);
  if (sort) {
    times.sort();
  }
}

代码示例来源:origin: CalebFenton/simplify

removeIndexes.sort();
removeIndexes.reverse();
for (int index : removeIndexes.toArray()) {

代码示例来源:origin: opentripplanner/OpenTripPlanner

/**
 * @param arrivals find arrival times rather than departure times for this Ride.
 * @return a list of sorted departure or arrival times within the window.
 * FIXME this is a hot spot in execution, about 50 percent of runtime.
 */
public TIntList getSortedStoptimes (TimeWindow window, boolean arrivals) {
  // Using Lists because we don't know the length in advance
  TIntList times = new TIntArrayList();
  // TODO include exact-times frequency trips along with non-frequency trips
  // non-exact (headway-based) frequency trips will be handled elsewhere since they don't have specific boarding times.
  for (PatternRide patternRide : patternRides) {
    for (TripTimes tt : patternRide.pattern.scheduledTimetable.tripTimes) {
      if (window.servicesRunning.get(tt.serviceCode)) {
        int t = arrivals ? tt.getArrivalTime(patternRide.toIndex)
                 : tt.getDepartureTime(patternRide.fromIndex);
        if (window.includes(t)) times.add(t);
      }
    }
  }
  times.sort();
  return times;
}

代码示例来源:origin: CalebFenton/simplify

public static <T> void shiftIntegerMapKeys(int startKey, int shift, TIntObjectMap<T> intToObject) {
    if (shift == 0) {
      return;
    }

    TIntList keysToShift = new TIntArrayList(intToObject.keys());
    // Exclude anything before and including startKey
    for (int currentKey : keysToShift.toArray()) {
      if (currentKey <= startKey) {
        keysToShift.remove(currentKey);
      }
    }

    keysToShift.sort();
    if (shift > 0) {
      // Shifting keys up, so start at the end to avoid overwriting keys.
      keysToShift.reverse();
    }

    for (int currentKey : keysToShift.toArray()) {
      T obj = intToObject.get(currentKey);
      intToObject.remove(currentKey);
      intToObject.put(currentKey + shift, obj);
    }
  }
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

break;
case PERCENTILE:
  timeList.sort();
  mins[stop] = timeList.get(timeList.size() / 40);
  maxs[stop] = timeList.get(39 * timeList.size() / 40);

代码示例来源:origin: opentripplanner/OpenTripPlanner

break;
case PERCENTILE:
  timeList.sort();
  mins[target] = timeList.get(timeList.size() / 40);
  maxs[target] = timeList.get(39 * timeList.size() / 40);

代码示例来源:origin: com.palantir.patches.sourceforge/trove3

@Override
public void sort() {
  synchronized( mutex ) { list.sort(); }
}
@Override

代码示例来源:origin: net.sf.trove4j/trove4j

public void sort() {
  synchronized( mutex ) { list.sort(); }
}
public void sort( int fromIndex, int toIndex ) {

代码示例来源:origin: net.sf.trove4j/trove4j

public void sort( int fromIndex, int toIndex ) {
  synchronized( mutex ) { list.sort( fromIndex, toIndex ); }
}

代码示例来源:origin: net.sf.trove4j/core

public void sort() {
  synchronized( mutex ) { list.sort(); }
}
public void sort( int fromIndex, int toIndex ) {

代码示例来源:origin: com.palantir.patches.sourceforge/trove3

@Override
public void sort( int fromIndex, int toIndex ) {
  synchronized( mutex ) { list.sort( fromIndex, toIndex ); }
}

代码示例来源:origin: hernad/easyrec

public void sort() {
  synchronized( mutex ) { list.sort(); }
}
public void sort( int fromIndex, int toIndex ) {

代码示例来源:origin: net.sf.trove4j/core

public void sort( int fromIndex, int toIndex ) {
  synchronized( mutex ) { list.sort( fromIndex, toIndex ); }
}

代码示例来源:origin: hernad/easyrec

public void sort( int fromIndex, int toIndex ) {
  synchronized( mutex ) { list.sort( fromIndex, toIndex ); }
}

代码示例来源:origin: voxelwind/voxelwind

public static List<IntRange> intoRanges(TIntList ids) {
  if (ids.isEmpty()) {
    throw new NoSuchElementException();
  }
  List<IntRange> ranges = new ArrayList<>();
  if (ids.size() == 1) {
    return ImmutableList.of(new IntRange(ids.get(0)));
  }
  ids.sort();
  int start = ids.get(0);
  int cur = start;
  for (int id : ids.subList(1, ids.size()).toArray()) {
    if (cur + 1 == id) {
      cur = id;
    } else {
      ranges.add(new IntRange(start, cur));
      start = id;
      cur = id;
    }
  }
  if (start == cur) {
    ranges.add(new IntRange(start));
  } else {
    ranges.add(new IntRange(start, cur));
  }
  return ranges;
}

代码示例来源:origin: com.conveyal/gtfs-lib

timesAtStop.sort();

代码示例来源:origin: shilad/wikibrain

private int[] getLinks(int pageId1, boolean outLinks) throws DaoException {
  TIntList result = new TIntArrayList();
  for (LocalLink ll : linkDao.getLinks(getLanguage(), pageId1, outLinks)) {
    result.add(ll.getLocalId());
  }
  result.sort();
  return result.toArray();
}

代码示例来源:origin: guokr/simbase

indexes.sort();

相关文章