Example usage for org.apache.commons.collections CollectionUtils select

List of usage examples for org.apache.commons.collections CollectionUtils select

Introduction

In this page you can find the example usage for org.apache.commons.collections CollectionUtils select.

Prototype

public static Collection select(Collection inputCollection, Predicate predicate) 

Source Link

Document

Selects all elements from input collection which match the given predicate into an output collection.

Usage

From source file:net.sourceforge.fenixedu.domain.TeacherCreditsDocument.java

private String getTeacherCreditsFile(Teacher teacher, ExecutionSemester executionSemester,
        TeacherService teacherService) throws ParseException {
    CreditLineDTO creditLineDTO = ReadAllTeacherCredits.readCreditLineDTO(executionSemester, teacher);
    Unit lastWorkingUnit = teacher.getLastWorkingUnit(executionSemester.getBeginDateYearMonthDay(),
            executionSemester.getEndDateYearMonthDay());

    final StringBuilder htmlText = new StringBuilder();
    htmlText.append("<html><body><div style=\"font-family: Arial, Helvetica, sans-serif;font-size: 100%;\">");
    htmlText.append("<style type=\"text/css\">");
    htmlText.append(".tb01 {width: 100%; border-collapse: collapse;font-size: 65%;}");
    htmlText.append(/*from   w w w  . j ava2  s. com*/
            ".tb01 th {background-color: #eee; border: 1pt solid #aaa; height: 1.5em;font-weight: normal; }");
    htmlText.append(".tb01 td { border: 1pt solid #aaa; height: 1.5em;}</style>");

    htmlText.append("<h1 style=\"text-align: center;\">").append(executionSemester.getName()).append(" ")
            .append(executionSemester.getExecutionYear().getYear()).append("</h1>");
    htmlText.append("<table class=\"tb01\"><tr><td><strong>Nome:</strong>")
            .append(teacher.getPerson().getName());
    htmlText.append("</td><td><strong>Username:</strong>").append(teacher.getPerson().getIstUsername());
    htmlText.append("</td></tr><tr><td><strong>Categoria:</strong>");

    ProfessionalCategory categoryByPeriod = teacher.getCategoryByPeriod(executionSemester);
    String category = categoryByPeriod != null ? categoryByPeriod.getName().getContent() : null;
    if (category != null) {
        htmlText.append(category);
    }
    htmlText.append("</td><td><strong>Seco:</strong>");
    if (lastWorkingUnit != null) {
        htmlText.append(lastWorkingUnit.getName());
    }
    htmlText.append("</td></tr><tr><td><strong>Departamento:</strong>");
    if (lastWorkingUnit != null && lastWorkingUnit.getDepartmentUnit() != null
            && lastWorkingUnit.getDepartmentUnit().getDepartment() != null) {
        htmlText.append(lastWorkingUnit.getDepartmentUnit().getDepartment().getRealName());
    }
    htmlText.append("</td><td><strong>Centro de Custo:</strong>");
    if (lastWorkingUnit != null) {
        htmlText.append(lastWorkingUnit.getCostCenterCode());
    }
    htmlText.append("</td></tr></table>");

    htmlText.append("<h3>Resumo de crditos</h3>");
    htmlText.append("<ul style=\"list-style: none; font-size: 65%;\"><li><b>")
            .append(creditLineDTO.getTeachingDegreeCredits())
            .append("</b> (A) - Crditos provenientes de aulas de licenciatura</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getSupportLessonHours())
            .append("</b> (D) - Horas semanais de aulas de dvidas</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getMasterDegreeCredits())
            .append("</b> (M) - Crditos provenientes de aulas de mestrado</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getTfcAdviseCredits())
            .append("</b> (TFC) - Crditos provenientes de alunos de trabalho final de curso</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getThesesCredits())
            .append("</b> (Diss) - Crditos provenientes de Dissertaes</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getInstitutionWorkingHours())
            .append("</b> (P) - Horas semanais de permanncia no " + Unit.getInstitutionAcronym() + "</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getOtherCredits())
            .append("</b> (O) - Crditos enquadrados na categoria outros</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getManagementCredits())
            .append("</b> (CG) - Crditos provenientes de cargos de gesto</li>");
    htmlText.append("<li><b>").append(creditLineDTO.getServiceExemptionCredits())
            .append("</b> (SNE) - Crditos provenientes de situaes em no exerccio</li></ul>");

    htmlText.append("<h3>1) Disciplinas Leccionadas em Graduao</h3>");
    List<Professorship> professorships = teacher.getProfessorships(executionSemester);
    if (professorships.isEmpty()) {
        htmlText.append(
                "<p style=\"font-size: 65%;\">O professor no lecciona nenhuma disciplina neste semestre.</p>");
    } else {
        for (Professorship professorship : professorships) {
            htmlText.append("<p style=\"font-size: 65%;\"><strong>")
                    .append(professorship.getExecutionCourse().getName()).append(" (")
                    .append(professorship.getDegreeSiglas()).append(")</strong></p>");

            htmlText.append("<p style=\"font-size: 65%;\">Aulas:</p>");

            if (professorship.getDegreeTeachingServicesOrderedByShift().isEmpty()) {
                htmlText.append("<p style=\"font-size: 65%;\">No foram encontrados registos de aulas.</p>");
            } else {
                htmlText.append(
                        "<table class=\"tb01\"><tr><th>Turno</th><th>Tipo</th><th>Horas</th><th>% que lecciona</th></tr>");
                for (DegreeTeachingService degreeTeachingService : professorship
                        .getDegreeTeachingServicesOrderedByShift()) {
                    htmlText.append("<tr><td>").append(degreeTeachingService.getShift().getNome())
                            .append("</td>");
                    htmlText.append("<td>").append(degreeTeachingService.getShift().getShiftTypesPrettyPrint())
                            .append("</td>");
                    htmlText.append("<td>").append(degreeTeachingService.getShift().getTotalHours())
                            .append("</td>");
                    htmlText.append("<td>").append(degreeTeachingService.getPercentage()).append("</td></tr>");
                }
                htmlText.append("</table>");
            }

            htmlText.append("<p style=\"font-size: 65%;\">Aulas de dvidas:</p>");

            if (professorship.getSupportLessonsOrderedByStartTimeAndWeekDay().isEmpty()) {
                htmlText.append(
                        "<p style=\"font-size: 65%;\">No foram encontrados registos de aulas de dvidas.</p>");
            } else {

                htmlText.append(
                        "<table class=\"tb01\"><tr><th>Dia da semana</th><th>Incio</th><th>Fim</th><th>Local</th></tr>");
                for (SupportLesson supportLesson : professorship
                        .getSupportLessonsOrderedByStartTimeAndWeekDay()) {
                    htmlText.append("<tr><td>").append(supportLesson.getWeekDay()).append("</td>");
                    htmlText.append("<td>").append(supportLesson.getStartTimeHourMinuteSecond().toString())
                            .append("</td>");
                    htmlText.append("<td>").append(supportLesson.getEndTimeHourMinuteSecond().toString())
                            .append("</td>");
                    htmlText.append("<td>").append(supportLesson.getPlace()).append("</td></tr>");
                }
                htmlText.append("</table>");
            }
        }
    }

    htmlText.append("<h3>2) Disciplinas Leccionadas em Ps-Graduao</h3>");

    if (teacherService == null || teacherService.getMasterDegreeServices().isEmpty()) {
        htmlText.append(
                "<p style=\"font-size: 65%;\">No foram encontrados registos de disciplinas de mestrado.</p>");
    } else {
        htmlText.append(
                "<table class=\"tb01\"><tr><th>Plano(s) curriculare(s)</th><th>Disciplina</th><th>Horas</th><th>Crditos</th></tr>");
        for (TeacherMasterDegreeService teacherMasterDegreeService : teacherService.getMasterDegreeServices()) {
            if (teacherMasterDegreeService.getProfessorship() != null) {
                htmlText.append("<tr><td>")
                        .append(teacherMasterDegreeService.getProfessorship().getDegreePlanNames());
                htmlText.append("</td><td>")
                        .append(teacherMasterDegreeService.getProfessorship().getExecutionCourse().getName());
            } else {
                htmlText.append("<tr><td></td><td>");
            }
            htmlText.append("</td><td>").append(teacherMasterDegreeService.getHours()).append("</td>");
            htmlText.append("<td>").append(teacherMasterDegreeService.getCredits()).append("</td></tr>");
        }
        htmlText.append("</table>");
    }

    if (teacherService != null && teacherService.getTeacherServiceNotes() != null
            && !StringUtils.isEmpty(teacherService.getTeacherServiceNotes().getMasterDegreeTeachingNotes())) {
        htmlText.append("<p style=\"font-size: 65%;\">").append(teacherService.getTeacherServiceNotes()
                .getMasterDegreeTeachingNotes().replaceAll("(\r\n)|(\n)", "<br />")).append("</p>");
    }

    htmlText.append("<h3>3) Trabalhos Finais de Curso (at Ano Lectivo de 2006/2007)</h3>");
    List<TeacherAdviseService> teacherAdviseServices = new ArrayList<TeacherAdviseService>();
    if (teacherService != null) {
        teacherAdviseServices.addAll(teacherService.getTeacherAdviseServices());
    }
    List<TeacherAdviseService> tfcAdvises = (List<TeacherAdviseService>) CollectionUtils
            .select(teacherAdviseServices, new Predicate() {
                @Override
                public boolean evaluate(Object arg0) {
                    TeacherAdviseService teacherAdviseService = (TeacherAdviseService) arg0;
                    return teacherAdviseService.getAdvise().getAdviseType()
                            .equals(AdviseType.FINAL_WORK_DEGREE);
                }
            });

    if (teacherAdviseServices.isEmpty() || tfcAdvises.isEmpty()) {
        htmlText.append(
                "<p style=\"font-size: 65%;\">No foram encontrados registos de alunos de trabalho final de curso.</p>");
    } else {
        Collections.sort(tfcAdvises, new BeanComparator("advise.student.number"));

        htmlText.append(
                "<p style=\"font-size: 65%;\"><strong>Alunos:</strong></p><table class=\"tb01\"><tr><th>Nmero do aluno</th><th>Nome do aluno</th><th>Percentagem</th></tr>");
        for (TeacherAdviseService teacherAdviseService : tfcAdvises) {
            htmlText.append("<tr><td>").append(teacherAdviseService.getAdvise().getStudent().getNumber())
                    .append("</td>");
            htmlText.append("<td>").append(teacherAdviseService.getAdvise().getStudent().getPerson().getName())
                    .append("</td>");
            htmlText.append("<td>").append(teacherAdviseService.getPercentage()).append("</td></tr>");
        }
        htmlText.append("</table>");
    }

    htmlText.append("<h3>4) Dissertaes de Mestrado</h3>");

    Collection<ThesisEvaluationParticipant> thesisEvaluationParticipants = teacher.getPerson()
            .getThesisEvaluationParticipants(executionSemester);

    if (thesisEvaluationParticipants.isEmpty()) {
        htmlText.append("<p style=\"font-size: 65%;\">No foram encontradas Dissertaes de Mestrado.</p>");
    } else {
        htmlText.append(
                "<p style=\"font-size: 65%;\"><strong>Alunos:</strong></p><table class=\"tb01\"><tbody><tr><th style=\"width: 5em;\">Nmero</th><th>Nome</th><th style=\"width: 7em;\">Lecciona (%)</th></tr>");
        for (ThesisEvaluationParticipant participant : thesisEvaluationParticipants) {
            htmlText.append("<tr><td>").append(participant.getThesis().getStudent().getNumber());
            htmlText.append("</td><td>").append(participant.getThesis().getStudent().getPerson().getName());
            htmlText.append("</td><td>").append(participant.getCreditsDistribution()).append("</td></tr>");
        }
        htmlText.append("</tbody></table>");
    }

    if (teacherService != null && teacherService.getTeacherServiceNotes() != null
            && !StringUtils.isEmpty(teacherService.getTeacherServiceNotes().getThesisNote())) {
        htmlText.append("<p style=\"font-size: 65%;\">").append(
                teacherService.getTeacherServiceNotes().getThesisNote().replaceAll("(\r\n)|(\n)", "<br />"))
                .append("</p>");
    }

    htmlText.append("<h3>5) Permanncia no " + Unit.getInstitutionAcronym() + "</h3>");
    ComparatorChain comparatorChain = new ComparatorChain();
    BeanComparator weekDayComparator = new BeanComparator("weekDay");
    BeanComparator startTimeComparator = new BeanComparator("startTime");
    comparatorChain.addComparator(weekDayComparator);
    comparatorChain.addComparator(startTimeComparator);

    List<InstitutionWorkTime> institutionWorkingTimes = new ArrayList<InstitutionWorkTime>();
    if (teacherService != null) {
        institutionWorkingTimes.addAll(teacherService.getInstitutionWorkTimes());
        Collections.sort(institutionWorkingTimes, comparatorChain);
    }

    if (!institutionWorkingTimes.isEmpty()) {
        htmlText.append("<p style=\"font-size: 65%;\">No foram encontrados registos.</p>");
    } else {
        htmlText.append("<table class=\"tb01\"><tr>");

        for (WeekDay weekDay : WeekDay.values()) {
            if (!weekDay.equals(WeekDay.SUNDAY)) {
                htmlText.append("<th style=\"width: 16.5em;\">")
                        .append(BundleUtil.getString(Bundle.ENUMERATION, weekDay.name())).append("</th>");
            }
        }
        htmlText.append("</tr><tr>");
        for (WeekDay weekDay : WeekDay.values()) {
            if (!weekDay.equals(WeekDay.SUNDAY)) {
                htmlText.append("<td style=\"text-align: center;\">");
                for (InstitutionWorkTime institutionWorkTime : institutionWorkingTimes) {
                    if (institutionWorkTime.getWeekDay().equals(weekDay)) {
                        htmlText.append(institutionWorkTime.getStartTimeHourMinuteSecond().toString())
                                .append(" s ")
                                .append(institutionWorkTime.getEndTimeHourMinuteSecond().toString())
                                .append("<br/>");
                    }
                }
                htmlText.append("</td>");
            }
        }
        htmlText.append("</tr></table>");
    }

    htmlText.append("<h3>6) Acumulao de Funes</h3>");
    if (teacherService != null && teacherService.getTeacherServiceNotes() != null
            && !StringUtils.isEmpty(teacherService.getTeacherServiceNotes().getFunctionsAccumulation())) {
        htmlText.append("<p style=\"font-size: 65%;\">").append(teacherService.getTeacherServiceNotes()
                .getFunctionsAccumulation().replaceAll("(\r\n)|(\n)", "<br />")).append("</p>");
    } else {
        htmlText.append(
                "<p style=\"font-size: 65%;\">No foram encontrados registos de acumulao de funes.</p>");
    }

    htmlText.append("<h3>7) Outros</h3>");
    if (teacherService == null || teacherService.getOtherServices().isEmpty()) {
        htmlText.append(
                "<p style=\"font-size: 65%;\">No foram encontrados registos da categoria outros neste semestre.</p>");
    } else {
        htmlText.append("<table class=\"tb01\"><tr><th>Razo</th><th>Crditos</th></tr>");
        for (OtherService otherService : teacherService.getOtherServices()) {
            htmlText.append("<tr><td>").append(otherService.getReason()).append("</td>");
            htmlText.append("<td>").append(otherService.getCredits()).append("</td></tr>");
        }
        htmlText.append("</table>");
    }

    if (teacherService != null && teacherService.getTeacherServiceNotes() != null
            && !StringUtils.isEmpty(teacherService.getTeacherServiceNotes().getOthersNotes())) {
        htmlText.append("<p style=\"font-size: 65%;\">").append(
                teacherService.getTeacherServiceNotes().getOthersNotes().replaceAll("(\r\n)|(\n)", "<br />"))
                .append("</p>");
    }

    htmlText.append("<h3>8) Cargos de Gesto</h3>");
    List<PersonFunction> personFuntions = teacher.getPersonFuntions(
            executionSemester.getBeginDateYearMonthDay(), executionSemester.getEndDateYearMonthDay());

    if (personFuntions.isEmpty()) {
        htmlText.append(
                "<p style=\"font-size: 65%;\">No foram encontrados registos de cargos de gesto.</p>");
    } else {
        Collections.sort(personFuntions, new BeanComparator("beginDate"));
        htmlText.append(
                "<table class=\"tb01\"><tr><th>Cargo</th><th>Unidade</th><th>Crditos</th><th>Incio</th><th>Fim</th></tr>");
        for (PersonFunction personFunction : personFuntions) {
            htmlText.append("<tr><td>").append(personFunction.getFunction().getName());
            htmlText.append("</td><td>").append(personFunction.getParentParty().getName());
            htmlText.append("</td><td>").append(personFunction.getCredits());
            htmlText.append("</td><td>").append(personFunction.getBeginDate());
            htmlText.append("</td><td>").append(personFunction.getEndDate()).append("</td></tr>");
        }
        htmlText.append("</table>");
    }

    if (teacherService != null && teacherService.getTeacherServiceNotes() != null
            && !StringUtils.isEmpty(teacherService.getTeacherServiceNotes().getManagementFunctionNotes())) {
        htmlText.append("<p style=\"font-size: 65%;\">").append(teacherService.getTeacherServiceNotes()
                .getManagementFunctionNotes().replaceAll("(\r\n)|(\n)", "<br />")).append("</p>");
    }

    htmlText.append("<h3>9) Situaes em No Exerccio</h3>");

    Set<PersonContractSituation> serviceExemptions = teacher
            .getValidTeacherServiceExemptions(executionSemester);

    if (serviceExemptions.isEmpty()) {
        htmlText.append(
                "<p style=\"font-size: 65%;\">No foram encontrados registos da categoria situaes em no exerccio.</p>");
    } else {
        htmlText.append(
                "<table class=\"tb01\"><tr><th>Situao</th><th>Organizao</th><th>Incio</th><th>Fim</th></tr>");
        for (PersonContractSituation teacherServiceExemption : serviceExemptions) {
            htmlText.append("<tr><td>")
                    .append(teacherServiceExemption.getContractSituation().getName().getContent());
            htmlText.append("</td><td>").append(teacherServiceExemption.getBeginDate());
            htmlText.append("</td><td>").append(teacherServiceExemption.getServiceExemptionEndDate())
                    .append("</td></tr>");
        }
        htmlText.append("</table>");
    }

    if (teacherService != null && teacherService.getTeacherServiceNotes() != null
            && !StringUtils.isEmpty(teacherService.getTeacherServiceNotes().getServiceExemptionNotes())) {
        htmlText.append("<p style=\"font-size: 65%;\">").append(teacherService.getTeacherServiceNotes()
                .getServiceExemptionNotes().replaceAll("(\r\n)|(\n)", "<br />")).append("</p>");
    }
    htmlText.append("</div></body></html>");

    return htmlText.toString();
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.messaging.AnnouncementsStartPageHandler.java

private Collection<? extends AnnouncementBoard> filterAnnouncementBoardsByLevelAndType(
        HttpServletRequest request, Collection<? extends AnnouncementBoard> announcementBoards,
        final AnnouncementBoardAccessLevel level, final AnnouncementBoardAccessType type) {
    announcementBoards = CollectionUtils.select(announcementBoards,
            new AnnouncementBoard.AcessLevelPredicate(level, Authenticate.getUser()));
    announcementBoards = CollectionUtils.select(announcementBoards,
            new AnnouncementBoard.AcessTypePredicate(type, getLoggedPerson(request)));
    return announcementBoards;
}

From source file:com.frank.search.solr.core.query.FacetOptions.java

/**
 * @return/*w w w  .  j  a v  a  2s  .  c o m*/
 * @since 1.5
 */
@SuppressWarnings("unchecked")
public Collection<FieldWithRangeParameters<?, ?, ?>> getFieldsWithRangeParameters() {
    return (Collection<FieldWithRangeParameters<?, ?, ?>>) CollectionUtils.select(this.facetRangeOnFields,
            new IsFieldWithFacetRangeParametersInstancePredicate());
}

From source file:com.kcs.service.impl.GenerateXmlOtherServiceImpl.java

private List<Datasetopa> filterChildOpa(final Datasetopa main, List<Datasetopa> childList) {
    List<Datasetopa> result = new ArrayList<Datasetopa>();
    final Predicate predicate = new Predicate() {
        @Override//w  ww  . j a  va 2s  .  c  o  m
        public boolean evaluate(Object o) {
            if (Utility.isNotNull(o)) {
                Datasetopa child = (Datasetopa) o;
                boolean result = (objEquals(main.getCustCode(), child.getCustCode())
                        && objEquals(main.getSeq(), child.getSeq())
                        && objEquals(main.getSysCode(), child.getSysCode()));
                return result;
            }
            return false;
        }
    };
    result = (List<Datasetopa>) CollectionUtils.select(childList, predicate);
    return result;
}

From source file:net.sourceforge.fenixedu.domain.candidacyProcess.IndividualCandidacy.java

public List<Formation> getConcludedFormationList() {
    return new ArrayList<Formation>(CollectionUtils.select(getFormationsSet(), new Predicate() {

        @Override/*from   ww  w .j  a v  a 2 s. co m*/
        public boolean evaluate(Object arg0) {
            return ((Formation) arg0).getConcluded();
        }

    }));
}

From source file:net.sourceforge.fenixedu.domain.candidacyProcess.IndividualCandidacy.java

public List<Formation> getNonConcludedFormationList() {
    return new ArrayList<Formation>(CollectionUtils.select(getFormationsSet(), new Predicate() {

        @Override/*  w ww.  ja  v  a 2s.  c  om*/
        public boolean evaluate(Object arg0) {
            return !((Formation) arg0).getConcluded();
        }

    }));
}

From source file:gov.nih.nci.caarray.application.translation.magetab.MageTabTranslatorTest.java

@Test
public void testSpecificationTermCaseSensitivityDocuments() throws Exception {
    final CaArrayFileSet fileSet = TestMageTabSets
            .getFileSet(TestMageTabSets.MAGE_TAB_SPECIFICATION_CASE_SENSITIVITY_INPUT_SET);
    final MageTabDocumentSet docSet = MageTabParser.INSTANCE
            .parse(TestMageTabSets.MAGE_TAB_SPECIFICATION_CASE_SENSITIVITY_INPUT_SET);
    final CaArrayTranslationResult result = this.translator.translate(docSet, fileSet);
    final Collection<Term> terms = result.getTerms();
    @SuppressWarnings("unchecked")
    final Collection<Term> matchingTerms = CollectionUtils.select(terms, new Predicate() {
        public boolean evaluate(Object o) {
            final Term t = (Term) o;
            return t.getValue().equalsIgnoreCase("fresh_sample");
        }/*from w ww.  j  av  a2s  .  c o m*/
    });
    assertTrue(matchingTerms.size() >= 1);
    final Term oneMatch = matchingTerms.iterator().next();
    for (final Term eachMatch : matchingTerms) {
        assertTrue(oneMatch == eachMatch);
    }
}

From source file:net.sourceforge.fenixedu.domain.candidacyProcess.mobility.MobilityApplicationProcess.java

public List<MobilityCoordinator> getErasmusCoordinatorForTeacher(final Teacher teacher) {
    return new ArrayList<MobilityCoordinator>(CollectionUtils.select(getCoordinatorsSet(), new Predicate() {

        @Override/*from  ww w  . jav  a2 s  .co m*/
        public boolean evaluate(Object arg0) {
            return ((MobilityCoordinator) arg0).getTeacher() == teacher;
        }

    }));
}

From source file:com.thoratou.exact.processors.ExactProcessor.java

private PathStep addOrMergePathStep(PathStep pathStep, Collection currentList) {
    PathStep returnStep = null;/*w w w  .  jav a  2 s  . c o m*/
    /*final PathStep finalPathStep = pathStep;
    @SuppressWarnings("unchecked")
    Collection<PathStep> select = CollectionUtils.select(currentList, new Predicate(){
    @Override
    public boolean evaluate(Object o) {
        PathStep ps = (PathStep) o;
        logger.info("compare : "+ps+" * "+finalPathStep);
        return finalPathStep.equals(ps);  //To change body of implemented methods use File | Settings | File Templates.
    }
    });*/
    @SuppressWarnings("unchecked")
    Collection<PathStep> select = CollectionUtils.select(currentList, new EqualPredicate(pathStep));
    if (select.isEmpty()) {
        //logger.info("new path step : "+pathStep);
        //new step => add new one in tree
        currentList.add(pathStep);
        returnStep = pathStep;
    } else if (select.size() == 1) {
        //existing step => merge with existing one
        returnStep = select.iterator().next();
        //logger.info("existing path step : "+pathStep);
    } else {
        logger.log(Level.SEVERE, "internal error, more than one data for the same path step");
        //TODO : exception handling
    }
    return returnStep;
}

From source file:net.jcreate.xkins.Skin.java

/**
 * Devuelve una Collection de templates con los que contengan el group dado en el skin.  
 * @param groupName/*from   ww w. j  av a 2 s  . c  o  m*/
 * @return
 */
public Collection findTemplatesByGroup(final String groupName) {
    return CollectionUtils.select(this.templates.values(), new Predicate() {
        public boolean evaluate(Object arg0) {
            String group = ((Template) arg0).getGroup();
            return groupName.equals(group);
        }
    });
}