Java Doc for MutableInterval.java in  » Development » Joda-Time » org » joda » time » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Joda Time » org.joda.time 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.joda.time.base.BaseInterval
   org.joda.time.MutableInterval

MutableInterval
public class MutableInterval extends BaseInterval implements ReadWritableInterval,Cloneable,Serializable(Code)
MutableInterval is the standard implementation of a mutable time interval.

A time interval represents a period of time between two instants. Intervals are inclusive of the start instant and exclusive of the end. The end instant is always greater than or equal to the start instant.

Intervals have a fixed millisecond duration. This is the difference between the start and end instants. The duration is represented separately by ReadableDuration . As a result, intervals are not comparable. To compare the length of two intervals, you should compare their durations.

An interval can also be converted to a ReadablePeriod . This represents the difference between the start and end points in terms of fields such as years and days.

If performing significant calculations on an interval, it may be faster to convert an Interval object to a MutableInterval one.

MutableInterval is mutable and not thread-safe, unless concurrent threads are not invoking mutator methods.
author:
   Stephen Colebourne
author:
   Brian S O'Neill
since:
   1.0




Constructor Summary
public  MutableInterval()
     Constructs a zero length time interval from 1970-01-01 to 1970-01-01.
public  MutableInterval(long startInstant, long endInstant)
     Constructs an interval from a start and end instant with the ISO default chronology.
public  MutableInterval(long startInstant, long endInstant, Chronology chronology)
     Constructs an interval from a start and end instant with a chronology.
public  MutableInterval(ReadableInstant start, ReadableInstant end)
     Constructs an interval from a start and end instant.
public  MutableInterval(ReadableInstant start, ReadableDuration duration)
     Constructs an interval from a start instant and a duration.
public  MutableInterval(ReadableDuration duration, ReadableInstant end)
     Constructs an interval from a millisecond duration and an end instant.
public  MutableInterval(ReadableInstant start, ReadablePeriod period)
     Constructs an interval from a start instant and a time period.
public  MutableInterval(ReadablePeriod period, ReadableInstant end)
     Constructs an interval from a time period and an end instant.
public  MutableInterval(Object interval)
     Constructs a time interval by converting or copying from another object.
public  MutableInterval(Object interval, Chronology chronology)
     Constructs a time interval by converting or copying from another object, overriding the chronology.

Method Summary
public  Objectclone()
     Clone this object.
public  MutableIntervalcopy()
     Clone this object without having to cast the returned object.
public  voidsetChronology(Chronology chrono)
     Sets the chronology of this time interval.
public  voidsetDurationAfterStart(long duration)
     Sets the duration of this time interval, preserving the start instant.
public  voidsetDurationAfterStart(ReadableDuration duration)
     Sets the duration of this time interval, preserving the start instant.
public  voidsetDurationBeforeEnd(long duration)
     Sets the duration of this time interval, preserving the end instant.
public  voidsetDurationBeforeEnd(ReadableDuration duration)
     Sets the duration of this time interval, preserving the end instant.
public  voidsetEnd(ReadableInstant end)
     Sets the end of this time interval as an Instant.
public  voidsetEndMillis(long endInstant)
     Sets the end of this time interval.
public  voidsetInterval(long startInstant, long endInstant)
     Sets this interval from two millisecond instants retaining the chronology.
public  voidsetInterval(ReadableInterval interval)
     Sets this interval to be the same as another.
public  voidsetInterval(ReadableInstant start, ReadableInstant end)
     Sets this interval from two instants, replacing the chronology with that from the start instant.
public  voidsetPeriodAfterStart(ReadablePeriod period)
     Sets the period of this time interval, preserving the start instant and using the ISOChronology in the default zone for calculations.
public  voidsetPeriodBeforeEnd(ReadablePeriod period)
     Sets the period of this time interval, preserving the end instant and using the ISOChronology in the default zone for calculations.
public  voidsetStart(ReadableInstant start)
     Sets the start of this time interval as an Instant.
