View Javadoc

1   // %2811187855:hoplugins.commons.utils%
2   package hoplugins.commons.utils;
3   
4   import java.util.StringTokenizer;
5   
6   
7   /***
8    * Utility for Rating Formatting
9    *
10   * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
11   */
12  public final class SeriesUtil {
13      //~ Constructors -------------------------------------------------------------------------------
14  
15      /***
16       * Private default constuctor to prevent class instantiation.
17       */
18      private SeriesUtil() {
19      }
20  
21      //~ Methods ------------------------------------------------------------------------------------
22  
23      /***
24       * TODO Missing Method Documentation
25       *
26       * @param seriesName TODO Missing Method Parameter Documentation
27       *
28       * @return TODO Missing Return Method Documentation
29       */
30      public static int getSeriesLevel(String seriesName) {
31          StringTokenizer st = new StringTokenizer(seriesName, ".");
32          String level = st.nextToken();
33  
34          if (level.equalsIgnoreCase("I")) {
35              return 1;
36          } else if (level.equalsIgnoreCase("II")) {
37              return 2;
38          } else if (level.equalsIgnoreCase("III")) {
39              return 3;
40          } else if (level.equalsIgnoreCase("IV")) {
41              return 4;
42          } else if (level.equalsIgnoreCase("V")) {
43              return 5;
44          } else if (level.equalsIgnoreCase("VI")) {
45              return 6;
46          } else if (level.equalsIgnoreCase("VII")) {
47              return 7;
48          } else if (level.equalsIgnoreCase("VIII")) {
49              return 8;
50          } else if (level.equalsIgnoreCase("IX")) {
51              return 9;
52          } else if (level.equalsIgnoreCase("X")) {
53              return 10;
54          } else if (level.equalsIgnoreCase("XI")) {
55              return 11;
56          } else if (level.equalsIgnoreCase("XII")) {
57              return 12;
58          } else if (level.equalsIgnoreCase("XIII")) {
59              return 13;
60          }
61  
62          return 14;
63      }
64  }