Here you can find the source of getYear(String index)
public static int getYear(String index)
//package com.java2s; //License from project: Open Source License public class Main { public static int getYear(String index) { String[] dateTmp = index.split("-"); return Integer.parseInt(dateTmp[1]); }//from w ww . j a v a 2s.c om }