public  voidsetStartMillis(long startInstant)
     Sets the start of this time interval.


Constructor Detail
MutableInterval
public MutableInterval()(Code)
Constructs a zero length time interval from 1970-01-01 to 1970-01-01.



MutableInterval
public MutableInterval(long startInstant, long endInstant)(Code)
Constructs an interval from a start and end instant with the ISO default chronology.
Parameters:
  startInstant - start of this interval, as milliseconds from 1970-01-01T00:00:00Z.
Parameters:
  endInstant - end of this interval, as milliseconds from 1970-01-01T00:00:00Z.
throws:
  IllegalArgumentException - if the end is before the start



MutableInterval
public MutableInterval(long startInstant, long endInstant, Chronology chronology)(Code)
Constructs an interval from a start and end instant with a chronology.
Parameters:
  chronology - the chronology to use, null is ISO default
Parameters:
  startInstant - start of this interval, as milliseconds from 1970-01-01T00:00:00Z.
Parameters:
  endInstant - end of this interval, as milliseconds from 1970-01-01T00:00:00Z.
throws:
  IllegalArgumentException - if the end is before the start



MutableInterval
public MutableInterval(ReadableInstant start, ReadableInstant end)(Code)
Constructs an interval from a start and end instant.

The chronology used is that of the start instant.
Parameters:
  start - start of this interval, null means now
Parameters:
  end - end of this interval, null means now
throws:
  IllegalArgumentException - if the end is before the start




MutableInterval
public MutableInterval(ReadableInstant start, ReadableDuration duration)(Code)
Constructs an interval from a start instant and a duration.
Parameters:
  start - start of this interval, null means now
Parameters:
  duration - the duration of this interval, null means zero length
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the end instant exceeds the capacity of a long



MutableInterval
public MutableInterval(ReadableDuration duration, ReadableInstant end)(Code)
Constructs an interval from a millisecond duration and an end instant.
Parameters:
  duration - the duration of this interval, null means zero length
Parameters:
  end - end of this interval, null means now
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the start instant exceeds the capacity of a long



MutableInterval
public MutableInterval(ReadableInstant start, ReadablePeriod period)(Code)
Constructs an interval from a start instant and a time period.

When forming the interval, the chronology from the instant is used if present, otherwise the chronology of the period is used.
Parameters:
  start - start of this interval, null means now
Parameters:
  period - the period of this interval, null means zero length
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the end instant exceeds the capacity of a long




MutableInterval
public MutableInterval(ReadablePeriod period, ReadableInstant end)(Code)
Constructs an interval from a time period and an end instant.

When forming the interval, the chronology from the instant is used if present, otherwise the chronology of the period is used.
Parameters:
  period - the period of this interval, null means zero length
Parameters:
  end - end of this interval, null means now
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the start instant exceeds the capacity of a long




MutableInterval
public MutableInterval(Object interval)(Code)
Constructs a time interval by converting or copying from another object.

The recognised object types are defined in org.joda.time.convert.ConverterManager ConverterManager and include ReadableInterval and String. The String formats are described by ISODateTimeFormat.dateTimeParser and ISOPeriodFormat.standard , and may be 'datetime/datetime', 'datetime/period' or 'period/datetime'.
Parameters:
  interval - the time interval to copy
throws:
  IllegalArgumentException - if the interval is invalid




MutableInterval
public MutableInterval(Object interval, Chronology chronology)(Code)
Constructs a time interval by converting or copying from another object, overriding the chronology.

The recognised object types are defined in org.joda.time.convert.ConverterManager ConverterManager and include ReadableInterval and String. The String formats are described by ISODateTimeFormat.dateTimeParser and ISOPeriodFormat.standard , and may be 'datetime/datetime', 'datetime/period' or 'period/datetime'.
Parameters:
  interval - the time interval to copy
Parameters:
  chronology - the chronology to use, null means ISO default
throws:
  IllegalArgumentException - if the interval is invalid





Method Detail
clone
public Object clone()(Code)
Clone this object. a clone of this object.



