public static InitCount max(InitCount a, InitCount b) { if (MANY.equals(a) || MANY.equals(b)) { return MANY; } if (ONE.equals(a) || ONE.equals(b)) { return ONE; } return ZERO; }
public static InitCount min(InitCount a, InitCount b) { if (ZERO.equals(a) || ZERO.equals(b)) { return ZERO; } if (ONE.equals(a) || ONE.equals(b)) { return ONE; } return MANY; }
static MinMaxInitCount join(MinMaxInitCount initCount1, MinMaxInitCount initCount2) { if (initCount1 == null) { return initCount2; } if (initCount2 == null) { return initCount1; } MinMaxInitCount t = new MinMaxInitCount( InitCount.min(initCount1.getMin(), initCount2.getMin()), InitCount.max(initCount1.getMax(), initCount2.getMax())); return t; }
public int hashCode() { return min.hashCode() * 4 + max.hashCode(); }