@Override
 protected CoursesOfTeacherMatch tupleToMatch(final Tuple t) {
   try {
     return CoursesOfTeacherMatch.newMatch(
         (school.Teacher) t.get(POSITION_T), (school.Course) t.get(POSITION_C));
   } catch (ClassCastException e) {
     LOGGER.error("Element(s) in tuple not properly typed!", e);
     return null;
   }
 }
 @Override
 protected RecordRoleValueMatch tupleToMatch(final Tuple t) {
   try {
     return new RecordRoleValueMatch.Immutable(
         (org.eclipse.incquery.snapshot.EIQSnapshot.MatchRecord) t.get(POSITION_RECORD),
         (org.eclipse.incquery.snapshot.EIQSnapshot.RecordRole) t.get(POSITION_ROLE));
   } catch (ClassCastException e) {
     LOGGER.error("Element(s) in tuple not properly typed!", e);
     return null;
   }
 }
 @Override
 protected RouteSensorMatch tupleToMatch(final Tuple t) {
   try {
     return RouteSensorMatch.newMatch(
         (hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE),
         (hu.bme.mit.trainbenchmark.ttc.railway.Sensor) t.get(POSITION_SENSOR),
         (hu.bme.mit.trainbenchmark.ttc.railway.SwitchPosition) t.get(POSITION_SWITCHPOSITION),
         (hu.bme.mit.trainbenchmark.ttc.railway.Switch) t.get(POSITION_SW));
   } catch (ClassCastException e) {
     LOGGER.error("Element(s) in tuple not properly typed!", e);
     return null;
   }
 }
 public FindConstraint(PositivePatternCall findCons, IPartialPatternCacher treatPatternCacher) {
   this.treatPatternCacher = treatPatternCacher;
   this.innerFindCall = findCons;
   // and affecteds from tuple (order needed!)
   Tuple tup = findCons.getVariablesTuple();
   this.affectedVariables = new ArrayList<PVariable>();
   for (int i = 0; i < tup.getSize(); i++) {
     this.affectedVariables.add((PVariable) tup.get(i));
   }
 }