Ejemplo n.º 1
0
 // ***** VDMTOOLS START Name=getCells#1|Object KEEP=NO
 public Set getCells(final Object p) throws CGException {
   sentinel.entering(((BoardLineSentinel) sentinel).getCells);
   try {
     Set res_s_3 = new HashSet();
     {
       Set e1_set_7 = new HashSet(line.values());
       Cell c = null;
       Set tmpSet_21 = new HashSet(e1_set_7);
       for (Iterator enm_20 = tmpSet_21.iterator(); enm_20.hasNext(); ) {
         Cell elem_19 = (Cell) enm_20.next();
         /* c */
         c = elem_19;
         Boolean pred_8 = null;
         if ((pred_8 = Boolean.valueOf(!UTIL.equals((c.piece), null))).booleanValue())
           pred_8 = Boolean.valueOf(UTIL.equals(((c.piece).belongTo), p));
         if (pred_8.booleanValue()) {
           res_s_3.add(c);
         }
       }
     }
     return res_s_3;
   } finally {
     sentinel.leaving(((BoardLineSentinel) sentinel).getCells);
   }
 }
Ejemplo n.º 2
0
 // ***** VDMTOOLS START Name=getSeqCells KEEP=NO
 public List getSeqCells() throws CGException {
   sentinel.entering(((BoardLineSentinel) sentinel).getSeqCells);
   try {
     return getSeqCellsAux(new Integer(1));
   } finally {
     sentinel.leaving(((BoardLineSentinel) sentinel).getSeqCells);
   }
 }
Ejemplo n.º 3
0
 // ***** VDMTOOLS START Name=getCell#1|Number KEEP=NO
 public Cell getCell(final Number r) throws CGException {
   sentinel.entering(((BoardLineSentinel) sentinel).getCell);
   try {
     if (!this.pre_getCell(r).booleanValue()) UTIL.RunTime("Precondition failure in getCell");
     return (Cell) line.get(r);
   } finally {
     sentinel.leaving(((BoardLineSentinel) sentinel).getCell);
   }
 }
Ejemplo n.º 4
0
 // ***** VDMTOOLS START Name=getSeqCellsAux#1|Number KEEP=NO
 private List getSeqCellsAux(final Number x) throws CGException {
   sentinel.entering(((BoardLineSentinel) sentinel).getSeqCellsAux);
   try {
     if (!this.pre_getSeqCellsAux(x).booleanValue())
       UTIL.RunTime("Precondition failure in getSeqCellsAux");
     if (x.intValue() == 9) {
       List tmpSeq_16 = new ArrayList();
       tmpSeq_16.add((Cell) line.get(x));
       return tmpSeq_16;
     } else {
       List rexpr_5 = null;
       List tmpSeq_7 = new ArrayList();
       tmpSeq_7.add((Cell) line.get(x));
       rexpr_5 = new ArrayList(tmpSeq_7);
       rexpr_5.addAll(getSeqCellsAux(new Integer(x.intValue() + 1)));
       return rexpr_5;
     }
   } finally {
     sentinel.leaving(((BoardLineSentinel) sentinel).getSeqCellsAux);
   }
 }
Ejemplo n.º 5
0
 // ***** VDMTOOLS START Name=getEmptyCells KEEP=NO
 public Set getEmptyCells() throws CGException {
   sentinel.entering(((BoardLineSentinel) sentinel).getEmptyCells);
   try {
     Set res_s_2 = new HashSet();
     {
       Set e1_set_6 = new HashSet(line.values());
       Cell c = null;
       Set tmpSet_14 = new HashSet(e1_set_6);
       for (Iterator enm_13 = tmpSet_14.iterator(); enm_13.hasNext(); ) {
         Cell elem_12 = (Cell) enm_13.next();
         /* c */
         c = elem_12;
         if (UTIL.equals((c.piece), null)) {
           res_s_2.add(c);
         }
       }
     }
     return res_s_2;
   } finally {
     sentinel.leaving(((BoardLineSentinel) sentinel).getEmptyCells);
   }
 }