Java Year From getyears(List numberList)

Here you can find the source of getyears(List numberList)

Description

getyears

License

Artistic License

Declaration

public static List<Integer> getyears(List<Long> numberList) 

Method Source Code

//package com.java2s;
//License from project: Artistic License 

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.GregorianCalendar;

import java.util.List;

public class Main {
    /************************************************************************************************************************************/
    public static List<Integer> getyears(List<Long> numberList) {
        List<Integer> returnList = new ArrayList<Integer>();
        Calendar cal = new GregorianCalendar();
        int year = cal.get(Calendar.YEAR);
        int size = numberList.size();
        for (int i = 0; i < size; i++) {
            Long number = (Long) numberList.get(i);
            if ((number > 1980) && (number <= year)) {
                returnList.add(Integer.parseInt(numberList.get(i).toString()));
            }/*  ww w . ja v  a2  s . co m*/
        }
        Collections.sort(returnList);

        return returnList;
    }
}

Related

  1. getYearNumberofdays(String date)
  2. getYearOfDayMark(int day)
  3. getYearOfPreYearWeek(int year, int week)
  4. getYearOfTime(Long time)
  5. getYears(Integer limit)
  6. getYearStart(int year)
  7. getYearStart(long ts)
  8. getYearStartTime()
  9. isInYear(String dateStr, int year)