Tabnine Logo
TIntList.sum
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: alibaba/mdrill

public int sum() { synchronized( mutex ) { return list.sum(); } }
origin: alibaba/mdrill

public int sum()    { return list.sum(); }
origin: com.palantir.patches.sourceforge/trove3

@Override
public int sum() { synchronized( mutex ) { return list.sum(); } }
origin: com.palantir.patches.sourceforge/trove3

@Override
public int sum()    { return list.sum(); }
origin: net.sf.trove4j/trove4j

public int sum()    { return list.sum(); }
origin: net.sf.trove4j/trove4j

public int sum() { synchronized( mutex ) { return list.sum(); } }
origin: net.sf.trove4j/core

public int sum() { synchronized( mutex ) { return list.sum(); } }
origin: net.sf.trove4j/core

public int sum()    { return list.sum(); }
origin: com.conveyal/gtfs-lib

/**
 * Get total revenue time (in seconds) for set of trips.
 * @param trips
 * @return total revenue time (in seconds)
 */
public long getTotalRevenueTimeForTrips (Collection<Trip> trips) {
  TIntList times = new TIntArrayList();
  for (Trip trip : trips) {
    StopTime first;
    StopTime last;
    Spliterator<StopTime> stopTimes = feed.getOrderedStopTimesForTrip(trip.trip_id).spliterator();;
    first = StreamSupport.stream(stopTimes, false)
        .findFirst()
        .orElse(null);
    last = StreamSupport.stream(stopTimes, false)
        .reduce((a, b) -> b)
        .orElse(null);
    if (last != null && first != null) {
      // revenue time should not include layovers at termini
      int time = last.arrival_time - first.departure_time;
      times.add(time);
    }
  }
  return times.sum();
}
origin: stackoverflow.com

 TIntList tt = new TIntArrayList();
tt.add(1);
tt.add(2);
tt.add(3);
int sum = tt.sum();
origin: com.conveyal/gtfs-lib

return deltas.sum() / deltas.size();
gnu.trove.listTIntListsum

Javadoc

Calculates the sum of all the values in the list.

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.
  • sort
    Sort a slice of the list (ascending) using the Sun quicksort implementation.
  • 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.
  • max,
  • min,
  • isEmpty,
  • fill,
  • removeAt,
  • replace,
  • shuffle,
  • subList,
  • binarySearch

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • CodeWhisperer alternatives
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