private static int categorizeByYear2014Method(Context c){
  ArrayList<Integer> componentYears=new ArrayList<Integer>();
  conditionallyAdd(componentYears,getNumCoresYear());
  conditionallyAdd(componentYears,getClockSpeedYear());
  conditionallyAdd(componentYears,getRamYear(c));
  if (componentYears.isEmpty())   return CLASS_UNKNOWN;
  Collections.sort(componentYears);
  if ((componentYears.size() & 0x01) == 1) {
    return componentYears.get(componentYears.size() / 2);
  }
 else {
    int baseIndex=componentYears.size() / 2 - 1;
    return componentYears.get(baseIndex) + (componentYears.get(baseIndex + 1) - componentYears.get(baseIndex)) / 2;
  }
}

private static int categorizeByYear2014Method ( Context c ) { ArrayList < Integer > componentYears = new ArrayList < Integer > ( ) ; conditionallyAdd ( componentYears , getNumCoresYear ( ) ) ; conditionallyAdd ( componentYears , getClockSpeedYear ( ) ) ; conditionallyAdd ( componentYears , getRamYear ( c ) ) ; if ( componentYears . isEmpty ( ) ) return CLASS_UNKNOWN ; Collections . sort ( componentYears ) ; if ( ( componentYears . size ( ) & 0x01 ) == 1 ) { return componentYears . get ( componentYears . size ( ) / 2 ) ; } else { int baseIndex = componentYears . size ( ) / 2 - 1 ; return componentYears . get ( baseIndex ) + ( componentYears . get ( baseIndex + 1 ) - componentYears . get ( baseIndex ) ) / 2 ; } }
calculates the " best - in - class year " of the device . this represents the top - end or flagship devices of that year , not the actual release year of the phone . for example , the galaxy duos s was released in 2012 , but its specs are very similar to the galaxy s that was released in 2010 as a then top - of - the - line phone , so it is a 2010 device .
