Skip to content

Commit 7ad94e9

Browse files
author
David R. MacIver
committed
add some comments to the effect that the intervals in IntAllocator are inclusive at both ends
1 parent fb86c79 commit 7ad94e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/com/rabbitmq/utility/IntAllocator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public class IntAllocator{
4545
private final int[] unsorted;
4646
private int unsortedCount = 0;
4747

48+
/**
49+
* A class representing an inclusive interval from start to end.
50+
*/
4851
private static class Interval{
4952
Interval(int start, int end){
5053
this.start = start;
@@ -57,6 +60,9 @@ private static class Interval{
5760
int length(){ return end - start + 1; }
5861
}
5962

63+
/**
64+
* Creates an IntAllocator allocating integer IDs within the inclusive range [start, end]
65+
*/
6066
public IntAllocator(int start, int end){
6167
if(start > end) throw new IllegalArgumentException("illegal range [" + start +", " + end + "]");
6268

0 commit comments

Comments
 (0)