Java Code Examples for org.joda.time.DateTime#getWeekyear()

The following examples show how to use org.joda.time.DateTime#getWeekyear() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public int isoWeek( DateTimeUnit dateTimeUnit )
{
    DateTime dateTime = toIso( dateTimeUnit ).toJodaDateTime( ISOChronology.getInstance( DateTimeZone.getDefault() ) );
    return dateTime.getWeekyear();
}
 
Example 2
Object[][] genCalcdValues() {
    Object[][] retValues = null;
    /*
     * Create an array of Objects that will contain
     * other arrays of Objects. (This is the 'column'
     * array).
     */
    ArrayList fileStrings = lddFile.getFileStrings();
    ArrayList dtObjects = lddFile.getDtObjects();
    int numRows = fileStrings.size();
    retValues = new Object[numRows][];
    int numCols = colNames.length;
    // System.err.println("NumCols : " + numCols);
    /*
     * Prime the array of arrays of Objects, allocating a new
     * secondary array for each of the primary array's
     * elements.
     */
    for (int nextStrNum = 0; nextStrNum < fileStrings.size(); ++ nextStrNum) {
        retValues[nextStrNum] = new Object[numCols]; // get the 'col' array
        //****
        //* This needs to be sync'd with the colNames array.
        //****
        // Current row, 1st column
        int column = 0; // working row value
        String fileString = (String)fileStrings.get(nextStrNum);
        retValues[nextStrNum][column++] = fileString;
        // Current row, 2nd column
        DateTime adt = (DateTime)dtObjects.get(nextStrNum);
        String adtStr = adt.toString();
        retValues[nextStrNum][column++] = adtStr;
        // Current row, other columns.
        // Order here must match that specified in the colNames
        // array.
        retValues[nextStrNum][column++]  = new Integer( adt.getMillisOfSecond() );
        retValues[nextStrNum][column++]  = new Integer( adt.getSecondOfMinute() );
        retValues[nextStrNum][column++]  = new Integer( adt.getMinuteOfHour() );
        retValues[nextStrNum][column++]  = new Integer( adt.getHourOfDay() );
        retValues[nextStrNum][column++]  = new Integer( adt.getDayOfWeek() );
        retValues[nextStrNum][column++]  = new Integer( adt.getDayOfMonth() );
        retValues[nextStrNum][column++]  = new Integer( adt.getDayOfYear() );
        retValues[nextStrNum][column++]  = new Integer( adt.getWeekOfWeekyear() );
        retValues[nextStrNum][column++] = new Integer( adt.getWeekyear() );
        retValues[nextStrNum][column++] = new Integer( adt.getMonthOfYear() );
        retValues[nextStrNum][column++] = new Integer( adt.getYear() );
        //
    } // the for
    if ( debugf ) dumpObjs( retValues, System.err );
    return retValues;
}
 
Example 3
Object[][] genCalcdValues() {
    Object[][] retValues = null;
    /*
     * Create an array of Objects that will contain
     * other arrays of Objects. (This is the 'column'
     * array).
     */
    ArrayList fileStrings = lddFile.getFileStrings();
    ArrayList dtObjects = lddFile.getDtObjects();
    int numRows = fileStrings.size();
    retValues = new Object[numRows][];
    int numCols = colNames.length;
    // System.err.println("NumCols : " + numCols);
    /*
     * Prime the array of arrays of Objects, allocating a new
     * secondary array for each of the primary array's
     * elements.
     */
    for (int nextStrNum = 0; nextStrNum < fileStrings.size(); ++ nextStrNum) {
        retValues[nextStrNum] = new Object[numCols]; // get the 'col' array
        //****
        //* This needs to be sync'd with the colNames array.
        //****
        // Current row, 1st column
        int column = 0; // working row value
        String fileString = (String)fileStrings.get(nextStrNum);
        retValues[nextStrNum][column++] = fileString;
        // Current row, 2nd column
        DateTime adt = (DateTime)dtObjects.get(nextStrNum);
        String adtStr = adt.toString();
        retValues[nextStrNum][column++] = adtStr;
        // Current row, other columns.
        // Order here must match that specified in the colNames
        // array.
        retValues[nextStrNum][column++]  = new Integer( adt.getMillisOfSecond() );
        retValues[nextStrNum][column++]  = new Integer( adt.getSecondOfMinute() );
        retValues[nextStrNum][column++]  = new Integer( adt.getMinuteOfHour() );
        retValues[nextStrNum][column++]  = new Integer( adt.getHourOfDay() );
        retValues[nextStrNum][column++]  = new Integer( adt.getDayOfWeek() );
        retValues[nextStrNum][column++]  = new Integer( adt.getDayOfMonth() );
        retValues[nextStrNum][column++]  = new Integer( adt.getDayOfYear() );
        retValues[nextStrNum][column++]  = new Integer( adt.getWeekOfWeekyear() );
        retValues[nextStrNum][column++] = new Integer( adt.getWeekyear() );
        retValues[nextStrNum][column++] = new Integer( adt.getMonthOfYear() );
        retValues[nextStrNum][column++] = new Integer( adt.getYear() );
        //
    } // the for
    if ( debugf ) dumpObjs( retValues, System.err );
    return retValues;
}