class Pattern implements Comparable<Pattern> {

    public boolean matches(int[] tuple) {
        for (int i = 0; i < ids.length; i += 1) {
            int id = ids[i];
            PatternEntry entry = patternEntries[i];
            if (! entry.matches(tuple[id])) {
                return false;
            }
        }
        return true;
    }

    public  Pattern(Map<Integer, PatternEntry> attributes);

}