copy
public MutableInterval copy()(Code)
Clone this object without having to cast the returned object. a clone of the this object.



setChronology
public void setChronology(Chronology chrono)(Code)
Sets the chronology of this time interval.
Parameters:
  chrono - the chronology to use, null means ISO default



setDurationAfterStart
public void setDurationAfterStart(long duration)(Code)
Sets the duration of this time interval, preserving the start instant.
Parameters:
  duration - new duration for interval
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the end instant exceeds the capacity of a long



setDurationAfterStart
public void setDurationAfterStart(ReadableDuration duration)(Code)
Sets the duration of this time interval, preserving the start instant.
Parameters:
  duration - new duration for interval, null means zero length
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the end instant exceeds the capacity of a long



setDurationBeforeEnd
public void setDurationBeforeEnd(long duration)(Code)
Sets the duration of this time interval, preserving the end instant.
Parameters:
  duration - new duration for interval
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the start instant exceeds the capacity of a long



setDurationBeforeEnd
public void setDurationBeforeEnd(ReadableDuration duration)(Code)
Sets the duration of this time interval, preserving the end instant.
Parameters:
  duration - new duration for interval, null means zero length
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the start instant exceeds the capacity of a long



setEnd
public void setEnd(ReadableInstant end)(Code)
Sets the end of this time interval as an Instant.
Parameters:
  end - the end of the time interval, null means now
throws:
  IllegalArgumentException - if the end is before the start



setEndMillis
public void setEndMillis(long endInstant)(Code)
Sets the end of this time interval.
Parameters:
  endInstant - the end of the time interval,millisecond instant from 1970-01-01T00:00:00Z
throws:
  IllegalArgumentException - if the end is before the start



setInterval
public void setInterval(long startInstant, long endInstant)(Code)
Sets this interval from two millisecond instants retaining the chronology.
Parameters:
  startInstant - the start of the time interval
Parameters:
  endInstant - the start of the time interval
throws:
  IllegalArgumentException - if the end is before the start



setInterval
public void setInterval(ReadableInterval interval)(Code)
Sets this interval to be the same as another.
Parameters:
  interval - the interval to copy
throws:
  IllegalArgumentException - if the interval is null



setInterval
public void setInterval(ReadableInstant start, ReadableInstant end)(Code)
Sets this interval from two instants, replacing the chronology with that from the start instant.
Parameters:
  start - the start of the time interval
Parameters:
  end - the start of the time interval
throws:
  IllegalArgumentException - if the end is before the start



setPeriodAfterStart
public void setPeriodAfterStart(ReadablePeriod period)(Code)
Sets the period of this time interval, preserving the start instant and using the ISOChronology in the default zone for calculations.
Parameters:
  period - new period for interval, null means zero length
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the end instant exceeds the capacity of a long



setPeriodBeforeEnd
public void setPeriodBeforeEnd(ReadablePeriod period)(Code)
Sets the period of this time interval, preserving the end instant and using the ISOChronology in the default zone for calculations.
Parameters:
  period - new period for interval, null means zero length
throws:
  IllegalArgumentException - if the end is before the start
throws:
  ArithmeticException - if the start instant exceeds the capacity of a long



setStart
public void setStart(ReadableInstant start)(Code)
Sets the start of this time interval as an Instant.
Parameters:
  start - the start of the time interval, null means now
throws:
  IllegalArgumentException - if the end is before the start



setStartMillis
public void setStartMillis(long startInstant)(Code)
Sets the start of this time interval.
Parameters:
  startInstant - the start of the time interval,millisecond instant from 1970-01-01T00:00:00Z
throws:
  IllegalArgumentException - if the end is before the start



Methods inherited from org.joda.time.base.BaseInterval
public Chronology getChronology()(Code)(Java Doc)
public long getEndMillis()(Code)(Java Doc)
public long getStartMillis()(Code)(Java Doc)
protected void setInterval(long startInstant, long endInstant, Chronology chrono)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.