@Test @Ignore("Not a test.") public void testMergePerformance() throws IOException { Histogram<String> first = new Histogram<>(); Histogram<String> second = new Histogram<>(); Set<String> c1 = uniqueStrings(1000000, 5); Set<String> c2 = uniqueStrings(1000000, 5); Stopwatch sw = Stopwatch.createStarted(); first.add(c1); second.add(c2); System.out.println("Elapsed:" + sw.elapsed(TimeUnit.MILLISECONDS)); sw.reset().start(); first.add(second); System.out.println("Elapsed:" + sw.elapsed(TimeUnit.MILLISECONDS)); }
public int add(T t) { return add(t, 1); }
Histogram implements Iterable<T> { public int add(T t) { return add(t, 1); } }
Histogram implements Iterable<T> { public int add(T t) { return add(t, 1); } Histogram(int initialSize);  Histogram(Map<T, Integer> countMap);  Histogram(); }
Histogram implements Iterable<T> { public int add(T t) { return add(t, 1); } Histogram(int initialSize);  Histogram(Map<T, Integer> countMap);  Histogram(); static Histogram<String> loadFromLines(List<String> lines, char delimiter); static Histogram<String> loadFromLines(
      List<String> lines,
      char delimiter,
      boolean keyComesFirst); static Histogram<String> loadFromUtf8File(Path path, char delimiter); static Histogram<String> loadFromUtf8File(
      Path path,
      char delimiter,
      boolean keyComesFirst); static void serializeStringHistogram(Histogram<String> h, DataOutputStream dos); static Histogram<String> deserializeStringHistogram(DataInputStream dis); void saveSortedByCounts(Path path, String delimiter); void saveSortedByKeys(Path path, String delimiter, Comparator<T> comparator); int add(T t); int add(T t, int count); void add(Histogram<T> otherSet); T lookup(T item); void add(Collection<T> collection); @SafeVarargs final void add(T... array); int size(); void set(T t, int c); int decrementIfPositive(T t); int getCount(T t); boolean contains(T t); List<T> getTop(int n); int removeSmaller(int minCount); int removeLarger(int maxCount); int sizeSmaller(int amount); void remove(T t); void removeAll(Iterable<T> items); int sizeLarger(int amount); long totalCount(int minValue, int maxValue); int maxValue(); int minValue(); List<T> getItemsWithCount(int value); List<T> getItemsWithCount(int min, int max); double countPercent(int min, int max); List<T> getSortedList(); Set<T> getIntersectionOfKeys(Histogram<T> other); List<IntValueMap.Entry<T>> getSortedEntryList(); List<IntValueMap.Entry<T>> getEntryList(); long totalCount(Iterable<T> it); List<T> getSortedList(Comparator<T> comp); Set<T> getKeySet(); Iterator<T> iterator(); long totalCount(); }
Histogram implements Iterable<T> { public int add(T t) { return add(t, 1); } Histogram(int initialSize);  Histogram(Map<T, Integer> countMap);  Histogram(); static Histogram<String> loadFromLines(List<String> lines, char delimiter); static Histogram<String> loadFromLines(
      List<String> lines,
      char delimiter,
      boolean keyComesFirst); static Histogram<String> loadFromUtf8File(Path path, char delimiter); static Histogram<String> loadFromUtf8File(
      Path path,
      char delimiter,
      boolean keyComesFirst); static void serializeStringHistogram(Histogram<String> h, DataOutputStream dos); static Histogram<String> deserializeStringHistogram(DataInputStream dis); void saveSortedByCounts(Path path, String delimiter); void saveSortedByKeys(Path path, String delimiter, Comparator<T> comparator); int add(T t); int add(T t, int count); void add(Histogram<T> otherSet); T lookup(T item); void add(Collection<T> collection); @SafeVarargs final void add(T... array); int size(); void set(T t, int c); int decrementIfPositive(T t); int getCount(T t); boolean contains(T t); List<T> getTop(int n); int removeSmaller(int minCount); int removeLarger(int maxCount); int sizeSmaller(int amount); void remove(T t); void removeAll(Iterable<T> items); int sizeLarger(int amount); long totalCount(int minValue, int maxValue); int maxValue(); int minValue(); List<T> getItemsWithCount(int value); List<T> getItemsWithCount(int min, int max); double countPercent(int min, int max); List<T> getSortedList(); Set<T> getIntersectionOfKeys(Histogram<T> other); List<IntValueMap.Entry<T>> getSortedEntryList(); List<IntValueMap.Entry<T>> getEntryList(); long totalCount(Iterable<T> it); List<T> getSortedList(Comparator<T> comp); Set<T> getKeySet(); Iterator<T> iterator(); long totalCount();  }