@@ -0,0 +1,2037 @@
+package task.util.type;%0A%0A/**%0A * Created with IntelliJ IDEA.%0A * User: benjamin%0A * Date: 06/10/13%0A * Time: 15:33%0A * To change this template use File %7C Settings %7C File Templates.%0A */%0Apublic final class Recurrence %7B%0A%0A  public static enum Unit %7B%0A%0A    YEAR('y'),%0A    MONTH('m'),%0A    WEEK('w'),%0A    DAY('d'),%0A    HOUR('h'),%0A    MIN('%5C''),%0A    NONE('-');%0A%0A    public static final String REGEX = %22(Y%7Cy%7CM%7Cm%7CW%7Cw%7CD%7Cd%7CH%7Ch%7C')%22;%0A%0A    private static final Unit%5B%5D _l = %7B YEAR, MONTH, WEEK, DAY, HOUR, MIN %7D;%0A    private static final String _aut = %22ymwdh'%22;%0A%0A    private final char _c;%0A%0A    private Unit(char c) %7B%0A      _c = c;%0A    %7D%0A%0A    public static Unit getInstance(char c) %7B%0A      int i = _aut.indexOf(c);%0A      return i %3C 0 ? NONE : _l%5Bi%5D;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A      return String.valueOf(_c);%0A    %7D%0A%0A  %7D%0A%0A  private static final String REGEX = %22%5C%5Cd+%22 + Unit.REGEX;%0A%0A  public static final Recurrence NONE = new Recurrence(0, Unit.NONE);%0A%0A  private final int  _v;%0A  private final Unit _u;%0A%0A  private Recurrence(int v, Unit u) %7B%0A    _v = v;%0A    _u = u;%0A  %7D%0A%0A  public int value() %7B%0A    return _v;%0A  %7D%0A%0A  public Unit unit() %7B%0A    return _u;%0A  %7D%0A%0A  public boolean isNull() %7B%0A    return _v == 0;%0A  %7D%0A%0A  public boolean eq(Recurrence r) %7B%0A    return r != null && _v == r._v && _u == r._u;%0A  %7D%0A%0A  public boolean ne(Recurrence r) %7B%0A    return !eq(r);%0A  %7D%0A%0A  public static Recurrence getInstance(int v, Unit u) %7B%0A    return (v != 0 && u != Unit.NONE) ? new Recurrence(v, u) : NONE;%0A  %7D%0A%0A  public static Recurrence getInstance(String s, int sign) %7B%0A    if (s == null %7C%7C !s.matches(REGEX)) return NONE;%0A    int l = s.length() - 1;%0A    return getInstance(Parser.toInt(s.substring(0, l)) * sign, Unit.getInstance(s.charAt(l)));%0A  %7D%0A%0A  public static Recurrence getInstance(String s) %7B%0A    return getInstance(s, 1);%0A  %7D%0A%0A  public static boolean isMatched(String s) %7B%0A    return s != null && (s.equals(%22-%22) %7C%7C s.matches(REGEX));%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return (isNull()) ? %22-%22 : String.valueOf(_v) + _u;%0A  %7D%0A%0A%7D%0A

Create Recurrence.java