Skip to content

Commit

Permalink
Add docs for TreeRangeMap, including @since tag for the copyOf
Browse files Browse the repository at this point in the history
…method from cl/682878547.

RELNOTES=n/a
PiperOrigin-RevId: 698541136
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Nov 20, 2024
1 parent 27bb9c2 commit 4d4b29c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions android/guava/src/com/google/common/collect/TreeRangeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ public final class TreeRangeMap<K extends Comparable, V> implements RangeMap<K,

private final NavigableMap<Cut<K>, RangeMapEntry<K, V>> entriesByLowerBound;

/** Returns a new, empty {@link TreeRangeMap}. */
public static <K extends Comparable, V> TreeRangeMap<K, V> create() {
return new TreeRangeMap<>();
}

/**
* Returns a new {@link TreeRangeMap} containing the same ranges as the given {@code RangeMap}.
*
* @since NEXT
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<?>, V> TreeRangeMap<K, V> copyOf(
RangeMap<K, ? extends V> rangeMap) {
Expand Down
6 changes: 6 additions & 0 deletions guava/src/com/google/common/collect/TreeRangeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ public final class TreeRangeMap<K extends Comparable, V> implements RangeMap<K,

private final NavigableMap<Cut<K>, RangeMapEntry<K, V>> entriesByLowerBound;

/** Returns a new, empty {@link TreeRangeMap}. */
public static <K extends Comparable, V> TreeRangeMap<K, V> create() {
return new TreeRangeMap<>();
}

/**
* Returns a new {@link TreeRangeMap} containing the same ranges as the given {@code RangeMap}.
*
* @since NEXT
*/
@SuppressWarnings("unchecked")
public static <K extends Comparable<?>, V> TreeRangeMap<K, V> copyOf(
RangeMap<K, ? extends V> rangeMap) {
Expand Down

0 comments on commit 4d4b29c

Please sign in to comment.