Update of /cvsroot/freenet/freenet/src/freenet/node/rt
In directory sc8-pr-cvs1:/tmp/cvs-serv27635/src/freenet/node/rt

Modified Files:
        RoutingPointStore.java 
Log Message:
Added methods for setting the time values to a maximum and a minumum value.

Index: RoutingPointStore.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/RoutingPointStore.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- RoutingPointStore.java      4 Nov 2003 15:59:26 -0000       1.6
+++ RoutingPointStore.java      4 Nov 2003 16:11:21 -0000       1.7
@@ -246,6 +246,25 @@
                //Default behaviour.. dont care
        }
 
+       public void ensureTimesMax(int maxAllowedTime){
+               for (int i = 0; i < points.length; i++) {
+                       if(points[i].time >maxAllowedTime){
+                               notifyPrePointModified(i);
+                               Core.logger.log(this, "Larger than allowed time 
"+points[i].time+" detected, will use "+maxAllowedTime+" instead", Logger.ERROR);
+                               points[i].time = maxAllowedTime;
+                       }
+               }
+       }
+       public void ensureTimesMin(int minAllowedTime){
+               for (int i = 0; i < points.length; i++) {
+                       if(points[i].time <minAllowedTime){
+                               notifyPrePointModified(i);
+                               Core.logger.log(this, "Smaller than allowed time 
"+points[i].time+" detected, will use "+minAllowedTime+" instead", Logger.ERROR);
+                               points[i].time = minAllowedTime;
+                       }
+               }
+       }
+
        //Returns the offset of the RoutingPoint with the biggest key that's still 
less than n.
        //Caller is responsible for making sure that there is proper synchronization
        //to prevent simultaneous access to 'points'

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to