Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *  Copyright 2001-2005 Stephen Colebourne
   *
   *  Licensed under the Apache License, Version 2.0 (the "License");
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
 package org.joda.time;

Defines an instant in time that can be queried and modified using datetime fields.

The implementation of this interface will be mutable. It may provide more advanced methods than those in the interface.

Methods in your application should be defined using ReadWritableDateTime as a parameter if the method wants to manipulate and change a date in simple ways.

Author(s):
Stephen Colebourne
Brian S O'Neill
Since:
1.0
 
 public interface ReadWritableDateTime extends ReadableDateTimeReadWritableInstant {
     
     //-----------------------------------------------------------------------
     
Set the year to the specified value.

Parameters:
year the year
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void setYear(int year);

    
Add a number of years to the date.

Parameters:
years the years to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void addYears(int years);
 
     //-----------------------------------------------------------------------
     
Set the weekyear to the specified value.

Parameters:
weekyear the weekyear
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void setWeekyear(int weekyear);

    
Add a number of weekyears to the date.

Parameters:
weekyears the weekyears to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void addWeekyears(int weekyears);
 
     //-----------------------------------------------------------------------
     
Set the month of the year to the specified value.

Parameters:
monthOfYear the month of the year
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void setMonthOfYear(int monthOfYear);

    
Add a number of months to the date.

Parameters:
months the months to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void addMonths(int months);
 
     //-----------------------------------------------------------------------
     
Set the week of weekyear to the specified value.

Parameters:
weekOfWeekyear the week of the weekyear
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void setWeekOfWeekyear(int weekOfWeekyear);

    
Add a number of weeks to the date.

Parameters:
weeks the weeks to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
 
     void addWeeks(int weeks);
    //-----------------------------------------------------------------------
    
Set the day of year to the specified value.

Parameters:
dayOfYear the day of the year
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setDayOfYear(int dayOfYear);

    
Set the day of the month to the specified value.

Parameters:
dayOfMonth the day of the month
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setDayOfMonth(int dayOfMonth);

    
Set the day of week to the specified value.

Parameters:
dayOfWeek the day of the week
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setDayOfWeek(int dayOfWeek);

    
Add a number of days to the date.

Parameters:
days the days to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void addDays(int days);
    //-----------------------------------------------------------------------
    
Set the hour of the day to the specified value.

Parameters:
hourOfDay the hour of day
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setHourOfDay(int hourOfDay);

    
Add a number of hours to the date.

Parameters:
hours the hours to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void addHours(int hours);
    
    //-----------------------------------------------------------------------
    
Set the minute of the day to the specified value.

Parameters:
minuteOfDay the minute of day
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setMinuteOfDay(int minuteOfDay);

    
Set the minute of the hour to the specified value.

Parameters:
minuteOfHour the minute of hour
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setMinuteOfHour(int minuteOfHour);

    
Add a number of minutes to the date.

Parameters:
minutes the minutes to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void addMinutes(int minutes);
    //-----------------------------------------------------------------------
    
Set the second of the day to the specified value.

Parameters:
secondOfDay the second of day
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setSecondOfDay(int secondOfDay);

    
Set the second of the minute to the specified value.

Parameters:
secondOfMinute the second of minute
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setSecondOfMinute(int secondOfMinute);

    
Add a number of seconds to the date.

Parameters:
seconds the seconds to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void addSeconds(int seconds);
    //-----------------------------------------------------------------------
    
Set the millis of the day to the specified value.

Parameters:
millisOfDay the millis of day
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setMillisOfDay(int millisOfDay);

    
Set the millis of the second to the specified value.

Parameters:
millisOfSecond the millis of second
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void setMillisOfSecond(int millisOfSecond);

    
Add a number of milliseconds to the date. The implementation of this method differs from the ReadWritableInstant.add(long) method in that a DateTimeField performs the addition.

Parameters:
millis the milliseconds to add
Throws:
java.lang.IllegalArgumentException if the value is invalid
    void addMillis(int millis);

    
Set the date from fields. The time part of this object will be unaffected.

Parameters:
year the year
monthOfYear the month of the year
dayOfMonth the day of the month
Throws:
java.lang.IllegalArgumentException if any value is invalid
    void setDate(int yearint monthOfYearint dayOfMonth);

    
Set the time from fields. The date part of this object will be unaffected.

Parameters:
hour the hour
minuteOfHour the minute of the hour
secondOfMinute the second of the minute
millisOfSecond the millisecond of the second
Throws:
java.lang.IllegalArgumentException if any value is invalid
    void setTime(int hourint minuteOfHourint secondOfMinuteint millisOfSecond);

    
Set the date and time from fields.

Parameters:
year the year
monthOfYear the month of the year
dayOfMonth the day of the month
hourOfDay the hour of the day
minuteOfHour the minute of the hour
secondOfMinute the second of the minute
millisOfSecond the millisecond of the second
Throws:
java.lang.IllegalArgumentException if any value is invalid
    void setDateTime(
        int yearint monthOfYearint dayOfMonth,
        int hourOfDayint minuteOfHourint secondOfMinuteint millisOfSecond);
New to GrepCode? Check out our FAQ X