public int toInt() { int size = 1; int ret = 0; for (int i = 0; i < G.size(); i++) { if (G.get(i)) ret += size; size <<= 1; } return ret; }