DateTime.java 21.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
package org.joda.time;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Locale;
import org.joda.convert.FromString;
import org.joda.time.base.BaseDateTime;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.field.AbstractReadableInstantFieldProperty;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;

public final class DateTime
  extends BaseDateTime
  implements Serializable, ReadableDateTime
{
  private static final long serialVersionUID = -5171125899451703815L;
  
  public DateTime() {}
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, 0, 0);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, 0);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, Chronology paramChronology)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, paramChronology);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, DateTimeZone paramDateTimeZone)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, paramDateTimeZone);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, Chronology paramChronology)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, 0, paramChronology);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, DateTimeZone paramDateTimeZone)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, 0, paramDateTimeZone);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, Chronology paramChronology)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, 0, 0, paramChronology);
  }
  
  public DateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, DateTimeZone paramDateTimeZone)
  {
    super(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, 0, 0, paramDateTimeZone);
  }
  
  public DateTime(long paramLong)
  {
    super(paramLong);
  }
  
  public DateTime(long paramLong, Chronology paramChronology)
  {
    super(paramLong, paramChronology);
  }
  
  public DateTime(long paramLong, DateTimeZone paramDateTimeZone)
  {
    super(paramLong, paramDateTimeZone);
  }
  
  public DateTime(Object paramObject)
  {
    super(paramObject, null);
  }
  
  public DateTime(Object paramObject, Chronology paramChronology)
  {
    super(paramObject, DateTimeUtils.getChronology(paramChronology));
  }
  
  public DateTime(Object paramObject, DateTimeZone paramDateTimeZone)
  {
    super(paramObject, paramDateTimeZone);
  }
  
  public DateTime(Chronology paramChronology)
  {
    super(paramChronology);
  }
  
  public DateTime(DateTimeZone paramDateTimeZone)
  {
    super(paramDateTimeZone);
  }
  
  public static DateTime now()
  {
    return new DateTime();
  }
  
  public static DateTime now(Chronology paramChronology)
  {
    if (paramChronology == null) {
      throw new NullPointerException("Chronology must not be null");
    }
    return new DateTime(paramChronology);
  }
  
  public static DateTime now(DateTimeZone paramDateTimeZone)
  {
    if (paramDateTimeZone == null) {
      throw new NullPointerException("Zone must not be null");
    }
    return new DateTime(paramDateTimeZone);
  }
  
  @FromString
  public static DateTime parse(String paramString)
  {
    return parse(paramString, ISODateTimeFormat.dateTimeParser().withOffsetParsed());
  }
  
  public static DateTime parse(String paramString, DateTimeFormatter paramDateTimeFormatter)
  {
    return paramDateTimeFormatter.parseDateTime(paramString);
  }
  
  public final Property centuryOfEra()
  {
    return new Property(this, getChronology().centuryOfEra());
  }
  
  public final Property dayOfMonth()
  {
    return new Property(this, getChronology().dayOfMonth());
  }
  
  public final Property dayOfWeek()
  {
    return new Property(this, getChronology().dayOfWeek());
  }
  
  public final Property dayOfYear()
  {
    return new Property(this, getChronology().dayOfYear());
  }
  
  public final Property era()
  {
    return new Property(this, getChronology().era());
  }
  
  public final Property hourOfDay()
  {
    return new Property(this, getChronology().hourOfDay());
  }
  
  public final Property millisOfDay()
  {
    return new Property(this, getChronology().millisOfDay());
  }
  
  public final Property millisOfSecond()
  {
    return new Property(this, getChronology().millisOfSecond());
  }
  
  public final DateTime minus(long paramLong)
  {
    return withDurationAdded(paramLong, -1);
  }
  
  public final DateTime minus(ReadableDuration paramReadableDuration)
  {
    return withDurationAdded(paramReadableDuration, -1);
  }
  
  public final DateTime minus(ReadablePeriod paramReadablePeriod)
  {
    return withPeriodAdded(paramReadablePeriod, -1);
  }
  
  public final DateTime minusDays(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().days().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusHours(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().hours().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusMillis(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().millis().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusMinutes(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().minutes().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusMonths(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().months().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusSeconds(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().seconds().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusWeeks(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().weeks().subtract(getMillis(), paramInt));
  }
  
  public final DateTime minusYears(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().years().subtract(getMillis(), paramInt));
  }
  
  public final Property minuteOfDay()
  {
    return new Property(this, getChronology().minuteOfDay());
  }
  
  public final Property minuteOfHour()
  {
    return new Property(this, getChronology().minuteOfHour());
  }
  
  public final Property monthOfYear()
  {
    return new Property(this, getChronology().monthOfYear());
  }
  
  public final DateTime plus(long paramLong)
  {
    return withDurationAdded(paramLong, 1);
  }
  
  public final DateTime plus(ReadableDuration paramReadableDuration)
  {
    return withDurationAdded(paramReadableDuration, 1);
  }
  
  public final DateTime plus(ReadablePeriod paramReadablePeriod)
  {
    return withPeriodAdded(paramReadablePeriod, 1);
  }
  
  public final DateTime plusDays(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().days().add(getMillis(), paramInt));
  }
  
  public final DateTime plusHours(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().hours().add(getMillis(), paramInt));
  }
  
  public final DateTime plusMillis(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().millis().add(getMillis(), paramInt));
  }
  
  public final DateTime plusMinutes(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().minutes().add(getMillis(), paramInt));
  }
  
  public final DateTime plusMonths(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().months().add(getMillis(), paramInt));
  }
  
  public final DateTime plusSeconds(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().seconds().add(getMillis(), paramInt));
  }
  
  public final DateTime plusWeeks(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().weeks().add(getMillis(), paramInt));
  }
  
  public final DateTime plusYears(int paramInt)
  {
    if (paramInt == 0) {
      return this;
    }
    return withMillis(getChronology().years().add(getMillis(), paramInt));
  }
  
  public final Property property(DateTimeFieldType paramDateTimeFieldType)
  {
    if (paramDateTimeFieldType == null) {
      throw new IllegalArgumentException("The DateTimeFieldType must not be null");
    }
    DateTimeField localDateTimeField = paramDateTimeFieldType.getField(getChronology());
    if (!localDateTimeField.isSupported()) {
      throw new IllegalArgumentException("Field '" + paramDateTimeFieldType + "' is not supported");
    }
    return new Property(this, localDateTimeField);
  }
  
  public final Property secondOfDay()
  {
    return new Property(this, getChronology().secondOfDay());
  }
  
  public final Property secondOfMinute()
  {
    return new Property(this, getChronology().secondOfMinute());
  }
  
  public final DateMidnight toDateMidnight()
  {
    return new DateMidnight(getMillis(), getChronology());
  }
  
  public final DateTime toDateTime()
  {
    return this;
  }
  
  public final DateTime toDateTime(Chronology paramChronology)
  {
    paramChronology = DateTimeUtils.getChronology(paramChronology);
    if (getChronology() == paramChronology) {
      return this;
    }
    return super.toDateTime(paramChronology);
  }
  
  public final DateTime toDateTime(DateTimeZone paramDateTimeZone)
  {
    paramDateTimeZone = DateTimeUtils.getZone(paramDateTimeZone);
    if (getZone() == paramDateTimeZone) {
      return this;
    }
    return super.toDateTime(paramDateTimeZone);
  }
  
  public final DateTime toDateTimeISO()
  {
    if (getChronology() == ISOChronology.getInstance()) {
      return this;
    }
    return super.toDateTimeISO();
  }
  
  public final LocalDate toLocalDate()
  {
    return new LocalDate(getMillis(), getChronology());
  }
  
  public final LocalDateTime toLocalDateTime()
  {
    return new LocalDateTime(getMillis(), getChronology());
  }
  
  public final LocalTime toLocalTime()
  {
    return new LocalTime(getMillis(), getChronology());
  }
  
  @Deprecated
  public final TimeOfDay toTimeOfDay()
  {
    return new TimeOfDay(getMillis(), getChronology());
  }
  
  @Deprecated
  public final YearMonthDay toYearMonthDay()
  {
    return new YearMonthDay(getMillis(), getChronology());
  }
  
  public final Property weekOfWeekyear()
  {
    return new Property(this, getChronology().weekOfWeekyear());
  }
  
  public final Property weekyear()
  {
    return new Property(this, getChronology().weekyear());
  }
  
  public final DateTime withCenturyOfEra(int paramInt)
  {
    return withMillis(getChronology().centuryOfEra().set(getMillis(), paramInt));
  }
  
  public final DateTime withChronology(Chronology paramChronology)
  {
    paramChronology = DateTimeUtils.getChronology(paramChronology);
    if (paramChronology == getChronology()) {
      return this;
    }
    return new DateTime(getMillis(), paramChronology);
  }
  
  public final DateTime withDate(int paramInt1, int paramInt2, int paramInt3)
  {
    Chronology localChronology = getChronology();
    long l = getMillis();
    l = localChronology.year().set(l, paramInt1);
    l = localChronology.monthOfYear().set(l, paramInt2);
    return withMillis(localChronology.dayOfMonth().set(l, paramInt3));
  }
  
  public final DateTime withDayOfMonth(int paramInt)
  {
    return withMillis(getChronology().dayOfMonth().set(getMillis(), paramInt));
  }
  
  public final DateTime withDayOfWeek(int paramInt)
  {
    return withMillis(getChronology().dayOfWeek().set(getMillis(), paramInt));
  }
  
  public final DateTime withDayOfYear(int paramInt)
  {
    return withMillis(getChronology().dayOfYear().set(getMillis(), paramInt));
  }
  
  public final DateTime withDurationAdded(long paramLong, int paramInt)
  {
    if ((paramLong == 0L) || (paramInt == 0)) {
      return this;
    }
    return withMillis(getChronology().add(getMillis(), paramLong, paramInt));
  }
  
  public final DateTime withDurationAdded(ReadableDuration paramReadableDuration, int paramInt)
  {
    if ((paramReadableDuration == null) || (paramInt == 0)) {
      return this;
    }
    return withDurationAdded(paramReadableDuration.getMillis(), paramInt);
  }
  
  public final DateTime withEarlierOffsetAtOverlap()
  {
    return withMillis(getZone().adjustOffset(getMillis(), false));
  }
  
  public final DateTime withEra(int paramInt)
  {
    return withMillis(getChronology().era().set(getMillis(), paramInt));
  }
  
  public final DateTime withField(DateTimeFieldType paramDateTimeFieldType, int paramInt)
  {
    if (paramDateTimeFieldType == null) {
      throw new IllegalArgumentException("Field must not be null");
    }
    return withMillis(paramDateTimeFieldType.getField(getChronology()).set(getMillis(), paramInt));
  }
  
  public final DateTime withFieldAdded(DurationFieldType paramDurationFieldType, int paramInt)
  {
    if (paramDurationFieldType == null) {
      throw new IllegalArgumentException("Field must not be null");
    }
    if (paramInt == 0) {
      return this;
    }
    return withMillis(paramDurationFieldType.getField(getChronology()).add(getMillis(), paramInt));
  }
  
  public final DateTime withFields(ReadablePartial paramReadablePartial)
  {
    if (paramReadablePartial == null) {
      return this;
    }
    return withMillis(getChronology().set(paramReadablePartial, getMillis()));
  }
  
  public final DateTime withHourOfDay(int paramInt)
  {
    return withMillis(getChronology().hourOfDay().set(getMillis(), paramInt));
  }
  
  public final DateTime withLaterOffsetAtOverlap()
  {
    return withMillis(getZone().adjustOffset(getMillis(), true));
  }
  
  public final DateTime withMillis(long paramLong)
  {
    if (paramLong == getMillis()) {
      return this;
    }
    return new DateTime(paramLong, getChronology());
  }
  
  public final DateTime withMillisOfDay(int paramInt)
  {
    return withMillis(getChronology().millisOfDay().set(getMillis(), paramInt));
  }
  
  public final DateTime withMillisOfSecond(int paramInt)
  {
    return withMillis(getChronology().millisOfSecond().set(getMillis(), paramInt));
  }
  
  public final DateTime withMinuteOfHour(int paramInt)
  {
    return withMillis(getChronology().minuteOfHour().set(getMillis(), paramInt));
  }
  
  public final DateTime withMonthOfYear(int paramInt)
  {
    return withMillis(getChronology().monthOfYear().set(getMillis(), paramInt));
  }
  
  public final DateTime withPeriodAdded(ReadablePeriod paramReadablePeriod, int paramInt)
  {
    if ((paramReadablePeriod == null) || (paramInt == 0)) {
      return this;
    }
    return withMillis(getChronology().add(paramReadablePeriod, getMillis(), paramInt));
  }
  
  public final DateTime withSecondOfMinute(int paramInt)
  {
    return withMillis(getChronology().secondOfMinute().set(getMillis(), paramInt));
  }
  
  public final DateTime withTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    Chronology localChronology = getChronology();
    long l = getMillis();
    l = localChronology.hourOfDay().set(l, paramInt1);
    l = localChronology.minuteOfHour().set(l, paramInt2);
    l = localChronology.secondOfMinute().set(l, paramInt3);
    return withMillis(localChronology.millisOfSecond().set(l, paramInt4));
  }
  
  public final DateTime withTimeAtStartOfDay()
  {
    return toLocalDate().toDateTimeAtStartOfDay(getZone());
  }
  
  public final DateTime withWeekOfWeekyear(int paramInt)
  {
    return withMillis(getChronology().weekOfWeekyear().set(getMillis(), paramInt));
  }
  
  public final DateTime withWeekyear(int paramInt)
  {
    return withMillis(getChronology().weekyear().set(getMillis(), paramInt));
  }
  
  public final DateTime withYear(int paramInt)
  {
    return withMillis(getChronology().year().set(getMillis(), paramInt));
  }
  
  public final DateTime withYearOfCentury(int paramInt)
  {
    return withMillis(getChronology().yearOfCentury().set(getMillis(), paramInt));
  }
  
  public final DateTime withYearOfEra(int paramInt)
  {
    return withMillis(getChronology().yearOfEra().set(getMillis(), paramInt));
  }
  
  public final DateTime withZone(DateTimeZone paramDateTimeZone)
  {
    return withChronology(getChronology().withZone(paramDateTimeZone));
  }
  
  public final DateTime withZoneRetainFields(DateTimeZone paramDateTimeZone)
  {
    paramDateTimeZone = DateTimeUtils.getZone(paramDateTimeZone);
    DateTimeZone localDateTimeZone = DateTimeUtils.getZone(getZone());
    if (paramDateTimeZone == localDateTimeZone) {
      return this;
    }
    return new DateTime(localDateTimeZone.getMillisKeepLocal(paramDateTimeZone, getMillis()), getChronology().withZone(paramDateTimeZone));
  }
  
  public final Property year()
  {
    return new Property(this, getChronology().year());
  }
  
  public final Property yearOfCentury()
  {
    return new Property(this, getChronology().yearOfCentury());
  }
  
  public final Property yearOfEra()
  {
    return new Property(this, getChronology().yearOfEra());
  }
  
  public static final class Property
    extends AbstractReadableInstantFieldProperty
  {
    private static final long serialVersionUID = -6983323811635733510L;
    private DateTime a;
    private DateTimeField b;
    
    Property(DateTime paramDateTime, DateTimeField paramDateTimeField)
    {
      this.a = paramDateTime;
      this.b = paramDateTimeField;
    }
    
    private void readObject(ObjectInputStream paramObjectInputStream)
      throws IOException, ClassNotFoundException
    {
      this.a = ((DateTime)paramObjectInputStream.readObject());
      this.b = ((DateTimeFieldType)paramObjectInputStream.readObject()).getField(this.a.getChronology());
    }
    
    private void writeObject(ObjectOutputStream paramObjectOutputStream)
      throws IOException
    {
      paramObjectOutputStream.writeObject(this.a);
      paramObjectOutputStream.writeObject(this.b.getType());
    }
    
    public final DateTime addToCopy(int paramInt)
    {
      return this.a.withMillis(this.b.add(this.a.getMillis(), paramInt));
    }
    
    public final DateTime addToCopy(long paramLong)
    {
      return this.a.withMillis(this.b.add(this.a.getMillis(), paramLong));
    }
    
    public final DateTime addWrapFieldToCopy(int paramInt)
    {
      return this.a.withMillis(this.b.addWrapField(this.a.getMillis(), paramInt));
    }
    
    protected final Chronology getChronology()
    {
      return this.a.getChronology();
    }
    
    public final DateTime getDateTime()
    {
      return this.a;
    }
    
    public final DateTimeField getField()
    {
      return this.b;
    }
    
    protected final long getMillis()
    {
      return this.a.getMillis();
    }
    
    public final DateTime roundCeilingCopy()
    {
      return this.a.withMillis(this.b.roundCeiling(this.a.getMillis()));
    }
    
    public final DateTime roundFloorCopy()
    {
      return this.a.withMillis(this.b.roundFloor(this.a.getMillis()));
    }
    
    public final DateTime roundHalfCeilingCopy()
    {
      return this.a.withMillis(this.b.roundHalfCeiling(this.a.getMillis()));
    }
    
    public final DateTime roundHalfEvenCopy()
    {
      return this.a.withMillis(this.b.roundHalfEven(this.a.getMillis()));
    }
    
    public final DateTime roundHalfFloorCopy()
    {
      return this.a.withMillis(this.b.roundHalfFloor(this.a.getMillis()));
    }
    
    public final DateTime setCopy(int paramInt)
    {
      return this.a.withMillis(this.b.set(this.a.getMillis(), paramInt));
    }
    
    public final DateTime setCopy(String paramString)
    {
      return setCopy(paramString, null);
    }
    
    public final DateTime setCopy(String paramString, Locale paramLocale)
    {
      return this.a.withMillis(this.b.set(this.a.getMillis(), paramString, paramLocale));
    }
    
    public final DateTime withMaximumValue()
    {
      try
      {
        DateTime localDateTime = setCopy(getMaximumValue());
        return localDateTime;
      }
      catch (RuntimeException localRuntimeException)
      {
        if (IllegalInstantException.isIllegalInstant(localRuntimeException)) {
          return new DateTime(getChronology().getZone().previousTransition(getMillis() + 86400000L), getChronology());
        }
        throw localRuntimeException;
      }
    }
    
    public final DateTime withMinimumValue()
    {
      try
      {
        DateTime localDateTime = setCopy(getMinimumValue());
        return localDateTime;
      }
      catch (RuntimeException localRuntimeException)
      {
        if (IllegalInstantException.isIllegalInstant(localRuntimeException)) {
          return new DateTime(getChronology().getZone().nextTransition(getMillis() - 86400000L), getChronology());
        }
        throw localRuntimeException;
      }
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/DateTime.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */