repOk di MaxIntSet
invariante di rappresentazione per MaxIntSet
// IMaxIntSet (c) = c.size() > 0 ==>
// (c.mass appartiene a aIntSet(c) &&
// per tutti gli x in aIntSet(c), x <= c. mass)
public class MaxIntSet extends IntSet {
// OVERVIEW: un MaxIntSet č un sottotipo di IntSet che lo estende con
private int mass; // l’elemento massimo, se this non č vuoto
public boolean repOk () {
if (!super.rep0k ()) return false;
if (size() == 0) return true;
int z = ((Integer) g.next()).intValue();
if (z > mass) return false;
if (z == mass) found = true; }