public Iterator<?> iterator(Object entity) { if (cachedPlanningValues != null) { return cachedPlanningValues.iterator(); } else { CountableValueRange<?> valueRange = (CountableValueRange<?>) valueRangeDescriptor.extractValueRange(scoreDirector.getWorkingSolution(), entity); List<?> values = Lists.newArrayList(valueRange.createOriginalIterator()); return values.iterator(); } }
private void initSelectedPlanningValueList(AbstractSolverPhaseScope phaseScope) { if (valueRangeDescriptor.isEntityIndependent()) { CountableValueRange<?> valueRange = (CountableValueRange<?>) ((EntityIndependentValueRangeDescriptor) valueRangeDescriptor) .extractValueRange(phaseScope.getWorkingSolution()); cachedPlanningValues = Lists.newArrayList(valueRange.createOriginalIterator()); } else { cachedPlanningValues = null; } }