guava icon indicating copy to clipboard operation
guava copied to clipboard

Add RangeMultiMap

Open belugabehr opened this issue 5 years ago • 6 comments

Please consider adding a RangeMultiMap to compliment RangeMap.

One of the restrictions of RangeMap is that it only supports disjoint nonempty ranges. I would like to have access to a RangeMultiMap to track event times. Events can take place on a Range of dates. I would like to be able to supply a single date and get back a list of all the events that were occurring during that date.

belugabehr avatar Aug 26 '20 15:08 belugabehr

#1778

belugabehr avatar Aug 26 '20 15:08 belugabehr

To be clear, is this request distinct from #1778?

netdpb avatar Aug 26 '20 20:08 netdpb

@netdpb I do not think it's the same. I think it may be related though. I am looking for a Map:

interface RangeMultiMap <K extends Comparable, V>
{
  int size();
  boolean isEmpty();
  ...
  // Returns all values which have a range that contains Key
  Collection<V> get(K key)

  // Returns all values which have a range that overlaps with key (can combine method by using Range.singleton(C))
  Collection<V> get(Range<K> key)
}

belugabehr avatar Aug 26 '20 20:08 belugabehr

Hi, can I work on this issue?

mghildiy avatar Jan 02 '21 09:01 mghildiy

Hi, can I work on this issue?

yonghao97 avatar Oct 21 '22 01:10 yonghao97

Hi, can I work on this issue?

Probably not. Guava does not usually accept much code via PRs, especially not when a new API is involved. And especially especially not if it's not clear the proposed thing is something the Google team even wants in their library. in this specific case, there's an ongoing discussion about this being similar to #1778.

Ergo, first finish the discussion, then think about coding things up. You're unlikely to get things into Guava nowadays.

JanecekPetr avatar Oct 24 '22 09:10 JanecekPetr