joda-time-2.3

16:37:59.268 INFO  jd.cli.Main - Decompiling joda-time-2.3.jar
package org.joda.time.base;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import org.joda.time.Chronology;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeZone;
import org.joda.time.ReadableDateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public abstract class AbstractDateTime
  extends AbstractInstant
  implements ReadableDateTime
{
  public int get(DateTimeFieldType paramDateTimeFieldType)
  {
    if (paramDateTimeFieldType == null) {
      throw new IllegalArgumentException("The DateTimeFieldType must not be null");
    }
    return paramDateTimeFieldType.getField(getChronology()).get(getMillis());
  }
  
  public int getEra()
  {
    return getChronology().era().get(getMillis());
  }
  
  public int getCenturyOfEra()
  {
    return getChronology().centuryOfEra().get(getMillis());
  }
  
  public int getYearOfEra()
  {
    return getChronology().yearOfEra().get(getMillis());
  }
  
  public int getYearOfCentury()
  {
    return getChronology().yearOfCentury().get(getMillis());
  }
  
  public int getYear()
  {
    return getChronology().year().get(getMillis());
  }
  
  public int getWeekyear()
  {
    return getChronology().weekyear().get(getMillis());
  }
  
  public int getMonthOfYear()
  {
    return getChronology().monthOfYear().get(getMillis());
  }
  
  public int getWeekOfWeekyear()
  {
    return getChronology().weekOfWeekyear().get(getMillis());
  }
  
  public int getDayOfYear()
  {
    return getChronology().dayOfYear().get(getMillis());
  }
  
  public int getDayOfMonth()
  {
    return getChronology().dayOfMonth().get(getMillis());
  }
  
  public int getDayOfWeek()
  {
    return getChronology().dayOfWeek().get(getMillis());
  }
  
  public int getHourOfDay()
  {
    return getChronology().hourOfDay().get(getMillis());
  }
  
  public int getMinuteOfDay()
  {
    return getChronology().minuteOfDay().get(getMillis());
  }
  
  public int getMinuteOfHour()
  {
    return getChronology().minuteOfHour().get(getMillis());
  }
  
  public int getSecondOfDay()
  {
    return getChronology().secondOfDay().get(getMillis());
  }
  
  public int getSecondOfMinute()
  {
    return getChronology().secondOfMinute().get(getMillis());
  }
  
  public int getMillisOfDay()
  {
    return getChronology().millisOfDay().get(getMillis());
  }
  
  public int getMillisOfSecond()
  {
    return getChronology().millisOfSecond().get(getMillis());
  }
  
  public Calendar toCalendar(Locale paramLocale)
  {
    if (paramLocale == null) {
      paramLocale = Locale.getDefault();
    }
    DateTimeZone localDateTimeZone = getZone();
    Calendar localCalendar = Calendar.getInstance(localDateTimeZone.toTimeZone(), paramLocale);
    localCalendar.setTime(toDate());
    return localCalendar;
  }
  
  public GregorianCalendar toGregorianCalendar()
  {
    DateTimeZone localDateTimeZone = getZone();
    GregorianCalendar localGregorianCalendar = new GregorianCalendar(localDateTimeZone.toTimeZone());
    localGregorianCalendar.setTime(toDate());
    return localGregorianCalendar;
  }
  
  public String toString(String paramString)
  {
    if (paramString == null) {
      return toString();
    }
    return DateTimeFormat.forPattern(paramString).print(this);
  }
  
  public String toString(String paramString, Locale paramLocale)
    throws IllegalArgumentException
  {
    if (paramString == null) {
      return toString();
    }
    return DateTimeFormat.forPattern(paramString).withLocale(paramLocale).print(this);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.AbstractDateTime
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import org.joda.convert.ToString;
import org.joda.time.Duration;
import org.joda.time.Period;
import org.joda.time.ReadableDuration;
import org.joda.time.format.FormatUtils;

public abstract class AbstractDuration
  implements ReadableDuration
{
  public Duration toDuration()
  {
    return new Duration(getMillis());
  }
  
  public Period toPeriod()
  {
    return new Period(getMillis());
  }
  
  public int compareTo(ReadableDuration paramReadableDuration)
  {
    long l1 = getMillis();
    long l2 = paramReadableDuration.getMillis();
    if (l1 < l2) {
      return -1;
    }
    if (l1 > l2) {
      return 1;
    }
    return 0;
  }
  
  public boolean isEqual(ReadableDuration paramReadableDuration)
  {
    if (paramReadableDuration == null) {
      paramReadableDuration = Duration.ZERO;
    }
    return compareTo(paramReadableDuration) == 0;
  }
  
  public boolean isLongerThan(ReadableDuration paramReadableDuration)
  {
    if (paramReadableDuration == null) {
      paramReadableDuration = Duration.ZERO;
    }
    return compareTo(paramReadableDuration) > 0;
  }
  
  public boolean isShorterThan(ReadableDuration paramReadableDuration)
  {
    if (paramReadableDuration == null) {
      paramReadableDuration = Duration.ZERO;
    }
    return compareTo(paramReadableDuration) < 0;
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!(paramObject instanceof ReadableDuration)) {
      return false;
    }
    ReadableDuration localReadableDuration = (ReadableDuration)paramObject;
    return getMillis() == localReadableDuration.getMillis();
  }
  
  public int hashCode()
  {
    long l = getMillis();
    return (int)(l ^ l >>> 32);
  }
  
  @ToString
  public String toString()
  {
    long l = getMillis();
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append("PT");
    int i = l < 0L ? 1 : 0;
    FormatUtils.appendUnpaddedInteger(localStringBuffer, l);
    while (localStringBuffer.length() < (i != 0 ? 7 : 6)) {
      localStringBuffer.insert(i != 0 ? 3 : 2, "0");
    }
    if (l / 1000L * 1000L == l) {
      localStringBuffer.setLength(localStringBuffer.length() - 3);
    } else {
      localStringBuffer.insert(localStringBuffer.length() - 3, ".");
    }
    localStringBuffer.append('S');
    return localStringBuffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.AbstractDuration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import java.util.Date;
import org.joda.convert.ToString;
import org.joda.time.Chronology;
import org.joda.time.DateTime;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeUtils;
import org.joda.time.DateTimeZone;
import org.joda.time.Instant;
import org.joda.time.MutableDateTime;
import org.joda.time.ReadableInstant;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.field.FieldUtils;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;

public abstract class AbstractInstant
  implements ReadableInstant
{
  public DateTimeZone getZone()
  {
    return getChronology().getZone();
  }
  
  public int get(DateTimeFieldType paramDateTimeFieldType)
  {
    if (paramDateTimeFieldType == null) {
      throw new IllegalArgumentException("The DateTimeFieldType must not be null");
    }
    return paramDateTimeFieldType.getField(getChronology()).get(getMillis());
  }
  
  public boolean isSupported(DateTimeFieldType paramDateTimeFieldType)
  {
    if (paramDateTimeFieldType == null) {
      return false;
    }
    return paramDateTimeFieldType.getField(getChronology()).isSupported();
  }
  
  public int get(DateTimeField paramDateTimeField)
  {
    if (paramDateTimeField == null) {
      throw new IllegalArgumentException("The DateTimeField must not be null");
    }
    return paramDateTimeField.get(getMillis());
  }
  
  public Instant toInstant()
  {
    return new Instant(getMillis());
  }
  
  public DateTime toDateTime()
  {
    return new DateTime(getMillis(), getZone());
  }
  
  public DateTime toDateTimeISO()
  {
    return new DateTime(getMillis(), ISOChronology.getInstance(getZone()));
  }
  
  public DateTime toDateTime(DateTimeZone paramDateTimeZone)
  {
    Chronology localChronology = DateTimeUtils.getChronology(getChronology());
    localChronology = localChronology.withZone(paramDateTimeZone);
    return new DateTime(getMillis(), localChronology);
  }
  
  public DateTime toDateTime(Chronology paramChronology)
  {
    return new DateTime(getMillis(), paramChronology);
  }
  
  public MutableDateTime toMutableDateTime()
  {
    return new MutableDateTime(getMillis(), getZone());
  }
  
  public MutableDateTime toMutableDateTimeISO()
  {
    return new MutableDateTime(getMillis(), ISOChronology.getInstance(getZone()));
  }
  
  public MutableDateTime toMutableDateTime(DateTimeZone paramDateTimeZone)
  {
    Chronology localChronology = DateTimeUtils.getChronology(getChronology());
    localChronology = localChronology.withZone(paramDateTimeZone);
    return new MutableDateTime(getMillis(), localChronology);
  }
  
  public MutableDateTime toMutableDateTime(Chronology paramChronology)
  {
    return new MutableDateTime(getMillis(), paramChronology);
  }
  
  public Date toDate()
  {
    return new Date(getMillis());
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!(paramObject instanceof ReadableInstant)) {
      return false;
    }
    ReadableInstant localReadableInstant = (ReadableInstant)paramObject;
    return (getMillis() == localReadableInstant.getMillis()) && (FieldUtils.equals(getChronology(), localReadableInstant.getChronology()));
  }
  
  public int hashCode()
  {
    return (int)(getMillis() ^ getMillis() >>> 32) + getChronology().hashCode();
  }
  
  public int compareTo(ReadableInstant paramReadableInstant)
  {
    if (this == paramReadableInstant) {
      return 0;
    }
    long l1 = paramReadableInstant.getMillis();
    long l2 = getMillis();
    if (l2 == l1) {
      return 0;
    }
    if (l2 < l1) {
      return -1;
    }
    return 1;
  }
  
  public boolean isAfter(long paramLong)
  {
    return getMillis() > paramLong;
  }
  
  public boolean isAfterNow()
  {
    return isAfter(DateTimeUtils.currentTimeMillis());
  }
  
  public boolean isAfter(ReadableInstant paramReadableInstant)
  {
    long l = DateTimeUtils.getInstantMillis(paramReadableInstant);
    return isAfter(l);
  }
  
  public boolean isBefore(long paramLong)
  {
    return getMillis() < paramLong;
  }
  
  public boolean isBeforeNow()
  {
    return isBefore(DateTimeUtils.currentTimeMillis());
  }
  
  public boolean isBefore(ReadableInstant paramReadableInstant)
  {
    long l = DateTimeUtils.getInstantMillis(paramReadableInstant);
    return isBefore(l);
  }
  
  public boolean isEqual(long paramLong)
  {
    return getMillis() == paramLong;
  }
  
  public boolean isEqualNow()
  {
    return isEqual(DateTimeUtils.currentTimeMillis());
  }
  
  public boolean isEqual(ReadableInstant paramReadableInstant)
  {
    long l = DateTimeUtils.getInstantMillis(paramReadableInstant);
    return isEqual(l);
  }
  
  @ToString
  public String toString()
  {
    return ISODateTimeFormat.dateTime().print(this);
  }
  
  public String toString(DateTimeFormatter paramDateTimeFormatter)
  {
    if (paramDateTimeFormatter == null) {
      return toString();
    }
    return paramDateTimeFormatter.print(this);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.AbstractInstant
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import org.joda.time.DateTime;
import org.joda.time.DateTimeUtils;
import org.joda.time.Duration;
import org.joda.time.Interval;
import org.joda.time.MutableInterval;
import org.joda.time.Period;
import org.joda.time.PeriodType;
import org.joda.time.ReadableInstant;
import org.joda.time.ReadableInterval;
import org.joda.time.field.FieldUtils;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;

public abstract class AbstractInterval
  implements ReadableInterval
{
  protected void checkInterval(long paramLong1, long paramLong2)
  {
    if (paramLong2 < paramLong1) {
      throw new IllegalArgumentException("The end instant must be greater or equal to the start");
    }
  }
  
  public DateTime getStart()
  {
    return new DateTime(getStartMillis(), getChronology());
  }
  
  public DateTime getEnd()
  {
    return new DateTime(getEndMillis(), getChronology());
  }
  
  public boolean contains(long paramLong)
  {
    long l1 = getStartMillis();
    long l2 = getEndMillis();
    return (paramLong >= l1) && (paramLong < l2);
  }
  
  public boolean containsNow()
  {
    return contains(DateTimeUtils.currentTimeMillis());
  }
  
  public boolean contains(ReadableInstant paramReadableInstant)
  {
    if (paramReadableInstant == null) {
      return containsNow();
    }
    return contains(paramReadableInstant.getMillis());
  }
  
  public boolean contains(ReadableInterval paramReadableInterval)
  {
    if (paramReadableInterval == null) {
      return containsNow();
    }
    long l1 = paramReadableInterval.getStartMillis();
    long l2 = paramReadableInterval.getEndMillis();
    long l3 = getStartMillis();
    long l4 = getEndMillis();
    return (l3 <= l1) && (l1 < l4) && (l2 <= l4);
  }
  
  public boolean overlaps(ReadableInterval paramReadableInterval)
  {
    long l1 = getStartMillis();
    long l2 = getEndMillis();
    if (paramReadableInterval == null)
    {
      l3 = DateTimeUtils.currentTimeMillis();
      return (l1 < l3) && (l3 < l2);
    }
    long l3 = paramReadableInterval.getStartMillis();
    long l4 = paramReadableInterval.getEndMillis();
    return (l1 < l4) && (l3 < l2);
  }
  
  public boolean isEqual(ReadableInterval paramReadableInterval)
  {
    return (getStartMillis() == paramReadableInterval.getStartMillis()) && (getEndMillis() == paramReadableInterval.getEndMillis());
  }
  
  public boolean isBefore(long paramLong)
  {
    return getEndMillis() <= paramLong;
  }
  
  public boolean isBeforeNow()
  {
    return isBefore(DateTimeUtils.currentTimeMillis());
  }
  
  public boolean isBefore(ReadableInstant paramReadableInstant)
  {
    if (paramReadableInstant == null) {
      return isBeforeNow();
    }
    return isBefore(paramReadableInstant.getMillis());
  }
  
  public boolean isBefore(ReadableInterval paramReadableInterval)
  {
    if (paramReadableInterval == null) {
      return isBeforeNow();
    }
    return isBefore(paramReadableInterval.getStartMillis());
  }
  
  public boolean isAfter(long paramLong)
  {
    return getStartMillis() > paramLong;
  }
  
  public boolean isAfterNow()
  {
    return isAfter(DateTimeUtils.currentTimeMillis());
  }
  
  public boolean isAfter(ReadableInstant paramReadableInstant)
  {
    if (paramReadableInstant == null) {
      return isAfterNow();
    }
    return isAfter(paramReadableInstant.getMillis());
  }
  
  public boolean isAfter(ReadableInterval paramReadableInterval)
  {
    long l;
    if (paramReadableInterval == null) {
      l = DateTimeUtils.currentTimeMillis();
    } else {
      l = paramReadableInterval.getEndMillis();
    }
    return getStartMillis() >= l;
  }
  
  public Interval toInterval()
  {
    return new Interval(getStartMillis(), getEndMillis(), getChronology());
  }
  
  public MutableInterval toMutableInterval()
  {
    return new MutableInterval(getStartMillis(), getEndMillis(), getChronology());
  }
  
  public long toDurationMillis()
  {
    return FieldUtils.safeAdd(getEndMillis(), -getStartMillis());
  }
  
  public Duration toDuration()
  {
    long l = toDurationMillis();
    if (l == 0L) {
      return Duration.ZERO;
    }
    return new Duration(l);
  }
  
  public Period toPeriod()
  {
    return new Period(getStartMillis(), getEndMillis(), getChronology());
  }
  
  public Period toPeriod(PeriodType paramPeriodType)
  {
    return new Period(getStartMillis(), getEndMillis(), paramPeriodType, getChronology());
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!(paramObject instanceof ReadableInterval)) {
      return false;
    }
    ReadableInterval localReadableInterval = (ReadableInterval)paramObject;
    return (getStartMillis() == localReadableInterval.getStartMillis()) && (getEndMillis() == localReadableInterval.getEndMillis()) && (FieldUtils.equals(getChronology(), localReadableInterval.getChronology()));
  }
  
  public int hashCode()
  {
    long l1 = getStartMillis();
    long l2 = getEndMillis();
    int i = 97;
    i = 31 * i + (int)(l1 ^ l1 >>> 32);
    i = 31 * i + (int)(l2 ^ l2 >>> 32);
    i = 31 * i + getChronology().hashCode();
    return i;
  }
  
  public String toString()
  {
    DateTimeFormatter localDateTimeFormatter = ISODateTimeFormat.dateTime();
    localDateTimeFormatter = localDateTimeFormatter.withChronology(getChronology());
    StringBuffer localStringBuffer = new StringBuffer(48);
    localDateTimeFormatter.printTo(localStringBuffer, getStartMillis());
    localStringBuffer.append('/');
    localDateTimeFormatter.printTo(localStringBuffer, getEndMillis());
    return localStringBuffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.AbstractInterval
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import org.joda.time.Chronology;
import org.joda.time.DateTime;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeUtils;
import org.joda.time.DurationFieldType;
import org.joda.time.ReadableInstant;
import org.joda.time.ReadablePartial;
import org.joda.time.field.FieldUtils;
import org.joda.time.format.DateTimeFormatter;

public abstract class AbstractPartial
  implements ReadablePartial, Comparable<ReadablePartial>
{
  protected abstract DateTimeField getField(int paramInt, Chronology paramChronology);
  
  public DateTimeFieldType getFieldType(int paramInt)
  {
    return getField(paramInt, getChronology()).getType();
  }
  
  public DateTimeFieldType[] getFieldTypes()
  {
    DateTimeFieldType[] arrayOfDateTimeFieldType = new DateTimeFieldType[size()];
    for (int i = 0; i < arrayOfDateTimeFieldType.length; i++) {
      arrayOfDateTimeFieldType[i] = getFieldType(i);
    }
    return arrayOfDateTimeFieldType;
  }
  
  public DateTimeField getField(int paramInt)
  {
    return getField(paramInt, getChronology());
  }
  
  public DateTimeField[] getFields()
  {
    DateTimeField[] arrayOfDateTimeField = new DateTimeField[size()];
    for (int i = 0; i < arrayOfDateTimeField.length; i++) {
      arrayOfDateTimeField[i] = getField(i);
    }
    return arrayOfDateTimeField;
  }
  
  public int[] getValues()
  {
    int[] arrayOfInt = new int[size()];
    for (int i = 0; i < arrayOfInt.length; i++) {
      arrayOfInt[i] = getValue(i);
    }
    return arrayOfInt;
  }
  
  public int get(DateTimeFieldType paramDateTimeFieldType)
  {
    return getValue(indexOfSupported(paramDateTimeFieldType));
  }
  
  public boolean isSupported(DateTimeFieldType paramDateTimeFieldType)
  {
    return indexOf(paramDateTimeFieldType) != -1;
  }
  
  public int indexOf(DateTimeFieldType paramDateTimeFieldType)
  {
    int i = 0;
    for (int j = size(); i < j; i++) {
      if (getFieldType(i) == paramDateTimeFieldType) {
        return i;
      }
    }
    return -1;
  }
  
  protected int indexOfSupported(DateTimeFieldType paramDateTimeFieldType)
  {
    int i = indexOf(paramDateTimeFieldType);
    if (i == -1) {
      throw new IllegalArgumentException("Field '" + paramDateTimeFieldType + "' is not supported");
    }
    return i;
  }
  
  protected int indexOf(DurationFieldType paramDurationFieldType)
  {
    int i = 0;
    for (int j = size(); i < j; i++) {
      if (getFieldType(i).getDurationType() == paramDurationFieldType) {
        return i;
      }
    }
    return -1;
  }
  
  protected int indexOfSupported(DurationFieldType paramDurationFieldType)
  {
    int i = indexOf(paramDurationFieldType);
    if (i == -1) {
      throw new IllegalArgumentException("Field '" + paramDurationFieldType + "' is not supported");
    }
    return i;
  }
  
  public DateTime toDateTime(ReadableInstant paramReadableInstant)
  {
    Chronology localChronology = DateTimeUtils.getInstantChronology(paramReadableInstant);
    long l1 = DateTimeUtils.getInstantMillis(paramReadableInstant);
    long l2 = localChronology.set(this, l1);
    return new DateTime(l2, localChronology);
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!(paramObject instanceof ReadablePartial)) {
      return false;
    }
    ReadablePartial localReadablePartial = (ReadablePartial)paramObject;
    if (size() != localReadablePartial.size()) {
      return false;
    }
    int i = 0;
    for (int j = size(); i < j; i++) {
      if ((getValue(i) != localReadablePartial.getValue(i)) || (getFieldType(i) != localReadablePartial.getFieldType(i))) {
        return false;
      }
    }
    return FieldUtils.equals(getChronology(), localReadablePartial.getChronology());
  }
  
  public int hashCode()
  {
    int i = 157;
    int j = 0;
    for (int k = size(); j < k; j++)
    {
      i = 23 * i + getValue(j);
      i = 23 * i + getFieldType(j).hashCode();
    }
    i += getChronology().hashCode();
    return i;
  }
  
  public int compareTo(ReadablePartial paramReadablePartial)
  {
    if (this == paramReadablePartial) {
      return 0;
    }
    if (size() != paramReadablePartial.size()) {
      throw new ClassCastException("ReadablePartial objects must have matching field types");
    }
    int i = 0;
    for (int j = size(); i < j; i++) {
      if (getFieldType(i) != paramReadablePartial.getFieldType(i)) {
        throw new ClassCastException("ReadablePartial objects must have matching field types");
      }
    }
    i = 0;
    for (j = size(); i < j; i++)
    {
      if (getValue(i) > paramReadablePartial.getValue(i)) {
        return 1;
      }
      if (getValue(i) < paramReadablePartial.getValue(i)) {
        return -1;
      }
    }
    return 0;
  }
  
  public boolean isAfter(ReadablePartial paramReadablePartial)
  {
    if (paramReadablePartial == null) {
      throw new IllegalArgumentException("Partial cannot be null");
    }
    return compareTo(paramReadablePartial) > 0;
  }
  
  public boolean isBefore(ReadablePartial paramReadablePartial)
  {
    if (paramReadablePartial == null) {
      throw new IllegalArgumentException("Partial cannot be null");
    }
    return compareTo(paramReadablePartial) < 0;
  }
  
  public boolean isEqual(ReadablePartial paramReadablePartial)
  {
    if (paramReadablePartial == null) {
      throw new IllegalArgumentException("Partial cannot be null");
    }
    return compareTo(paramReadablePartial) == 0;
  }
  
  public String toString(DateTimeFormatter paramDateTimeFormatter)
  {
    if (paramDateTimeFormatter == null) {
      return toString();
    }
    return paramDateTimeFormatter.print(this);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.AbstractPartial
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import org.joda.convert.ToString;
import org.joda.time.DurationFieldType;
import org.joda.time.MutablePeriod;
import org.joda.time.Period;
import org.joda.time.PeriodType;
import org.joda.time.ReadablePeriod;
import org.joda.time.format.ISOPeriodFormat;
import org.joda.time.format.PeriodFormatter;

public abstract class AbstractPeriod
  implements ReadablePeriod
{
  public int size()
  {
    return getPeriodType().size();
  }
  
  public DurationFieldType getFieldType(int paramInt)
  {
    return getPeriodType().getFieldType(paramInt);
  }
  
  public DurationFieldType[] getFieldTypes()
  {
    DurationFieldType[] arrayOfDurationFieldType = new DurationFieldType[size()];
    for (int i = 0; i < arrayOfDurationFieldType.length; i++) {
      arrayOfDurationFieldType[i] = getFieldType(i);
    }
    return arrayOfDurationFieldType;
  }
  
  public int[] getValues()
  {
    int[] arrayOfInt = new int[size()];
    for (int i = 0; i < arrayOfInt.length; i++) {
      arrayOfInt[i] = getValue(i);
    }
    return arrayOfInt;
  }
  
  public int get(DurationFieldType paramDurationFieldType)
  {
    int i = indexOf(paramDurationFieldType);
    if (i == -1) {
      return 0;
    }
    return getValue(i);
  }
  
  public boolean isSupported(DurationFieldType paramDurationFieldType)
  {
    return getPeriodType().isSupported(paramDurationFieldType);
  }
  
  public int indexOf(DurationFieldType paramDurationFieldType)
  {
    return getPeriodType().indexOf(paramDurationFieldType);
  }
  
  public Period toPeriod()
  {
    return new Period(this);
  }
  
  public MutablePeriod toMutablePeriod()
  {
    return new MutablePeriod(this);
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!(paramObject instanceof ReadablePeriod)) {
      return false;
    }
    ReadablePeriod localReadablePeriod = (ReadablePeriod)paramObject;
    if (size() != localReadablePeriod.size()) {
      return false;
    }
    int i = 0;
    for (int j = size(); i < j; i++) {
      if ((getValue(i) != localReadablePeriod.getValue(i)) || (getFieldType(i) != localReadablePeriod.getFieldType(i))) {
        return false;
      }
    }
    return true;
  }
  
  public int hashCode()
  {
    int i = 17;
    int j = 0;
    for (int k = size(); j < k; j++)
    {
      i = 27 * i + getValue(j);
      i = 27 * i + getFieldType(j).hashCode();
    }
    return i;
  }
  
  @ToString
  public String toString()
  {
    return ISOPeriodFormat.standard().print(this);
  }
  
  public String toString(PeriodFormatter paramPeriodFormatter)
  {
    if (paramPeriodFormatter == null) {
      return toString();
    }
    return paramPeriodFormatter.print(this);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.AbstractPeriod
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import java.io.Serializable;
import org.joda.time.Chronology;
import org.joda.time.DateTimeUtils;
import org.joda.time.DateTimeZone;
import org.joda.time.ReadableDateTime;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.convert.ConverterManager;
import org.joda.time.convert.InstantConverter;

public abstract class BaseDateTime
  extends AbstractDateTime
  implements ReadableDateTime, Serializable
{
  private static final long serialVersionUID = -6728882245981L;
  private volatile long iMillis;
  private volatile Chronology iChronology;
  
  public BaseDateTime()
  {
    this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance());
  }
  
  public BaseDateTime(DateTimeZone paramDateTimeZone)
  {
    this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance(paramDateTimeZone));
  }
  
  public BaseDateTime(Chronology paramChronology)
  {
    this(DateTimeUtils.currentTimeMillis(), paramChronology);
  }
  
  public BaseDateTime(long paramLong)
  {
    this(paramLong, ISOChronology.getInstance());
  }
  
  public BaseDateTime(long paramLong, DateTimeZone paramDateTimeZone)
  {
    this(paramLong, ISOChronology.getInstance(paramDateTimeZone));
  }
  
  public BaseDateTime(long paramLong, Chronology paramChronology)
  {
    iChronology = checkChronology(paramChronology);
    iMillis = checkInstant(paramLong, iChronology);
  }
  
  public BaseDateTime(Object paramObject, DateTimeZone paramDateTimeZone)
  {
    InstantConverter localInstantConverter = ConverterManager.getInstance().getInstantConverter(paramObject);
    Chronology localChronology = checkChronology(localInstantConverter.getChronology(paramObject, paramDateTimeZone));
    iChronology = localChronology;
    iMillis = checkInstant(localInstantConverter.getInstantMillis(paramObject, localChronology), localChronology);
  }
  
  public BaseDateTime(Object paramObject, Chronology paramChronology)
  {
    InstantConverter localInstantConverter = ConverterManager.getInstance().getInstantConverter(paramObject);
    iChronology = checkChronology(localInstantConverter.getChronology(paramObject, paramChronology));
    iMillis = checkInstant(localInstantConverter.getInstantMillis(paramObject, paramChronology), iChronology);
  }
  
  public BaseDateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7)
  {
    this(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, ISOChronology.getInstance());
  }
  
  public BaseDateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, DateTimeZone paramDateTimeZone)
  {
    this(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7, ISOChronology.getInstance(paramDateTimeZone));
  }
  
  public BaseDateTime(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, Chronology paramChronology)
  {
    iChronology = checkChronology(paramChronology);
    long l = iChronology.getDateTimeMillis(paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramInt6, paramInt7);
    
    iMillis = checkInstant(l, iChronology);
  }
  
  protected Chronology checkChronology(Chronology paramChronology)
  {
    return DateTimeUtils.getChronology(paramChronology);
  }
  
  protected long checkInstant(long paramLong, Chronology paramChronology)
  {
    return paramLong;
  }
  
  public long getMillis()
  {
    return iMillis;
  }
  
  public Chronology getChronology()
  {
    return iChronology;
  }
  
  protected void setMillis(long paramLong)
  {
    iMillis = checkInstant(paramLong, iChronology);
  }
  
  protected void setChronology(Chronology paramChronology)
  {
    iChronology = checkChronology(paramChronology);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.BaseDateTime
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import java.io.Serializable;
import org.joda.time.Chronology;
import org.joda.time.DateTimeUtils;
import org.joda.time.Interval;
import org.joda.time.Period;
import org.joda.time.PeriodType;
import org.joda.time.ReadableDuration;
import org.joda.time.ReadableInstant;
import org.joda.time.convert.ConverterManager;
import org.joda.time.convert.DurationConverter;
import org.joda.time.field.FieldUtils;

public abstract class BaseDuration
  extends AbstractDuration
  implements ReadableDuration, Serializable
{
  private static final long serialVersionUID = 2581698638990L;
  private volatile long iMillis;
  
  protected BaseDuration(long paramLong)
  {
    iMillis = paramLong;
  }
  
  protected BaseDuration(long paramLong1, long paramLong2)
  {
    iMillis = FieldUtils.safeAdd(paramLong2, -paramLong1);
  }
  
  protected BaseDuration(ReadableInstant paramReadableInstant1, ReadableInstant paramReadableInstant2)
  {
    if (paramReadableInstant1 == paramReadableInstant2)
    {
      iMillis = 0L;
    }
    else
    {
      long l1 = DateTimeUtils.getInstantMillis(paramReadableInstant1);
      long l2 = DateTimeUtils.getInstantMillis(paramReadableInstant2);
      iMillis = FieldUtils.safeAdd(l2, -l1);
    }
  }
  
  protected BaseDuration(Object paramObject)
  {
    DurationConverter localDurationConverter = ConverterManager.getInstance().getDurationConverter(paramObject);
    iMillis = localDurationConverter.getDurationMillis(paramObject);
  }
  
  public long getMillis()
  {
    return iMillis;
  }
  
  protected void setMillis(long paramLong)
  {
    iMillis = paramLong;
  }
  
  public Period toPeriod(PeriodType paramPeriodType)
  {
    return new Period(getMillis(), paramPeriodType);
  }
  
  public Period toPeriod(Chronology paramChronology)
  {
    return new Period(getMillis(), paramChronology);
  }
  
  public Period toPeriod(PeriodType paramPeriodType, Chronology paramChronology)
  {
    return new Period(getMillis(), paramPeriodType, paramChronology);
  }
  
  public Period toPeriodFrom(ReadableInstant paramReadableInstant)
  {
    return new Period(paramReadableInstant, this);
  }
  
  public Period toPeriodFrom(ReadableInstant paramReadableInstant, PeriodType paramPeriodType)
  {
    return new Period(paramReadableInstant, this, paramPeriodType);
  }
  
  public Period toPeriodTo(ReadableInstant paramReadableInstant)
  {
    return new Period(this, paramReadableInstant);
  }
  
  public Period toPeriodTo(ReadableInstant paramReadableInstant, PeriodType paramPeriodType)
  {
    return new Period(this, paramReadableInstant, paramPeriodType);
  }
  
  public Interval toIntervalFrom(ReadableInstant paramReadableInstant)
  {
    return new Interval(paramReadableInstant, this);
  }
  
  public Interval toIntervalTo(ReadableInstant paramReadableInstant)
  {
    return new Interval(this, paramReadableInstant);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.BaseDuration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import java.io.Serializable;
import org.joda.time.Chronology;
import org.joda.time.DateTimeUtils;
import org.joda.time.MutableInterval;
import org.joda.time.ReadWritableInterval;
import org.joda.time.ReadableDuration;
import org.joda.time.ReadableInstant;
import org.joda.time.ReadableInterval;
import org.joda.time.ReadablePeriod;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.convert.ConverterManager;
import org.joda.time.convert.IntervalConverter;
import org.joda.time.field.FieldUtils;

public abstract class BaseInterval
  extends AbstractInterval
  implements ReadableInterval, Serializable
{
  private static final long serialVersionUID = 576586928732749278L;
  private volatile Chronology iChronology;
  private volatile long iStartMillis;
  private volatile long iEndMillis;
  
  protected BaseInterval(long paramLong1, long paramLong2, Chronology paramChronology)
  {
    iChronology = DateTimeUtils.getChronology(paramChronology);
    checkInterval(paramLong1, paramLong2);
    iStartMillis = paramLong1;
    iEndMillis = paramLong2;
  }
  
  protected BaseInterval(ReadableInstant paramReadableInstant1, ReadableInstant paramReadableInstant2)
  {
    if ((paramReadableInstant1 == null) && (paramReadableInstant2 == null))
    {
      iStartMillis = (iEndMillis = DateTimeUtils.currentTimeMillis());
      iChronology = ISOChronology.getInstance();
    }
    else
    {
      iChronology = DateTimeUtils.getInstantChronology(paramReadableInstant1);
      iStartMillis = DateTimeUtils.getInstantMillis(paramReadableInstant1);
      iEndMillis = DateTimeUtils.getInstantMillis(paramReadableInstant2);
      checkInterval(iStartMillis, iEndMillis);
    }
  }
  
  protected BaseInterval(ReadableInstant paramReadableInstant, ReadableDuration paramReadableDuration)
  {
    iChronology = DateTimeUtils.getInstantChronology(paramReadableInstant);
    iStartMillis = DateTimeUtils.getInstantMillis(paramReadableInstant);
    long l = DateTimeUtils.getDurationMillis(paramReadableDuration);
    iEndMillis = FieldUtils.safeAdd(iStartMillis, l);
    checkInterval(iStartMillis, iEndMillis);
  }
  
  protected BaseInterval(ReadableDuration paramReadableDuration, ReadableInstant paramReadableInstant)
  {
    iChronology = DateTimeUtils.getInstantChronology(paramReadableInstant);
    iEndMillis = DateTimeUtils.getInstantMillis(paramReadableInstant);
    long l = DateTimeUtils.getDurationMillis(paramReadableDuration);
    iStartMillis = FieldUtils.safeAdd(iEndMillis, -l);
    checkInterval(iStartMillis, iEndMillis);
  }
  
  protected BaseInterval(ReadableInstant paramReadableInstant, ReadablePeriod paramReadablePeriod)
  {
    Chronology localChronology = DateTimeUtils.getInstantChronology(paramReadableInstant);
    iChronology = localChronology;
    iStartMillis = DateTimeUtils.getInstantMillis(paramReadableInstant);
    if (paramReadablePeriod == null) {
      iEndMillis = iStartMillis;
    } else {
      iEndMillis = localChronology.add(paramReadablePeriod, iStartMillis, 1);
    }
    checkInterval(iStartMillis, iEndMillis);
  }
  
  protected BaseInterval(ReadablePeriod paramReadablePeriod, ReadableInstant paramReadableInstant)
  {
    Chronology localChronology = DateTimeUtils.getInstantChronology(paramReadableInstant);
    iChronology = localChronology;
    iEndMillis = DateTimeUtils.getInstantMillis(paramReadableInstant);
    if (paramReadablePeriod == null) {
      iStartMillis = iEndMillis;
    } else {
      iStartMillis = localChronology.add(paramReadablePeriod, iEndMillis, -1);
    }
    checkInterval(iStartMillis, iEndMillis);
  }
  
  protected BaseInterval(Object paramObject, Chronology paramChronology)
  {
    IntervalConverter localIntervalConverter = ConverterManager.getInstance().getIntervalConverter(paramObject);
    Object localObject;
    if (localIntervalConverter.isReadableInterval(paramObject, paramChronology))
    {
      localObject = (ReadableInterval)paramObject;
      iChronology = (paramChronology != null ? paramChronology : ((ReadableInterval)localObject).getChronology());
      iStartMillis = ((ReadableInterval)localObject).getStartMillis();
      iEndMillis = ((ReadableInterval)localObject).getEndMillis();
    }
    else if ((this instanceof ReadWritableInterval))
    {
      localIntervalConverter.setInto((ReadWritableInterval)this, paramObject, paramChronology);
    }
    else
    {
      localObject = new MutableInterval();
      localIntervalConverter.setInto((ReadWritableInterval)localObject, paramObject, paramChronology);
      iChronology = ((MutableInterval)localObject).getChronology();
      iStartMillis = ((MutableInterval)localObject).getStartMillis();
      iEndMillis = ((MutableInterval)localObject).getEndMillis();
    }
    checkInterval(iStartMillis, iEndMillis);
  }
  
  public Chronology getChronology()
  {
    return iChronology;
  }
  
  public long getStartMillis()
  {
    return iStartMillis;
  }
  
  public long getEndMillis()
  {
    return iEndMillis;
  }
  
  protected void setInterval(long paramLong1, long paramLong2, Chronology paramChronology)
  {
    checkInterval(paramLong1, paramLong2);
    iStartMillis = paramLong1;
    iEndMillis = paramLong2;
    iChronology = DateTimeUtils.getChronology(paramChronology);
  }
}

/* Location:
 * Qualified Name:     org.joda.time.base.BaseInterval
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

public abstract class BaseLocal
  extends AbstractPartial
{
  private static final long serialVersionUID = 276453175381783L;
  
  protected abstract long getLocalMillis();
}

/* Location:
 * Qualified Name:     org.joda.time.base.BaseLocal
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.joda.time.base;

import java.io.Serializable;
import java.util.Locale;
import org.joda.time.Chronology;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeUtils;
import org.joda.time.ReadablePartial;
import org.joda.time.convert.ConverterManager;
import org.joda.time.convert.PartialConverter;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public abstract class BasePartial
  extends AbstractPartial
  implements ReadablePartial, Serializable
{
  private static final long serialVersionUID = 2353678632973660L;
  private final Chronology iChronology;
  private final int[] iValues;
  
  protected BasePartial()
  {
    this(DateTimeUtils.currentTimeMillis(), null);
  }
  
  protected BasePartial(Chronology paramChronology)
  {
    this(DateTimeUtils.currentTimeMillis(), paramChronology);
  }
  
  protected BasePartial(long paramLong)
  {
    this(paramLong, null);
  }
  
  protected BasePartial(long paramLong, Chronology paramChronology)
  {
    paramChronology = DateTimeUtils.getChronology(paramChronology);
  
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

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd