public Collection<Photocount> getCounts(Date[] dates, Date[] takenDates) throws FlickrException {
        List<Photocount> photocounts = new ArrayList<Photocount>();

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_GET_COUNTS);

        if (dates == null && takenDates == null) {
            throw new IllegalArgumentException("You must provide a value for either dates or takenDates");
        }

        if (dates != null) {
            List<String> dateList = new ArrayList<String>();
            for (int i = 0; i < dates.length; i++) {
                dateList.add(String.valueOf(dates[i].getTime() / 1000L));
            }
            parameters.put("dates", StringUtilities.join(dateList, ","));
        }

        if (takenDates != null) {
            List<String> takenDateList = new ArrayList<String>();
            for (int i = 0; i < takenDates.length; i++) {
                takenDateList.add(String.valueOf(takenDates[i].getTime() / 1000L));
            }
            parameters.put("taken_dates", StringUtilities.join(takenDateList, ","));
        }

        Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }
        Element photocountsElement = response.getPayload();
        NodeList photocountNodes = photocountsElement.getElementsByTagName("photocount");
        for (int i = 0; i < photocountNodes.getLength(); i++) {
            Element photocountElement = (Element) photocountNodes.item(i);
            Photocount photocount = new Photocount();
            photocount.setCount(photocountElement.getAttribute("count"));
            photocount.setFromDate(photocountElement.getAttribute("fromdate"));
            photocount.setToDate(photocountElement.getAttribute("todate"));
            photocounts.add(photocount);
        }
        return photocounts;
    }
public Collection < Photocount > getCounts ( Date [ ] dates , Date [ ] takenDates ) throws FlickrException { List < Photocount > photocounts = new ArrayList < Photocount > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_COUNTS ) ; if ( dates == null && takenDates == null ) { throw new IllegalArgumentException ( "You must provide a value for either dates or takenDates" ) ; } if ( dates != null ) { List < String > dateList = new ArrayList < String > ( ) ; for ( int i = 0 ; i < dates . length ; i ++ ) { dateList . add ( String . valueOf ( dates [ i ] . getTime ( ) / 1000L ) ) ; } parameters . put ( "dates" , StringUtilities . join ( dateList , "," ) ) ; } if ( takenDates != null ) { List < String > takenDateList = new ArrayList < String > ( ) ; for ( int i = 0 ; i < takenDates . length ; i ++ ) { takenDateList . add ( String . valueOf ( takenDates [ i ] . getTime ( ) / 1000L ) ) ; } parameters . put ( "taken_dates" , StringUtilities . join ( takenDateList , "," ) ) ; } Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element photocountsElement = response . getPayload ( ) ; NodeList photocountNodes = photocountsElement . getElementsByTagName ( "photocount" ) ; for ( int i = 0 ; i < photocountNodes . getLength ( ) ; i ++ ) { Element photocountElement = ( Element ) photocountNodes . item ( i ) ; Photocount photocount = new Photocount ( ) ; photocount . setCount ( photocountElement . getAttribute ( "count" ) ) ; photocount . setFromDate ( photocountElement . getAttribute ( "fromdate" ) ) ; photocount . setToDate ( photocountElement . getAttribute ( "todate" ) ) ; photocounts . add ( photocount ) ; } return photocounts ; }
Gets a collection of photo counts for the given date ranges for the calling user.

This method requires authentication with 'read' permission.

@param dates
An array of dates, denoting the periods to return counts for. They should be specified smallest first.
@param takenDates
An array of dates, denoting the periods to return counts for. They should be specified smallest first.
@return A Collection of Photocount objects