Skip to content
Browse files

added get(from-to)

  • Loading branch information...
1 parent afe64e1 commit 9dc9fc63aed7520c01839ffcc41519be4a2ed403 @belaban committed Dec 29, 2010
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/org/jgroups/util/RetransmitTable.java
View
17 src/org/jgroups/util/RetransmitTable.java
@@ -4,6 +4,9 @@
import org.jgroups.logging.Log;
import org.jgroups.logging.LogFactory;
+import java.util.LinkedList;
+import java.util.List;
+
/**
* A store for messages to be retransmitted or delivered. Used on sender and receiver side, as a replacement for
* HashMap. RetransmitTable should use less memory than HashMap, as HashMap.Entry has 4 fields, plus arrays for storage.
@@ -174,6 +177,20 @@ public Message get(long seqno) {
}
+ public List<Message> get(long from, long to) {
+ List<Message> retval=null;
+ for(long seqno=from; seqno <= to; seqno++) {
+ Message msg=get(seqno);
+ if(msg != null) {
+ if(retval == null)
+ retval=new LinkedList<Message>();
+ retval.add(msg);
+ }
+ }
+ return retval;
+ }
+
+
/** Removes the message with seqno from the table, nulls the index */
public Message remove(long seqno) {
int row_index=computeRow(seqno);

0 comments on commit 9dc9fc6

Please sign in to comment.
Something went wrong with that request. Please try again.