Example usage for org.apache.commons.collections.comparators ReverseComparator ReverseComparator

List of usage examples for org.apache.commons.collections.comparators ReverseComparator ReverseComparator

Introduction

In this page you can find the example usage for org.apache.commons.collections.comparators ReverseComparator ReverseComparator.

Prototype

public ReverseComparator() 

Source Link

Document

Creates a comparator that compares objects based on the inverse of their natural ordering.

Usage

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.teacher.TutorshipMonitoringExecutionYearProvider.java

public static List<ExecutionYear> getExecutionYears(StudentsPerformanceInfoBean bean) {
    List<ExecutionYear> executionYears = new ArrayList<ExecutionYear>();
    for (ExecutionYear year : Bennu.getInstance().getExecutionYearsSet()) {
        if (year.isAfterOrEquals(bean.getStudentsEntryYear())) {
            executionYears.add(year);//from  w ww.j a  va  2s  .  c  o  m
        }
    }
    Collections.sort(executionYears, new ReverseComparator());
    return executionYears;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.ExecutionYearsForDegreeCurricularPlanProvider.java

public static List<ExecutionYear> getExecutionYears(HasDegreeCurricularPlan bean) {
    List<ExecutionYear> executionYears = new ArrayList<ExecutionYear>();
    for (ExecutionYear year : Bennu.getInstance().getExecutionYearsSet()) {
        if (year.isInclusivelyBetween(bean.getDegreeCurricularPlan().getInauguralExecutionYear(),
                bean.getDegreeCurricularPlan().getLastExecutionYear())) {
            executionYears.add(year);//from   w  ww. j  av  a 2s .c  o m
        }
    }
    Collections.sort(executionYears, new ReverseComparator());
    return executionYears;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.OpenExecutionYearsProvider.java

@Override
public Object provide(Object source, Object currentValue) {

    final List<ExecutionYear> executionYears = ExecutionYear.readOpenExecutionYears();
    executionYears.add(ExecutionYear.readCurrentExecutionYear());

    Collections.sort(executionYears, new ReverseComparator());

    return executionYears;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.ExecutionYearsProvider.java

@Override
public Object provide(Object source, Object currentValue) {

    final List<ExecutionYear> executionYears = new ArrayList<ExecutionYear>(
            Bennu.getInstance().getExecutionYearsSet());

    Collections.sort(executionYears, new ReverseComparator());

    return executionYears;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.AllExecutionPeriodsProvider.java

@Override
public Object provide(Object source, Object currentValue) {
    List<ExecutionSemester> executionSemesters = new ArrayList<ExecutionSemester>(
            Bennu.getInstance().getExecutionPeriodsSet());
    Collections.sort(executionSemesters, new ReverseComparator());
    return executionSemesters;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.ExecutionSemestersProvider.java

@Override
public Object provide(Object source, Object currentValue) {

    final List<ExecutionSemester> executionSemesters = new ArrayList<ExecutionSemester>(
            Bennu.getInstance().getExecutionPeriodsSet());

    Collections.sort(executionSemesters, new ReverseComparator());

    return executionSemesters;
}

From source file:com.codecrate.shard.dice.DropDice.java

public int roll() {
    List values = dice.rollIterations();

    //sort from high to low 
    Collections.sort(values, new ReverseComparator());

    int value = 0;
    for (int x = 0; x < dice.getIterations() - drop; x++) {
        value += ((Integer) values.get(x)).intValue();
    }/*from   w  w w.java2 s . c  o  m*/
    return value;
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.phd.coordinator.providers.CurricularCourseDegreeExecutionSemesterProvider.java

@Override
public Object provide(Object source, Object currentValue) {
    final ManageEnrolmentsBean bean = (ManageEnrolmentsBean) source;

    final Collection<ExecutionSemester> result = new TreeSet<ExecutionSemester>(new ReverseComparator());

    for (final ExecutionYear executionYear : bean.getCurricularCourse().getDegreeCurricularPlan()
            .getExecutionYears()) {/*from   w w  w  . j ava2  s.co  m*/
        result.addAll(executionYear.getExecutionPeriodsSet());
    }

    return result;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.ExecutionPeriodsNotClosedPublicProvider.java

@Override
public Object provide(Object source, Object currentValue) {
    final List<ExecutionSemester> result = new ArrayList<ExecutionSemester>();

    for (final ExecutionSemester executionSemester : Bennu.getInstance().getExecutionPeriodsSet()) {
        if (executionSemester.isAfterOrEquals(ExecutionSemester.readMarkSheetManagmentExecutionPeriod())) {
            result.add(executionSemester);
        }// w w w  . ja v  a  2s  .  c  o m
    }

    Collections.sort(result, new ReverseComparator());
    return result;
}

From source file:net.sourceforge.fenixedu.presentationTier.renderers.providers.ExecutionPeriodsForOldMarkSheets.java

@Override
public Object provide(Object source, Object currentValue) {
    final List<ExecutionSemester> result = new ArrayList<ExecutionSemester>();

    for (final ExecutionSemester executionSemester : Bennu.getInstance().getExecutionPeriodsSet()) {
        if (executionSemester.isBefore(ExecutionSemester.readMarkSheetManagmentExecutionPeriod())) {
            result.add(executionSemester);
        }//from  ww  w.ja  v  a  2 s.  c om
    }

    Collections.sort(result, new ReverseComparator());
    return result;
}