private Mode getTheSameMode(Model model, Mode sample) { m: for (Mode m : model.getModes()) { for (Variable v : m.getVars()) { if (v.getVaries()) { Variable v_ = findByName(sample.getVars(), v.getName()); if (!(v.getVariation() == v_.getVariation())) continue m; } } return m; } return null; }
private Variable findByName(List<Variable> list, String name) { for (Variable v : list) { if (v.getName().equals(name)) return v; } return null; }