Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.Criterion


        }

    };

    private String getNamesHierarchy(Criterion criterion,String etiqueta){
        Criterion parent = criterion.getParent();
        if(parent != null){
            etiqueta = getNamesHierarchy(parent,etiqueta);
            etiqueta = etiqueta.concat(" > ");
        }
        return etiqueta.concat(criterion.getName());
View Full Code Here


        genericResourceAllocation = GenericResourceAllocation.create(task);
    }

    private Set<Criterion> givenPredefinedCriterions() {
        Set<Criterion> result = new HashSet<Criterion>();
        Criterion criterion1 = createNiceMock(Criterion.class);
        setupIsSatisfiedByAll(criterion1);
        Criterion criterion2 = createNiceMock(Criterion.class);
        setupIsSatisfiedByAll(criterion2);
        replay(criterion1, criterion2);
        result.add(criterion1);
        result.add(criterion2);
        this.criterions = result;
View Full Code Here

                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapCriterions.get(type).size(); i++) {
                Criterion criterion = mapCriterions.get(type).get(i);
                addCriterion(type, criterion);
            }
        }
        return getListMatching();
    }
View Full Code Here

    @Test
    public void testSaveConfigurationUnits() throws InstanceNotFoundException {
        final Machine machine = createValidMachine();
        MachineWorkersConfigurationUnit configurationUnit = MachineWorkersConfigurationUnit
                .create(machine, "Operation", new BigDecimal(1));
        final Criterion criterion = CriterionDAOTest.createValidCriterion();
        configurationUnit.addRequiredCriterion(criterion);
        machine.addMachineWorkersConfigurationUnit(configurationUnit);
        transactionService.runOnTransaction(new IOnTransaction<Void>() {
            @Override
            public Void execute() {
                criterionTypeDAO.save(criterion.getType());
                criterionDAO.save(criterion);
                machineDAO.save(machine);
                return null;
            }
        });
View Full Code Here

    private static void addOrCriterionRequirementsEntities(
            ICriterionRequirable criterionRequirable,
            Set<CriterionRequirementDTO> criterionRequirements) {
        for (CriterionRequirementDTO criterionRequirementDTO : criterionRequirements) {
            Criterion criterion = getCriterion(criterionRequirementDTO.name,
                    criterionRequirementDTO.type);
            if (criterion != null) {
                if (criterionRequirementDTO instanceof DirectCriterionRequirementDTO) {
                    DirectCriterionRequirement directCriterionRequirement = getDirectCriterionRequirementByCriterion(
                            criterionRequirable, criterion);
View Full Code Here

        return criterions.get(0);
    }

    public static DirectCriterionRequirement toEntity(
            DirectCriterionRequirementDTO criterionRequirementDTO) {
        Criterion criterion = getCriterion(criterionRequirementDTO.name,
                criterionRequirementDTO.type);
        if (criterion == null) {
            return null;
        }
View Full Code Here

        }
        return false;
    }

    private boolean acceptCriterion(FilterPair filter, Order order) {
        Criterion filterCriterion = (Criterion) filter.getValue();
        if (existCriterionInOrderElement(filterCriterion, order)) {
            return true;
        }
        if (includeOrderElements) {
            for (OrderElement orderElement : order.getAllOrderElements()) {
View Full Code Here

                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < criterionsMap.get(type).size(); i++) {
                Criterion criterion = criterionsMap.get(type).get(i);
                addCriterion(type, criterion);
            }
        }
        return getListMatching();
    }
View Full Code Here

                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapCriterions.get(type).size(); i++) {
                Criterion criterion = mapCriterions.get(type).get(i);
                addCriterion(type, criterion);
            }
        }
        return getListMatching();
    }
View Full Code Here

                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapCriterions.get(type).size(); i++) {
                Criterion criterion = mapCriterions.get(type).get(i);
                addCriterion(type, criterion);
            }
        }
        return getListMatching();
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.Criterion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.