public int getCharactersLength() {
		if (slen == -1) {
			switch (type) {
			case gYear: // Year, [Time-Zone]
				slen = (year < 0 ? 5 : 4);
				break;
			case gYearMonth: // Year, MonthDay, [TimeZone]
				slen = (year < 0 ? 5 : 4) + 3;
				break;
			case date: // Year, MonthDay, [TimeZone]
				slen = (year < 0 ? 5 : 4) + 6;
				break;
			case dateTime: // Year, MonthDay, Time, [FractionalSecs], [TimeZone]
				// e.g. "0001-01-01T00:00:00.111+00:33";
				sizeFractionalSecs = fractionalSecs == 0 ? 0 : MethodsBag
						.getStringSize(fractionalSecs) + 1;
				slen = (year < 0 ? 5 : 4) + 6 + 9 + (sizeFractionalSecs);
				break;
			case gMonth: // MonthDay, [TimeZone]
				// e.g. "--12"
				slen = 1 + 3;
				break;
			case gMonthDay: // MonthDay, [TimeZone]
				// e.g. "--01-28"
				slen = 1 + 6;
				break;
			case gDay: // MonthDay, [TimeZone]
				// "---16";
				slen = 3 + 2;
				break;
			case time: // Time, [FractionalSecs], [TimeZone]
				// e.g. "12:34:56.135"
				sizeFractionalSecs = fractionalSecs == 0 ? 0 : MethodsBag
						.getStringSize(fractionalSecs) + 1;
				slen = 8 + (sizeFractionalSecs);
				break;
			default:
				throw new UnsupportedOperationException();
			}

			// [TimeZone]
			if (presenceTimezone) {
				slen += timezone == 0 ? 1 : 6;
			}
		}

		return slen;
	}
public int getCharactersLength ( ) { if ( slen == - 1 ) { switch ( type ) { case gYear : slen = ( year < 0 ? 5 : 4 ) ; break ; case gYearMonth : slen = ( year < 0 ? 5 : 4 ) + 3 ; break ; case date : slen = ( year < 0 ? 5 : 4 ) + 6 ; break ; case dateTime : sizeFractionalSecs = fractionalSecs == 0 ? 0 : MethodsBag . getStringSize ( fractionalSecs ) + 1 ; slen = ( year < 0 ? 5 : 4 ) + 6 + 9 + ( sizeFractionalSecs ) ; break ; case gMonth : slen = 1 + 3 ; break ; case gMonthDay : slen = 1 + 6 ; break ; case gDay : slen = 3 + 2 ; break ; case time : sizeFractionalSecs = fractionalSecs == 0 ? 0 : MethodsBag . getStringSize ( fractionalSecs ) + 1 ; slen = 8 + ( sizeFractionalSecs ) ; break ; default : throw new UnsupportedOperationException ( ) ; } if ( presenceTimezone ) { slen += timezone == 0 ? 1 : 6 ; } } return slen ; }
}