Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *  Copyright 2001-2013 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.chrono;
 
This field is not publicy exposed by ISOChronology, but rather it is used to build the yearOfCentury and centuryOfEra fields. It merely drops the sign of the year.

Author(s):
Brian S O'Neill
Since:
1.0
See also:
GJYearOfEraDateTimeField
 
 
     @SuppressWarnings("unused")
     private static final long serialVersionUID = 7037524068969447317L;

    
Singleton instance
 
     static final DateTimeField INSTANCE = new ISOYearOfEraDateTimeField();

    
Restricted constructor.
 
     private ISOYearOfEraDateTimeField() {
         super(GregorianChronology.getInstanceUTC().year(), DateTimeFieldType.yearOfEra());
     }
 
     public int get(long instant) {
         int year = getWrappedField().get(instant);
         return year < 0 ? -year : year;
     }
 
     public long add(long instantint years) {
         return getWrappedField().add(instantyears);
     }
 
     public long add(long instantlong years) {
         return getWrappedField().add(instantyears);
     }
 
     public long addWrapField(long instantint years) {
         return getWrappedField().addWrapField(instantyears);
     }
 
     public int[] addWrapField(ReadablePartial instantint fieldIndexint[] valuesint years) {
         return getWrappedField().addWrapField(instantfieldIndexvaluesyears);
     }
 
     public int getDifference(long minuendInstantlong subtrahendInstant) {
         return getWrappedField().getDifference(minuendInstantsubtrahendInstant);
     }
 
     public long getDifferenceAsLong(long minuendInstantlong subtrahendInstant) {
         return getWrappedField().getDifferenceAsLong(minuendInstantsubtrahendInstant);
     }
 
     public long set(long instantint year) {
         FieldUtils.verifyValueBounds(thisyear, 0, getMaximumValue());
         if (getWrappedField().get(instant) < 0) {
             year = -year;
         }
         return super.set(instantyear);
     }
 
     public int getMinimumValue() {
         return 0;
     }
 
     public int getMaximumValue() {
         return getWrappedField().getMaximumValue();
     }
 
     public long roundFloor(long instant) {
         return getWrappedField().roundFloor(instant);
     }
 
     public long roundCeiling(long instant) {
        return getWrappedField().roundCeiling(instant);
    }
    public long remainder(long instant) {
        return getWrappedField().remainder(instant);
    }

    
Serialization singleton
    private Object readResolve() {
        return ;
    }
New to GrepCode? Check out our FAQ X