peersim.util
Class StringListParser

java.lang.Object
  extended by peersim.util.StringListParser

public class StringListParser
extends java.lang.Object

This utility class can be used to parse range expressions. In particular, it is used by RangeSimulator to express ranges for configuration properties.

The language for range expression is the following:

   [rangelist] := [range] | [range],[rangelist]
   [range] := value | min:max | min:max|step | 
      min:max*|step
 
where value, min, max and step are numeric atoms that defines ranges.

For example, the following range expression:

   5,9:11,13:17|2,32:128*|2
 
corresponds to 5 (single value), 9-10-11 (range between 9 and 11, default increment 1), 13-15-17 (range between 13 and 17, specified step 2, 32-64-128 (range between 32 and 128, multiplicative step 2).


Method Summary
static java.lang.String[] parseList(java.lang.String s)
          Parse the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseList

public static java.lang.String[] parseList(java.lang.String s)
Parse the specified string.

Parameters:
s - the string to be parsed
Returns:
an array of strings containing all the values defined by the range string