code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
@Override public <B extends Appendable> B format(final long millis, final B buf) { return printer.format(millis, buf); }
<p>Formats a millisecond {@code long} value into the supplied {@code StringBuffer}.</p> @param millis the millisecond value to format @param buf the buffer to format into @return the specified string buffer @since 3.5
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public <B extends Appendable> B format(final Date date, final B buf) { return printer.format(date, buf); }
<p>Formats a {@code Date} object into the supplied {@code StringBuffer} using a {@code GregorianCalendar}.</p> @param date the date to format @param buf the buffer to format into @return the specified string buffer @since 3.5
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public <B extends Appendable> B format(final Calendar calendar, final B buf) { return printer.format(calendar, buf); }
<p>Formats a {@code Calendar} object into the supplied {@code StringBuffer}.</p> @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @since 3.5
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public Date parse(final String source) throws ParseException { return parser.parse(source); }
<p>Formats a {@code Calendar} object into the supplied {@code StringBuffer}.</p> @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @since 3.5
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public Date parse(final String source, final ParsePosition pos) { return parser.parse(source, pos); }
<p>Formats a {@code Calendar} object into the supplied {@code StringBuffer}.</p> @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @since 3.5
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public boolean parse(final String source, final ParsePosition pos, final Calendar calendar) { return parser.parse(source, pos, calendar); }
<p>Formats a {@code Calendar} object into the supplied {@code StringBuffer}.</p> @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @since 3.5
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public Object parseObject(final String source, final ParsePosition pos) { return parser.parseObject(source, pos); }
<p>Formats a {@code Calendar} object into the supplied {@code StringBuffer}.</p> @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @since 3.5
parseObject
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public String getPattern() { return printer.getPattern(); }
<p>Gets the pattern used by this formatter.</p> @return the pattern, {@link SimpleDateFormat} compatible
getPattern
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public TimeZone getTimeZone() { return printer.getTimeZone(); }
<p>Gets the time zone used by this formatter.</p> <p>This zone is always used for {@code Date} formatting. </p> @return the time zone
getTimeZone
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public Locale getLocale() { return printer.getLocale(); }
<p>Gets the locale used by this formatter.</p> @return the locale
getLocale
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
public int getMaxLengthEstimate() { return printer.getMaxLengthEstimate(); }
<p>Gets an estimate for the maximum string length that the formatter will produce.</p> <p>The actual formatted length will almost always be less than or equal to this amount.</p> @return the maximum formatted length
getMaxLengthEstimate
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public boolean equals(final Object obj) { if (!(obj instanceof FastDateFormat)) { return false; } final FastDateFormat other = (FastDateFormat) obj; // no need to check parser, as it has same invariants as printer return printer.equals(other.printer); }
<p>Compares two objects for equality.</p> @param obj the object to compare to @return {@code true} if equal
equals
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public int hashCode() { return printer.hashCode(); }
<p>Returns a hash code compatible with equals.</p> @return a hash code compatible with equals
hashCode
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
@Override public String toString() { return "FastDateFormat[" + printer.getPattern() + "," + printer.getLocale() + "," + printer.getTimeZone().getID() + "]"; }
<p>Gets a debugging string version of this formatter.</p> @return a debugging string
toString
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateFormat.java
Apache-2.0
private void init(final Calendar definingCalendar) { patterns = new ArrayList<>(); final StrategyParser fm = new StrategyParser(definingCalendar); for(;;) { final StrategyAndWidth field = fm.getNextStrategy(); if(field==null) { break; } patterns.add(field); } }
Initialize derived fields from defining fields. This is called from constructor and from readObject (de-serialization) @param definingCalendar the {@link Calendar} instance used to initialize this FastDateParser
init
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public boolean equals(final Object obj) { if (!(obj instanceof FastDateParser)) { return false; } final FastDateParser other = (FastDateParser) obj; return pattern.equals(other.pattern) && timeZone.equals(other.timeZone) && locale.equals(other.locale); }
<p>Compare another object for equality with this object.</p> @param obj the object to compare to @return <code>true</code>if equal to this instance
equals
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public int hashCode() { return pattern.hashCode() + 13 * (timeZone.hashCode() + 13 * locale.hashCode()); }
<p>Return a hash code compatible with equals.</p> @return a hash code compatible with equals
hashCode
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public String toString() { return "FastDateParser[" + pattern + "," + locale + "," + timeZone.getID() + "]"; }
<p>Get a string version of this formatter.</p> @return a debugging string
toString
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final Calendar definingCalendar = Calendar.getInstance(timeZone, locale); init(definingCalendar); }
Create the object after serialization. This implementation reinitializes the transient properties. @param in ObjectInputStream from which the object is being deserialized. @throws IOException if there is an IO issue. @throws ClassNotFoundException if a class cannot be found.
readObject
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public Object parseObject(final String source) throws ParseException { return parse(source); }
Create the object after serialization. This implementation reinitializes the transient properties. @param in ObjectInputStream from which the object is being deserialized. @throws IOException if there is an IO issue. @throws ClassNotFoundException if a class cannot be found.
parseObject
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public Date parse(final String source) throws ParseException { final ParsePosition pp = new ParsePosition(0); final Date date= parse(source, pp); if (date == null) { // Add a note re supported date range if (locale.equals(JAPANESE_IMPERIAL)) { throw new ParseException( "(The " +locale + " locale does not support dates before 1868 AD)\n" + "Unparseable date: \""+source, pp.getErrorIndex()); } throw new ParseException("Unparseable date: "+source, pp.getErrorIndex()); } return date; }
Create the object after serialization. This implementation reinitializes the transient properties. @param in ObjectInputStream from which the object is being deserialized. @throws IOException if there is an IO issue. @throws ClassNotFoundException if a class cannot be found.
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public Object parseObject(final String source, final ParsePosition pos) { return parse(source, pos); }
Create the object after serialization. This implementation reinitializes the transient properties. @param in ObjectInputStream from which the object is being deserialized. @throws IOException if there is an IO issue. @throws ClassNotFoundException if a class cannot be found.
parseObject
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public Date parse(final String source, final ParsePosition pos) { // timing tests indicate getting new instance is 19% faster than cloning final Calendar cal= Calendar.getInstance(timeZone, locale); cal.clear(); return parse(source, pos, cal) ? cal.getTime() : null; }
Create the object after serialization. This implementation reinitializes the transient properties. @param in ObjectInputStream from which the object is being deserialized. @throws IOException if there is an IO issue. @throws ClassNotFoundException if a class cannot be found.
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override public boolean parse(final String source, final ParsePosition pos, final Calendar calendar) { final ListIterator<StrategyAndWidth> lt = patterns.listIterator(); while (lt.hasNext()) { final StrategyAndWidth strategyAndWidth = lt.next(); final int maxWidth = strategyAndWidth.getMaxWidth(lt); if (!strategyAndWidth.strategy.parse(this, calendar, source, pos, maxWidth)) { return false; } } return true; }
Parse a formatted date string according to the format. Updates the Calendar with parsed fields. Upon success, the ParsePosition index is updated to indicate how much of the source text was consumed. Not all source text needs to be consumed. Upon parse failure, ParsePosition error index is updated to the offset of the source text which does not match the supplied format. @param source The text to parse. @param pos On input, the position in the source to start parsing, on output, updated position. @param calendar The calendar into which to set parsed fields. @return true, if source has been parsed (pos parsePosition is updated); otherwise false (and pos errorIndex is updated) @throws IllegalArgumentException when Calendar has been set to be not lenient, and a parsed field is out of range.
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private static StringBuilder simpleQuote(final StringBuilder sb, final String value) { for (int i = 0; i < value.length(); ++i) { final char c = value.charAt(i); switch (c) { case '\\': case '^': case '$': case '.': case '|': case '?': case '*': case '+': case '(': case ')': case '[': case '{': sb.append('\\'); default: sb.append(c); } } return sb; }
Parse a formatted date string according to the format. Updates the Calendar with parsed fields. Upon success, the ParsePosition index is updated to indicate how much of the source text was consumed. Not all source text needs to be consumed. Upon parse failure, ParsePosition error index is updated to the offset of the source text which does not match the supplied format. @param source The text to parse. @param pos On input, the position in the source to start parsing, on output, updated position. @param calendar The calendar into which to set parsed fields. @return true, if source has been parsed (pos parsePosition is updated); otherwise false (and pos errorIndex is updated) @throws IllegalArgumentException when Calendar has been set to be not lenient, and a parsed field is out of range.
simpleQuote
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private static Map<String, Integer> appendDisplayNames(final Calendar cal, final Locale locale, final int field, final StringBuilder regex) { final Map<String, Integer> values = new HashMap<>(); final Map<String, Integer> displayNames = cal.getDisplayNames(field, Calendar.ALL_STYLES, locale); final TreeSet<String> sorted = new TreeSet<>(LONGER_FIRST_LOWERCASE); for (final Map.Entry<String, Integer> displayName : displayNames.entrySet()) { final String key = displayName.getKey().toLowerCase(locale); if (sorted.add(key)) { values.put(key, displayName.getValue()); } } for (final String symbol : sorted) { simpleQuote(regex, symbol).append('|'); } return values; }
Get the short and long values displayed for a field @param cal The calendar to obtain the short and long values @param locale The locale of display names @param field The field of interest @param regex The regular expression to build @return The map of string display names to field values
appendDisplayNames
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private int adjustYear(final int twoDigitYear) { final int trial = century + twoDigitYear; return twoDigitYear >= startYear ? trial : trial + 100; }
Adjust dates to be within appropriate century @param twoDigitYear The year to adjust @return A value between centuryStart(inclusive) to centuryStart+100(exclusive)
adjustYear
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
boolean isNumber() { return false; }
Is this field a number? The default implementation returns false. @return true, if field is a number
isNumber
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
void createPattern(final String regex) { this.pattern = Pattern.compile(regex); }
A strategy to parse a single field from the parsing pattern
createPattern
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override boolean isNumber() { return false; }
Is this field a number? The default implementation returns false. @return true, if field is a number
isNumber
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override boolean parse(final FastDateParser parser, final Calendar calendar, final String source, final ParsePosition pos, final int maxWidth) { final Matcher matcher = pattern.matcher(source.substring(pos.getIndex())); if (!matcher.lookingAt()) { pos.setErrorIndex(pos.getIndex()); return false; } pos.setIndex(pos.getIndex() + matcher.end(1)); setCalendar(parser, calendar, matcher.group(1)); return true; }
Is this field a number? The default implementation returns false. @return true, if field is a number
parse
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private Strategy getStrategy(final char f, final int width, final Calendar definingCalendar) { switch(f) { default: throw new IllegalArgumentException("Format '"+f+"' not supported"); case 'D': return DAY_OF_YEAR_STRATEGY; case 'E': return getLocaleSpecificStrategy(Calendar.DAY_OF_WEEK, definingCalendar); case 'F': return DAY_OF_WEEK_IN_MONTH_STRATEGY; case 'G': return getLocaleSpecificStrategy(Calendar.ERA, definingCalendar); case 'H': // Hour in day (0-23) return HOUR_OF_DAY_STRATEGY; case 'K': // Hour in am/pm (0-11) return HOUR_STRATEGY; case 'M': return width>=3 ?getLocaleSpecificStrategy(Calendar.MONTH, definingCalendar) :NUMBER_MONTH_STRATEGY; case 'S': return MILLISECOND_STRATEGY; case 'W': return WEEK_OF_MONTH_STRATEGY; case 'a': return getLocaleSpecificStrategy(Calendar.AM_PM, definingCalendar); case 'd': return DAY_OF_MONTH_STRATEGY; case 'h': // Hour in am/pm (1-12), i.e. midday/midnight is 12, not 0 return HOUR12_STRATEGY; case 'k': // Hour in day (1-24), i.e. midnight is 24, not 0 return HOUR24_OF_DAY_STRATEGY; case 'm': return MINUTE_STRATEGY; case 's': return SECOND_STRATEGY; case 'u': return DAY_OF_WEEK_STRATEGY; case 'w': return WEEK_OF_YEAR_STRATEGY; case 'y': case 'Y': return width>2 ?LITERAL_YEAR_STRATEGY :ABBREVIATED_YEAR_STRATEGY; case 'X': return ISO8601TimeZoneStrategy.getStrategy(width); case 'Z': if (width==2) { return ISO8601TimeZoneStrategy.ISO_8601_3_STRATEGY; } //$FALL-THROUGH$ case 'z': return getLocaleSpecificStrategy(Calendar.ZONE_OFFSET, definingCalendar); } }
Obtain a Strategy given a field from a SimpleDateFormat pattern @param f A sub-sequence of the SimpleDateFormat pattern @param definingCalendar The calendar to obtain the short and long values @return The Strategy that will handle parsing for the field
getStrategy
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private static ConcurrentMap<Locale, Strategy> getCache(final int field) { synchronized (caches) { if (caches[field] == null) { caches[field] = new ConcurrentHashMap<>(3); } return caches[field]; } }
Get a cache of Strategies for a particular field @param field The Calendar field @return a cache of Locale to Strategy
getCache
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private Strategy getLocaleSpecificStrategy(final int field, final Calendar definingCalendar) { final ConcurrentMap<Locale, Strategy> cache = getCache(field); Strategy strategy = cache.get(locale); if (strategy == null) { strategy = field == Calendar.ZONE_OFFSET ? new TimeZoneStrategy(locale) : new CaseInsensitiveTextStrategy(field, definingCalendar, locale); final Strategy inCache = cache.putIfAbsent(locale, strategy); if (inCache != null) { return inCache; } } return strategy; }
Construct a Strategy that parses a Text field @param field The Calendar field @param definingCalendar The calendar to obtain the short and long values @return a TextStrategy for the field and Locale
getLocaleSpecificStrategy
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
int modify(final FastDateParser parser, final int iValue) { return iValue; }
Make any modifications to parsed integer @param parser The parser @param iValue The parsed integer @return The modified value
modify
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
static Strategy getStrategy(final int tokenLen) { switch(tokenLen) { case 1: return ISO_8601_1_STRATEGY; case 2: return ISO_8601_2_STRATEGY; case 3: return ISO_8601_3_STRATEGY; default: throw new IllegalArgumentException("invalid number of X"); } }
Factory method for ISO8601TimeZoneStrategies. @param tokenLen a token indicating the length of the TimeZone String to be formatted. @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such strategy exists, an IllegalArgumentException will be thrown.
getStrategy
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override int modify(final FastDateParser parser, final int iValue) { return iValue-1; }
Factory method for ISO8601TimeZoneStrategies. @param tokenLen a token indicating the length of the TimeZone String to be formatted. @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such strategy exists, an IllegalArgumentException will be thrown.
modify
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override int modify(final FastDateParser parser, final int iValue) { return iValue != 7 ? iValue + 1 : Calendar.SUNDAY; }
Factory method for ISO8601TimeZoneStrategies. @param tokenLen a token indicating the length of the TimeZone String to be formatted. @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such strategy exists, an IllegalArgumentException will be thrown.
modify
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override int modify(final FastDateParser parser, final int iValue) { return iValue == 24 ? 0 : iValue; }
Factory method for ISO8601TimeZoneStrategies. @param tokenLen a token indicating the length of the TimeZone String to be formatted. @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such strategy exists, an IllegalArgumentException will be thrown.
modify
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
@Override int modify(final FastDateParser parser, final int iValue) { return iValue == 12 ? 0 : iValue; }
Factory method for ISO8601TimeZoneStrategies. @param tokenLen a token indicating the length of the TimeZone String to be formatted. @return a ISO8601TimeZoneStrategy that can format TimeZone String of length {@code tokenLen}. If no such strategy exists, an IllegalArgumentException will be thrown.
modify
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDateParser.java
Apache-2.0
private void init() { final List<Rule> rulesList = parsePattern(); mRules = rulesList.toArray(new Rule[rulesList.size()]); int len = 0; for (int i=mRules.length; --i >= 0; ) { len += mRules[i].estimateLength(); } mMaxLengthEstimate = len; }
<p>Initializes the instance for first use.</p>
init
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
protected List<Rule> parsePattern() { final DateFormatSymbols symbols = new DateFormatSymbols(mLocale); final List<Rule> rules = new ArrayList<>(); final String[] ERAs = symbols.getEras(); final String[] months = symbols.getMonths(); final String[] shortMonths = symbols.getShortMonths(); final String[] weekdays = symbols.getWeekdays(); final String[] shortWeekdays = symbols.getShortWeekdays(); final String[] AmPmStrings = symbols.getAmPmStrings(); final int length = mPattern.length(); final int[] indexRef = new int[1]; for (int i = 0; i < length; i++) { indexRef[0] = i; final String token = parseToken(mPattern, indexRef); i = indexRef[0]; final int tokenLen = token.length(); if (tokenLen == 0) { break; } Rule rule; final char c = token.charAt(0); switch (c) { case 'G': // era designator (text) rule = new TextField(Calendar.ERA, ERAs); break; case 'y': // year (number) case 'Y': // week year if (tokenLen == 2) { rule = TwoDigitYearField.INSTANCE; } else { rule = selectNumberRule(Calendar.YEAR, tokenLen < 4 ? 4 : tokenLen); } if (c == 'Y') { rule = new WeekYear((NumberRule) rule); } break; case 'M': // month in year (text and number) if (tokenLen >= 4) { rule = new TextField(Calendar.MONTH, months); } else if (tokenLen == 3) { rule = new TextField(Calendar.MONTH, shortMonths); } else if (tokenLen == 2) { rule = TwoDigitMonthField.INSTANCE; } else { rule = UnpaddedMonthField.INSTANCE; } break; case 'd': // day in month (number) rule = selectNumberRule(Calendar.DAY_OF_MONTH, tokenLen); break; case 'h': // hour in am/pm (number, 1..12) rule = new TwelveHourField(selectNumberRule(Calendar.HOUR, tokenLen)); break; case 'H': // hour in day (number, 0..23) rule = selectNumberRule(Calendar.HOUR_OF_DAY, tokenLen); break; case 'm': // minute in hour (number) rule = selectNumberRule(Calendar.MINUTE, tokenLen); break; case 's': // second in minute (number) rule = selectNumberRule(Calendar.SECOND, tokenLen); break; case 'S': // millisecond (number) rule = selectNumberRule(Calendar.MILLISECOND, tokenLen); break; case 'E': // day in week (text) rule = new TextField(Calendar.DAY_OF_WEEK, tokenLen < 4 ? shortWeekdays : weekdays); break; case 'u': // day in week (number) rule = new DayInWeekField(selectNumberRule(Calendar.DAY_OF_WEEK, tokenLen)); break; case 'D': // day in year (number) rule = selectNumberRule(Calendar.DAY_OF_YEAR, tokenLen); break; case 'F': // day of week in month (number) rule = selectNumberRule(Calendar.DAY_OF_WEEK_IN_MONTH, tokenLen); break; case 'w': // week in year (number) rule = selectNumberRule(Calendar.WEEK_OF_YEAR, tokenLen); break; case 'W': // week in month (number) rule = selectNumberRule(Calendar.WEEK_OF_MONTH, tokenLen); break; case 'a': // am/pm marker (text) rule = new TextField(Calendar.AM_PM, AmPmStrings); break; case 'k': // hour in day (1..24) rule = new TwentyFourHourField(selectNumberRule(Calendar.HOUR_OF_DAY, tokenLen)); break; case 'K': // hour in am/pm (0..11) rule = selectNumberRule(Calendar.HOUR, tokenLen); break; case 'X': // ISO 8601 rule = Iso8601_Rule.getRule(tokenLen); break; case 'z': // time zone (text) if (tokenLen >= 4) { rule = new TimeZoneNameRule(mTimeZone, mLocale, TimeZone.LONG); } else { rule = new TimeZoneNameRule(mTimeZone, mLocale, TimeZone.SHORT); } break; case 'Z': // time zone (value) if (tokenLen == 1) { rule = TimeZoneNumberRule.INSTANCE_NO_COLON; } else if (tokenLen == 2) { rule = Iso8601_Rule.ISO8601_HOURS_COLON_MINUTES; } else { rule = TimeZoneNumberRule.INSTANCE_COLON; } break; case '\'': // literal text final String sub = token.substring(1); if (sub.length() == 1) { rule = new CharacterLiteral(sub.charAt(0)); } else { rule = new StringLiteral(sub); } break; default: throw new IllegalArgumentException("Illegal pattern component: " + token); } rules.add(rule); } return rules; }
<p>Returns a list of Rules given a pattern.</p> @return a {@code List} of Rule objects @throws IllegalArgumentException if pattern is invalid
parsePattern
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
protected String parseToken(final String pattern, final int[] indexRef) { final StringBuilder buf = new StringBuilder(); int i = indexRef[0]; final int length = pattern.length(); char c = pattern.charAt(i); if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z') { // Scan a run of the same character, which indicates a time // pattern. buf.append(c); while (i + 1 < length) { final char peek = pattern.charAt(i + 1); if (peek == c) { buf.append(c); i++; } else { break; } } } else { // This will identify token as text. buf.append('\''); boolean inLiteral = false; for (; i < length; i++) { c = pattern.charAt(i); if (c == '\'') { if (i + 1 < length && pattern.charAt(i + 1) == '\'') { // '' is treated as escaped ' i++; buf.append(c); } else { inLiteral = !inLiteral; } } else if (!inLiteral && (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z')) { i--; break; } else { buf.append(c); } } } indexRef[0] = i; return buf.toString(); }
<p>Performs the parsing of tokens.</p> @param pattern the pattern @param indexRef index references @return parsed token
parseToken
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
protected NumberRule selectNumberRule(final int field, final int padding) { switch (padding) { case 1: return new UnpaddedNumberField(field); case 2: return new TwoDigitNumberField(field); default: return new PaddedNumberField(field, padding); } }
<p>Gets an appropriate rule for the padding required.</p> @param field the field to get a rule for @param padding the padding required @return a new rule with the correct padding
selectNumberRule
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Deprecated @Override public StringBuffer format(final Object obj, final StringBuffer toAppendTo, final FieldPosition pos) { if (obj instanceof Date) { return format((Date) obj, toAppendTo); } else if (obj instanceof Calendar) { return format((Calendar) obj, toAppendTo); } else if (obj instanceof Long) { return format(((Long) obj).longValue(), toAppendTo); } else { throw new IllegalArgumentException("Unknown class: " + (obj == null ? "<null>" : obj.getClass().getName())); } }
<p>Formats a {@code Date}, {@code Calendar} or {@code Long} (milliseconds) object.</p> @deprecated Use {{@link #format(Date)}, {{@link #format(Calendar)}, {{@link #format(long)}, or {{@link #format(Object)} @param obj the object to format @param toAppendTo the buffer to append to @param pos the position - ignored @return the buffer passed in
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
String format(final Object obj) { if (obj instanceof Date) { return format((Date) obj); } else if (obj instanceof Calendar) { return format((Calendar) obj); } else if (obj instanceof Long) { return format(((Long) obj).longValue()); } else { throw new IllegalArgumentException("Unknown class: " + (obj == null ? "<null>" : obj.getClass().getName())); } }
<p>Formats a {@code Date}, {@code Calendar} or {@code Long} (milliseconds) object.</p> @since 3.5 @param obj the object to format @return The formatted value.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public String format(final long millis) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return applyRulesToString(c); }
<p>Formats a {@code Date}, {@code Calendar} or {@code Long} (milliseconds) object.</p> @since 3.5 @param obj the object to format @return The formatted value.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
private String applyRulesToString(final Calendar c) { return applyRules(c, new StringBuilder(mMaxLengthEstimate)).toString(); }
Creates a String representation of the given Calendar by applying the rules of this printer to it. @param c the Calender to apply the rules to. @return a String representation of the given Calendar.
applyRulesToString
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
private Calendar newCalendar() { return Calendar.getInstance(mTimeZone, mLocale); }
Creation method for new calender instances. @return a new Calendar instance.
newCalendar
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public String format(final Date date) { final Calendar c = newCalendar(); c.setTime(date); return applyRulesToString(c); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public String format(final Calendar calendar) { return format(calendar, new StringBuilder(mMaxLengthEstimate)).toString(); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public StringBuffer format(final long millis, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return (StringBuffer) applyRules(c, (Appendable)buf); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public StringBuffer format(final Date date, final StringBuffer buf) { final Calendar c = newCalendar(); c.setTime(date); return (StringBuffer) applyRules(c, (Appendable)buf); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public StringBuffer format(final Calendar calendar, final StringBuffer buf) { // do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored return format(calendar.getTime(), buf); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public <B extends Appendable> B format(final long millis, final B buf) { final Calendar c = newCalendar(); c.setTimeInMillis(millis); return applyRules(c, buf); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public <B extends Appendable> B format(final Date date, final B buf) { final Calendar c = newCalendar(); c.setTime(date); return applyRules(c, buf); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public <B extends Appendable> B format(Calendar calendar, final B buf) { // do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored if(!calendar.getTimeZone().equals(mTimeZone)) { calendar = (Calendar)calendar.clone(); calendar.setTimeZone(mTimeZone); } return applyRules(calendar, buf); }
Creation method for new calender instances. @return a new Calendar instance.
format
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Deprecated protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) { return (StringBuffer) applyRules(calendar, (Appendable)buf); }
Performs the formatting by applying the rules to the specified calendar. @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @deprecated use {@link #format(Calendar)} or {@link #format(Calendar, Appendable)}
applyRules
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) { try { for (final Rule rule : mRules) { rule.appendTo(buf, calendar); } } catch (final IOException ioe) { throw new RuntimeException(ioe); } return buf; }
<p>Performs the formatting by applying the rules to the specified calendar.</p> @param calendar the calendar to format @param buf the buffer to format into @param <B> the Appendable class type, usually StringBuilder or StringBuffer. @return the specified string buffer
applyRules
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public String getPattern() { return mPattern; }
<p>Performs the formatting by applying the rules to the specified calendar.</p> @param calendar the calendar to format @param buf the buffer to format into @param <B> the Appendable class type, usually StringBuilder or StringBuffer. @return the specified string buffer
getPattern
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public TimeZone getTimeZone() { return mTimeZone; }
<p>Performs the formatting by applying the rules to the specified calendar.</p> @param calendar the calendar to format @param buf the buffer to format into @param <B> the Appendable class type, usually StringBuilder or StringBuffer. @return the specified string buffer
getTimeZone
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public Locale getLocale() { return mLocale; }
<p>Performs the formatting by applying the rules to the specified calendar.</p> @param calendar the calendar to format @param buf the buffer to format into @param <B> the Appendable class type, usually StringBuilder or StringBuffer. @return the specified string buffer
getLocale
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
public int getMaxLengthEstimate() { return mMaxLengthEstimate; }
<p>Gets an estimate for the maximum string length that the formatter will produce.</p> <p>The actual formatted length will almost always be less than or equal to this amount.</p> @return the maximum formatted length
getMaxLengthEstimate
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public boolean equals(final Object obj) { if (!(obj instanceof FastDatePrinter)) { return false; } final FastDatePrinter other = (FastDatePrinter) obj; return mPattern.equals(other.mPattern) && mTimeZone.equals(other.mTimeZone) && mLocale.equals(other.mLocale); }
<p>Compares two objects for equality.</p> @param obj the object to compare to @return {@code true} if equal
equals
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public int hashCode() { return mPattern.hashCode() + 13 * (mTimeZone.hashCode() + 13 * mLocale.hashCode()); }
<p>Returns a hash code compatible with equals.</p> @return a hash code compatible with equals
hashCode
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public String toString() { return "FastDatePrinter[" + mPattern + "," + mLocale + "," + mTimeZone.getID() + "]"; }
<p>Gets a debugging string version of this formatter.</p> @return a debugging string
toString
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); init(); }
Create the object after serialization. This implementation reinitializes the transient properties. @param in ObjectInputStream from which the object is being deserialized. @throws IOException if there is an IO issue. @throws ClassNotFoundException if a class cannot be found.
readObject
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
private static void appendDigits(final Appendable buffer, final int value) throws IOException { buffer.append((char)(value / 10 + '0')); buffer.append((char)(value % 10 + '0')); }
Appends two digits to the given buffer. @param buffer the buffer to append to. @param value the value to append digits from.
appendDigits
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
private static void appendFullDigits(final Appendable buffer, int value, int minFieldWidth) throws IOException { // specialized paths for 1 to 4 digits -> avoid the memory allocation from the temporary work array // see LANG-1248 if (value < 10000) { // less memory allocation path works for four digits or less int nDigits = 4; if (value < 1000) { --nDigits; if (value < 100) { --nDigits; if (value < 10) { --nDigits; } } } // left zero pad for (int i = minFieldWidth - nDigits; i > 0; --i) { buffer.append('0'); } switch (nDigits) { case 4: buffer.append((char) (value / 1000 + '0')); value %= 1000; case 3: if (value >= 100) { buffer.append((char) (value / 100 + '0')); value %= 100; } else { buffer.append('0'); } case 2: if (value >= 10) { buffer.append((char) (value / 10 + '0')); value %= 10; } else { buffer.append('0'); } case 1: buffer.append((char) (value + '0')); } } else { // more memory allocation path works for any digits // build up decimal representation in reverse final char[] work = new char[MAX_DIGITS]; int digit = 0; while (value != 0) { work[digit++] = (char) (value % 10 + '0'); value = value / 10; } // pad with zeros while (digit < minFieldWidth) { buffer.append('0'); --minFieldWidth; } // reverse while (--digit >= 0) { buffer.append(work[digit]); } } }
Appends all digits to the given buffer. @param buffer the buffer to append to. @param value the value to append digits from.
appendFullDigits
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public int estimateLength() { return mRule.estimateLength(); }
<p>Inner class to output the numeric day in week.</p>
estimateLength
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException { final int value = calendar.get(Calendar.DAY_OF_WEEK); mRule.appendTo(buffer, value != Calendar.SUNDAY ? value - 1 : 7); }
<p>Inner class to output the numeric day in week.</p>
appendTo
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public void appendTo(final Appendable buffer, final int value) throws IOException { mRule.appendTo(buffer, value); }
<p>Inner class to output the numeric day in week.</p>
appendTo
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public int estimateLength() { return mRule.estimateLength(); }
<p>Inner class to output the numeric day in week.</p>
estimateLength
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException { mRule.appendTo(buffer, calendar.getWeekYear()); }
<p>Inner class to output the numeric day in week.</p>
appendTo
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
@Override public void appendTo(final Appendable buffer, final int value) throws IOException { mRule.appendTo(buffer, value); }
<p>Inner class to output the numeric day in week.</p>
appendTo
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
static String getTimeZoneDisplay(final TimeZone tz, final boolean daylight, final int style, final Locale locale) { final TimeZoneDisplayKey key = new TimeZoneDisplayKey(tz, daylight, style, locale); String value = cTimeZoneDisplayCache.get(key); if (value == null) { // This is a very slow call, so cache the results. value = tz.getDisplayName(daylight, style, locale); final String prior = cTimeZoneDisplayCache.putIfAbsent(key, value); if (prior != null) { value= prior; } } return value; }
<p>Gets the time zone display name, using a cache for performance.</p> @param tz the zone to query @param daylight true if daylight savings @param style the style to use {@code TimeZone.LONG} or {@code TimeZone.SHORT} @param locale the locale to use @return the textual name of the time zone
getTimeZoneDisplay
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
static Iso8601_Rule getRule(final int tokenLen) { switch(tokenLen) { case 1: return Iso8601_Rule.ISO8601_HOURS; case 2: return Iso8601_Rule.ISO8601_HOURS_MINUTES; case 3: return Iso8601_Rule.ISO8601_HOURS_COLON_MINUTES; default: throw new IllegalArgumentException("invalid number of X"); } }
Factory method for Iso8601_Rules. @param tokenLen a token indicating the length of the TimeZone String to be formatted. @return a Iso8601_Rule that can format TimeZone String of length {@code tokenLen}. If no such rule exists, an IllegalArgumentException will be thrown.
getRule
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastDatePrinter.java
Apache-2.0
public static TimeZone getGmtTimeZone() { return GREENWICH; }
Gets the GMT TimeZone. @return A TimeZone with a raw offset of zero.
getGmtTimeZone
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
Apache-2.0
public static TimeZone getGmtTimeZone(final String pattern) { if ("Z".equals(pattern) || "UTC".equals(pattern)) { return GREENWICH; } final Matcher m = GMT_PATTERN.matcher(pattern); if (m.matches()) { final int hours = parseInt(m.group(2)); final int minutes = parseInt(m.group(4)); if (hours == 0 && minutes == 0) { return GREENWICH; } return new GmtTimeZone(parseSign(m.group(1)), hours, minutes); } return null; }
Gets a TimeZone with GMT offsets. A GMT offset must be either 'Z', or 'UTC', or match <em>(GMT)? hh?(:?mm?)?</em>, where h and m are digits representing hours and minutes. @param pattern The GMT offset @return A TimeZone with offset from GMT or null, if pattern does not match.
getGmtTimeZone
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
Apache-2.0
public static TimeZone getTimeZone(final String id) { final TimeZone tz = getGmtTimeZone(id); if (tz != null) { return tz; } return TimeZone.getTimeZone(id); }
Gets a TimeZone, looking first for GMT custom ids, then falling back to Olson ids. A GMT custom id can be 'Z', or 'UTC', or has an optional prefix of GMT, followed by sign, hours digit(s), optional colon(':'), and optional minutes digits. i.e. <em>[GMT] (+|-) Hours [[:] Minutes]</em> @param id A GMT custom id (or Olson id @return A timezone
getTimeZone
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
Apache-2.0
private static int parseInt(final String group) { return group != null ? Integer.parseInt(group) : 0; }
Gets a TimeZone, looking first for GMT custom ids, then falling back to Olson ids. A GMT custom id can be 'Z', or 'UTC', or has an optional prefix of GMT, followed by sign, hours digit(s), optional colon(':'), and optional minutes digits. i.e. <em>[GMT] (+|-) Hours [[:] Minutes]</em> @param id A GMT custom id (or Olson id @return A timezone
parseInt
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
Apache-2.0
private static boolean parseSign(final String group) { return group != null && group.charAt(0) == '-'; }
Gets a TimeZone, looking first for GMT custom ids, then falling back to Olson ids. A GMT custom id can be 'Z', or 'UTC', or has an optional prefix of GMT, followed by sign, hours digit(s), optional colon(':'), and optional minutes digits. i.e. <em>[GMT] (+|-) Hours [[:] Minutes]</em> @param id A GMT custom id (or Olson id @return A timezone
parseSign
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FastTimeZone.java
Apache-2.0
@Override public boolean equals(final Object obj) { // Eliminate the usual boilerplate because // this inner static class is only used in a generic ConcurrentHashMap // which will not compare against other Object types return Arrays.equals(keys, ((MultipartKey)obj).keys); }
Constructs an instance of <code>MultipartKey</code> to hold the specified objects. @param keys the set of objects that make up the key. Each key may be null.
equals
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FormatCache.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FormatCache.java
Apache-2.0
@Override public int hashCode() { if(hashCode==0) { int rc= 0; for(final Object key : keys) { if(key!=null) { rc= rc*7 + key.hashCode(); } } hashCode= rc; } return hashCode; }
Constructs an instance of <code>MultipartKey</code> to hold the specified objects. @param keys the set of objects that make up the key. Each key may be null.
hashCode
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FormatCache.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FormatCache.java
Apache-2.0
public static <T> T assertNotNull(final T object, final String message, final Object... values) { if (object == null) { throw new NullPointerException(String.format(message, values)); } return object; }
Constructs an instance of <code>MultipartKey</code> to hold the specified objects. @param keys the set of objects that make up the key. Each key may be null.
assertNotNull
java
arextest/arex-agent-java
arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FormatCache.java
https://github.com/arextest/arex-agent-java/blob/master/arex-third-party/src/main/java/io/arex/agent/thirdparty/util/time/FormatCache.java
Apache-2.0
public final void addOrReplace(String axisName, float value) { axis.put(axisName, value); onAxisChanged(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
addOrReplace
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void clearAxis() { axis.clear(); onAxisChanged(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
clearAxis
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final Map<String, Float> getAxis() { return Collections.unmodifiableMap(axis); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getAxis
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void setAxis(Map<String, Float> axis) { this.axis.clear(); this.axis.putAll(axis); onAxisChanged(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
setAxis
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final int getAxisColor() { return axisColor; }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getAxisColor
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void setAxisColor(int axisColor) { this.axisColor = axisColor; invalidate(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
setAxisColor
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final float getAxisMax() { return axisMax; }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getAxisMax
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void setAxisMax(float axisMax) { setAutoSize(false); setAxisMaxInternal(axisMax); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
setAxisMax
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final float getAxisTick() { return axisTick; }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getAxisTick
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void setAxisTick(float axisTick) { this.axisTick = axisTick; calcAxisTickInternal(); buildRings(); invalidate(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
setAxisTick
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final float getAxisWidth() { return axisWidth; }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getAxisWidth
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void setAxisWidth(int axisWidth) { this.axisWidth = axisWidth; invalidate(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
setAxisWidth
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final int getChartColor() { return chartColor; }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getChartColor
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final void setChartColor(int chartColor) { this.chartColor = chartColor; invalidate(); }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
setChartColor
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0
public final Paint.Style getChartStyle() { return chartStyle; }
~ ~ ~ ~ Description ~ ~ ~ ~ @author Dmytro Zaitsev @since 2016-Sep-28, 14:15
getChartStyle
java
DmitriyZaitsev/RadarChartView
radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
https://github.com/DmitriyZaitsev/RadarChartView/blob/master/radarchartview/src/main/java/com/dzaitsev/android/widget/RadarChartView.java
Apache-2.0