Tabnine Logo
TIntList.sort
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now