Codota Logo
TIntList.sort
Code IndexAdd Codota to your IDE (free)

How to use
sort
method
in
gnu.trove.list.TIntList

Best Java code snippets using gnu.trove.list.TIntList.sort (Showing top 20 results out of 315)

  • Common ways to obtain TIntList
private void myMethod () {
TIntList t =
  • Codota Iconnew TIntArrayList()
  • Codota Iconnew TIntLinkedList()
  • Codota Iconnew TIntArrayList(capacity)
  • Smart code suggestions by Codota
}
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();
gnu.trove.listTIntListsort

Javadoc

Sort the values in the list (ascending) using the Sun quicksort implementation.

Popular methods of TIntList

  • add
    Adds a subset of the values in the array vals to the end of the list, in order.
  • toArray
    Copies a slice of the list into a native array.
  • get
    Returns the value at the specified offset.
  • size
    Returns the number of values in the list.
  • iterator
  • set
    Replace the values in the list starting at offset withlength values from the values array, starting
  • clear
    Flushes the internal state of the list, resetting the capacity to the default.
  • remove
    Removes length values from the list, starting atoffset
  • reverse
    Reverse the order of the elements in the range of the list.
  • max
    Finds the maximum value in the list.
  • min
    Finds the minimum value in the list.
  • isEmpty
    Tests whether this list contains any values.
  • min,
  • isEmpty,
  • fill,
  • removeAt,
  • replace,
  • shuffle,
  • subList,
  • sum,
  • binarySearch

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BoxLayout (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now