Add missing @Override.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1309977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8c29c67486
commit
b819343483
|
@ -257,6 +257,7 @@ final class CharRange implements Iterable<Character>, Serializable {
|
||||||
* @return an iterator to the chars represented by this range
|
* @return an iterator to the chars represented by this range
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Iterator<Character> iterator() {
|
public Iterator<Character> iterator() {
|
||||||
return new CharacterIterator(this);
|
return new CharacterIterator(this);
|
||||||
}
|
}
|
||||||
|
@ -325,6 +326,7 @@ final class CharRange implements Iterable<Character>, Serializable {
|
||||||
*
|
*
|
||||||
* @return {@code true} if the iterator has yet to reach the character date
|
* @return {@code true} if the iterator has yet to reach the character date
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return hasNext;
|
return hasNext;
|
||||||
}
|
}
|
||||||
|
@ -334,6 +336,7 @@ final class CharRange implements Iterable<Character>, Serializable {
|
||||||
*
|
*
|
||||||
* @return {@code Character} for the next character
|
* @return {@code Character} for the next character
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Character next() {
|
public Character next() {
|
||||||
if (hasNext == false) {
|
if (hasNext == false) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
|
@ -349,6 +352,7 @@ final class CharRange implements Iterable<Character>, Serializable {
|
||||||
* @throws UnsupportedOperationException
|
* @throws UnsupportedOperationException
|
||||||
* @see java.util.Iterator#remove()
|
* @see java.util.Iterator#remove()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,6 +485,7 @@ public final class Range<T> implements Serializable {
|
||||||
* @param obj2 right hand side of comparison
|
* @param obj2 right hand side of comparison
|
||||||
* @return negative, 0, positive comparison value
|
* @return negative, 0, positive comparison value
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compare(Object obj1, Object obj2) {
|
public int compare(Object obj1, Object obj2) {
|
||||||
return ((Comparable) obj1).compareTo(obj2);
|
return ((Comparable) obj1).compareTo(obj2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1013,6 +1013,7 @@ public class CompareToBuilder implements Builder<Integer> {
|
||||||
* @see #toComparison()
|
* @see #toComparison()
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Integer build() {
|
public Integer build() {
|
||||||
return Integer.valueOf(toComparison());
|
return Integer.valueOf(toComparison());
|
||||||
}
|
}
|
||||||
|
|
|
@ -920,6 +920,7 @@ public class EqualsBuilder implements Builder<Boolean> {
|
||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Boolean build() {
|
public Boolean build() {
|
||||||
return Boolean.valueOf(isEquals());
|
return Boolean.valueOf(isEquals());
|
||||||
}
|
}
|
||||||
|
|
|
@ -940,6 +940,7 @@ public class HashCodeBuilder implements Builder<Integer> {
|
||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Integer build() {
|
public Integer build() {
|
||||||
return Integer.valueOf(toHashCode());
|
return Integer.valueOf(toHashCode());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1073,6 +1073,7 @@ public class ToStringBuilder implements Builder<String> {
|
||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String build() {
|
public String build() {
|
||||||
return toString();
|
return toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,7 @@ public abstract class AtomicInitializer<T> implements ConcurrentInitializer<T> {
|
||||||
* @throws ConcurrentException if an error occurred during initialization of
|
* @throws ConcurrentException if an error occurred during initialization of
|
||||||
* the object
|
* the object
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T get() throws ConcurrentException {
|
public T get() throws ConcurrentException {
|
||||||
T result = reference.get();
|
T result = reference.get();
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ public abstract class AtomicSafeInitializer<T> implements
|
||||||
* @throws ConcurrentException if the initialization of the object causes an
|
* @throws ConcurrentException if the initialization of the object causes an
|
||||||
* exception
|
* exception
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final T get() throws ConcurrentException {
|
public final T get() throws ConcurrentException {
|
||||||
T result;
|
T result;
|
||||||
|
|
||||||
|
|
|
@ -206,6 +206,7 @@ public abstract class BackgroundInitializer<T> implements
|
||||||
* background processing
|
* background processing
|
||||||
* @throws IllegalStateException if {@link #start()} has not been called
|
* @throws IllegalStateException if {@link #start()} has not been called
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T get() throws ConcurrentException {
|
public T get() throws ConcurrentException {
|
||||||
try {
|
try {
|
||||||
return getFuture().get();
|
return getFuture().get();
|
||||||
|
@ -320,6 +321,7 @@ public abstract class BackgroundInitializer<T> implements
|
||||||
* @return the result object
|
* @return the result object
|
||||||
* @throws Exception if an error occurs
|
* @throws Exception if an error occurs
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T call() throws Exception {
|
public T call() throws Exception {
|
||||||
try {
|
try {
|
||||||
return initialize();
|
return initialize();
|
||||||
|
|
|
@ -200,6 +200,7 @@ public class BasicThreadFactory implements ThreadFactory {
|
||||||
* @param r the {@code Runnable} to be executed by the new thread
|
* @param r the {@code Runnable} to be executed by the new thread
|
||||||
* @return the newly created thread
|
* @return the newly created thread
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Thread newThread(Runnable r) {
|
public Thread newThread(Runnable r) {
|
||||||
Thread t = getWrappedFactory().newThread(r);
|
Thread t = getWrappedFactory().newThread(r);
|
||||||
initializeThread(t);
|
initializeThread(t);
|
||||||
|
@ -372,6 +373,7 @@ public class BasicThreadFactory implements ThreadFactory {
|
||||||
*
|
*
|
||||||
* @return the new {@code BasicThreadFactory}
|
* @return the new {@code BasicThreadFactory}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BasicThreadFactory build() {
|
public BasicThreadFactory build() {
|
||||||
BasicThreadFactory factory = new BasicThreadFactory(this);
|
BasicThreadFactory factory = new BasicThreadFactory(this);
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -347,6 +347,7 @@ public class ConcurrentUtils {
|
||||||
* the constant object managed by this {@code Future} implementation is
|
* the constant object managed by this {@code Future} implementation is
|
||||||
* always available.
|
* always available.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDone() {
|
public boolean isDone() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -354,6 +355,7 @@ public class ConcurrentUtils {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc} This implementation just returns the constant value.
|
* {@inheritDoc} This implementation just returns the constant value.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T get() {
|
public T get() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -362,6 +364,7 @@ public class ConcurrentUtils {
|
||||||
* {@inheritDoc} This implementation just returns the constant value; it
|
* {@inheritDoc} This implementation just returns the constant value; it
|
||||||
* does not block, therefore the timeout has no meaning.
|
* does not block, therefore the timeout has no meaning.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T get(long timeout, TimeUnit unit) {
|
public T get(long timeout, TimeUnit unit) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -370,6 +373,7 @@ public class ConcurrentUtils {
|
||||||
* {@inheritDoc} This implementation always returns <b>false</b>; there
|
* {@inheritDoc} This implementation always returns <b>false</b>; there
|
||||||
* is no background process which could be cancelled.
|
* is no background process which could be cancelled.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -378,6 +382,7 @@ public class ConcurrentUtils {
|
||||||
* {@inheritDoc} The cancel operation is not supported. This
|
* {@inheritDoc} The cancel operation is not supported. This
|
||||||
* implementation always returns <b>false</b>.
|
* implementation always returns <b>false</b>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean cancel(boolean mayInterruptIfRunning) {
|
public boolean cancel(boolean mayInterruptIfRunning) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ public class ConstantInitializer<T> implements ConcurrentInitializer<T> {
|
||||||
* @return the object managed by this initializer
|
* @return the object managed by this initializer
|
||||||
* @throws ConcurrentException if an error occurs
|
* @throws ConcurrentException if an error occurs
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T get() throws ConcurrentException {
|
public T get() throws ConcurrentException {
|
||||||
return getObject();
|
return getObject();
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ public abstract class LazyInitializer<T> implements ConcurrentInitializer<T> {
|
||||||
* @throws ConcurrentException if an error occurred during initialization of
|
* @throws ConcurrentException if an error occurred during initialization of
|
||||||
* the object
|
* the object
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T get() throws ConcurrentException {
|
public T get() throws ConcurrentException {
|
||||||
// use a temporary variable to reduce the number of reads of the
|
// use a temporary variable to reduce the number of reads of the
|
||||||
// volatile field
|
// volatile field
|
||||||
|
|
|
@ -400,6 +400,7 @@ public class TimedSemaphore {
|
||||||
*/
|
*/
|
||||||
protected ScheduledFuture<?> startTimer() {
|
protected ScheduledFuture<?> startTimer() {
|
||||||
return getExecutorService().scheduleAtFixedRate(new Runnable() {
|
return getExecutorService().scheduleAtFixedRate(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
endOfPeriod();
|
endOfPeriod();
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,6 +304,7 @@ public class EventListenerSupport<L> implements Serializable {
|
||||||
* @return the result of the method call
|
* @return the result of the method call
|
||||||
* @throws Throwable if an error occurs
|
* @throws Throwable if an error occurs
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||||
for (L listener : listeners) {
|
for (L listener : listeners) {
|
||||||
method.invoke(listener, args);
|
method.invoke(listener, args);
|
||||||
|
|
|
@ -106,6 +106,7 @@ public class EventUtils {
|
||||||
* @return the result of the method call
|
* @return the result of the method call
|
||||||
* @throws Throwable if an error occurs
|
* @throws Throwable if an error occurs
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object invoke(final Object proxy, final Method method, final Object[] parameters) throws Throwable {
|
public Object invoke(final Object proxy, final Method method, final Object[] parameters) throws Throwable {
|
||||||
if (eventTypes.isEmpty() || eventTypes.contains(method.getName())) {
|
if (eventTypes.isEmpty() || eventTypes.contains(method.getName())) {
|
||||||
if (hasMatchingParametersMethod(method)) {
|
if (hasMatchingParametersMethod(method)) {
|
||||||
|
|
|
@ -164,6 +164,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
* @param value information needed to understand exception, may be {@code null}
|
* @param value information needed to understand exception, may be {@code null}
|
||||||
* @return {@code this}, for method chaining, not {@code null}
|
* @return {@code this}, for method chaining, not {@code null}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ContextedException addContextValue(String label, Object value) {
|
public ContextedException addContextValue(String label, Object value) {
|
||||||
exceptionContext.addContextValue(label, value);
|
exceptionContext.addContextValue(label, value);
|
||||||
return this;
|
return this;
|
||||||
|
@ -182,6 +183,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
* @param value information needed to understand exception, may be {@code null}
|
* @param value information needed to understand exception, may be {@code null}
|
||||||
* @return {@code this}, for method chaining, not {@code null}
|
* @return {@code this}, for method chaining, not {@code null}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ContextedException setContextValue(String label, Object value) {
|
public ContextedException setContextValue(String label, Object value) {
|
||||||
exceptionContext.setContextValue(label, value);
|
exceptionContext.setContextValue(label, value);
|
||||||
return this;
|
return this;
|
||||||
|
@ -190,6 +192,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public List<Object> getContextValues(String label) {
|
public List<Object> getContextValues(String label) {
|
||||||
return this.exceptionContext.getContextValues(label);
|
return this.exceptionContext.getContextValues(label);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +200,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getFirstContextValue(String label) {
|
public Object getFirstContextValue(String label) {
|
||||||
return this.exceptionContext.getFirstContextValue(label);
|
return this.exceptionContext.getFirstContextValue(label);
|
||||||
}
|
}
|
||||||
|
@ -204,6 +208,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public List<Pair<String, Object>> getContextEntries() {
|
public List<Pair<String, Object>> getContextEntries() {
|
||||||
return this.exceptionContext.getContextEntries();
|
return this.exceptionContext.getContextEntries();
|
||||||
}
|
}
|
||||||
|
@ -211,6 +216,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Set<String> getContextLabels() {
|
public Set<String> getContextLabels() {
|
||||||
return exceptionContext.getContextLabels();
|
return exceptionContext.getContextLabels();
|
||||||
}
|
}
|
||||||
|
@ -240,6 +246,7 @@ public class ContextedException extends Exception implements ExceptionContext {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getFormattedExceptionMessage(String baseMessage) {
|
public String getFormattedExceptionMessage(String baseMessage) {
|
||||||
return exceptionContext.getFormattedExceptionMessage(baseMessage);
|
return exceptionContext.getFormattedExceptionMessage(baseMessage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,6 +164,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
* @param value information needed to understand exception, may be {@code null}
|
* @param value information needed to understand exception, may be {@code null}
|
||||||
* @return {@code this}, for method chaining, not {@code null}
|
* @return {@code this}, for method chaining, not {@code null}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ContextedRuntimeException addContextValue(String label, Object value) {
|
public ContextedRuntimeException addContextValue(String label, Object value) {
|
||||||
exceptionContext.addContextValue(label, value);
|
exceptionContext.addContextValue(label, value);
|
||||||
return this;
|
return this;
|
||||||
|
@ -182,6 +183,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
* @param value information needed to understand exception, may be {@code null}
|
* @param value information needed to understand exception, may be {@code null}
|
||||||
* @return {@code this}, for method chaining, not {@code null}
|
* @return {@code this}, for method chaining, not {@code null}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ContextedRuntimeException setContextValue(String label, Object value) {
|
public ContextedRuntimeException setContextValue(String label, Object value) {
|
||||||
exceptionContext.setContextValue(label, value);
|
exceptionContext.setContextValue(label, value);
|
||||||
return this;
|
return this;
|
||||||
|
@ -190,6 +192,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public List<Object> getContextValues(String label) {
|
public List<Object> getContextValues(String label) {
|
||||||
return this.exceptionContext.getContextValues(label);
|
return this.exceptionContext.getContextValues(label);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +200,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getFirstContextValue(String label) {
|
public Object getFirstContextValue(String label) {
|
||||||
return this.exceptionContext.getFirstContextValue(label);
|
return this.exceptionContext.getFirstContextValue(label);
|
||||||
}
|
}
|
||||||
|
@ -204,6 +208,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public List<Pair<String, Object>> getContextEntries() {
|
public List<Pair<String, Object>> getContextEntries() {
|
||||||
return this.exceptionContext.getContextEntries();
|
return this.exceptionContext.getContextEntries();
|
||||||
}
|
}
|
||||||
|
@ -211,6 +216,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Set<String> getContextLabels() {
|
public Set<String> getContextLabels() {
|
||||||
return exceptionContext.getContextLabels();
|
return exceptionContext.getContextLabels();
|
||||||
}
|
}
|
||||||
|
@ -240,6 +246,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getFormattedExceptionMessage(String baseMessage) {
|
public String getFormattedExceptionMessage(String baseMessage) {
|
||||||
return exceptionContext.getFormattedExceptionMessage(baseMessage);
|
return exceptionContext.getFormattedExceptionMessage(baseMessage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public DefaultExceptionContext addContextValue(String label, Object value) {
|
public DefaultExceptionContext addContextValue(String label, Object value) {
|
||||||
contextValues.add(new ImmutablePair<String, Object>(label, value));
|
contextValues.add(new ImmutablePair<String, Object>(label, value));
|
||||||
return this;
|
return this;
|
||||||
|
@ -57,6 +58,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public DefaultExceptionContext setContextValue(String label, Object value) {
|
public DefaultExceptionContext setContextValue(String label, Object value) {
|
||||||
for (final Iterator<Pair<String, Object>> iter = contextValues.iterator(); iter.hasNext();) {
|
for (final Iterator<Pair<String, Object>> iter = contextValues.iterator(); iter.hasNext();) {
|
||||||
final Pair<String, Object> p = iter.next();
|
final Pair<String, Object> p = iter.next();
|
||||||
|
@ -71,6 +73,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public List<Object> getContextValues(String label) {
|
public List<Object> getContextValues(String label) {
|
||||||
final List<Object> values = new ArrayList<Object>();
|
final List<Object> values = new ArrayList<Object>();
|
||||||
for (final Pair<String, Object> pair : contextValues) {
|
for (final Pair<String, Object> pair : contextValues) {
|
||||||
|
@ -84,6 +87,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getFirstContextValue(String label) {
|
public Object getFirstContextValue(String label) {
|
||||||
for (final Pair<String, Object> pair : contextValues) {
|
for (final Pair<String, Object> pair : contextValues) {
|
||||||
if (StringUtils.equals(label, pair.getKey())) {
|
if (StringUtils.equals(label, pair.getKey())) {
|
||||||
|
@ -96,6 +100,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Set<String> getContextLabels() {
|
public Set<String> getContextLabels() {
|
||||||
final Set<String> labels = new HashSet<String>();
|
final Set<String> labels = new HashSet<String>();
|
||||||
for (final Pair<String, Object> pair : contextValues) {
|
for (final Pair<String, Object> pair : contextValues) {
|
||||||
|
@ -107,6 +112,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public List<Pair<String, Object>> getContextEntries() {
|
public List<Pair<String, Object>> getContextEntries() {
|
||||||
return contextValues;
|
return contextValues;
|
||||||
}
|
}
|
||||||
|
@ -117,6 +123,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
|
||||||
* @param baseMessage the base exception message <b>without</b> context information appended
|
* @param baseMessage the base exception message <b>without</b> context information appended
|
||||||
* @return the exception message <b>with</b> context information appended, never null
|
* @return the exception message <b>with</b> context information appended, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getFormattedExceptionMessage(String baseMessage){
|
public String getFormattedExceptionMessage(String baseMessage){
|
||||||
StringBuilder buffer = new StringBuilder(256);
|
StringBuilder buffer = new StringBuilder(256);
|
||||||
if (baseMessage != null) {
|
if (baseMessage != null) {
|
||||||
|
|
|
@ -879,6 +879,7 @@ public final class Fraction extends Number implements Comparable<Fraction> {
|
||||||
* @throws ClassCastException if the object is not a <code>Fraction</code>
|
* @throws ClassCastException if the object is not a <code>Fraction</code>
|
||||||
* @throws NullPointerException if the object is <code>null</code>
|
* @throws NullPointerException if the object is <code>null</code>
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(Fraction other) {
|
public int compareTo(Fraction other) {
|
||||||
if (this==other) {
|
if (this==other) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -74,6 +74,7 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
|
||||||
*
|
*
|
||||||
* @return the value as a Boolean, never null
|
* @return the value as a Boolean, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Boolean getValue() {
|
public Boolean getValue() {
|
||||||
return Boolean.valueOf(this.value);
|
return Boolean.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -93,6 +94,7 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Boolean value) {
|
public void setValue(Boolean value) {
|
||||||
this.value = value.booleanValue();
|
this.value = value.booleanValue();
|
||||||
}
|
}
|
||||||
|
@ -174,6 +176,7 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
* where false is less than true
|
* where false is less than true
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableBoolean other) {
|
public int compareTo(MutableBoolean other) {
|
||||||
boolean anotherVal = other.value;
|
boolean anotherVal = other.value;
|
||||||
return value == anotherVal ? 0 : (value ? 1 : -1);
|
return value == anotherVal ? 0 : (value ? 1 : -1);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
|
||||||
*
|
*
|
||||||
* @return the value as a Byte, never null
|
* @return the value as a Byte, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Byte getValue() {
|
public Byte getValue() {
|
||||||
return Byte.valueOf(this.value);
|
return Byte.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Number value) {
|
public void setValue(Number value) {
|
||||||
this.value = value.byteValue();
|
this.value = value.byteValue();
|
||||||
}
|
}
|
||||||
|
@ -264,6 +266,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
|
||||||
* @param other the other mutable to compare to, not null
|
* @param other the other mutable to compare to, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableByte other) {
|
public int compareTo(MutableByte other) {
|
||||||
byte anotherVal = other.value;
|
byte anotherVal = other.value;
|
||||||
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
|
||||||
*
|
*
|
||||||
* @return the value as a Double, never null
|
* @return the value as a Double, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Double getValue() {
|
public Double getValue() {
|
||||||
return Double.valueOf(this.value);
|
return Double.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Number value) {
|
public void setValue(Number value) {
|
||||||
this.value = value.doubleValue();
|
this.value = value.doubleValue();
|
||||||
}
|
}
|
||||||
|
@ -293,6 +295,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
|
||||||
* @param other the other mutable to compare to, not null
|
* @param other the other mutable to compare to, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableDouble other) {
|
public int compareTo(MutableDouble other) {
|
||||||
double anotherVal = other.value;
|
double anotherVal = other.value;
|
||||||
return Double.compare(value, anotherVal);
|
return Double.compare(value, anotherVal);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
|
||||||
*
|
*
|
||||||
* @return the value as a Float, never null
|
* @return the value as a Float, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Float getValue() {
|
public Float getValue() {
|
||||||
return Float.valueOf(this.value);
|
return Float.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Number value) {
|
public void setValue(Number value) {
|
||||||
this.value = value.floatValue();
|
this.value = value.floatValue();
|
||||||
}
|
}
|
||||||
|
@ -294,6 +296,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
|
||||||
* @param other the other mutable to compare to, not null
|
* @param other the other mutable to compare to, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableFloat other) {
|
public int compareTo(MutableFloat other) {
|
||||||
float anotherVal = other.value;
|
float anotherVal = other.value;
|
||||||
return Float.compare(value, anotherVal);
|
return Float.compare(value, anotherVal);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
|
||||||
*
|
*
|
||||||
* @return the value as a Integer, never null
|
* @return the value as a Integer, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return Integer.valueOf(this.value);
|
return Integer.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Number value) {
|
public void setValue(Number value) {
|
||||||
this.value = value.intValue();
|
this.value = value.intValue();
|
||||||
}
|
}
|
||||||
|
@ -254,6 +256,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
|
||||||
* @param other the other mutable to compare to, not null
|
* @param other the other mutable to compare to, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableInt other) {
|
public int compareTo(MutableInt other) {
|
||||||
int anotherVal = other.value;
|
int anotherVal = other.value;
|
||||||
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
|
||||||
*
|
*
|
||||||
* @return the value as a Long, never null
|
* @return the value as a Long, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Long getValue() {
|
public Long getValue() {
|
||||||
return Long.valueOf(this.value);
|
return Long.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Number value) {
|
public void setValue(Number value) {
|
||||||
this.value = value.longValue();
|
this.value = value.longValue();
|
||||||
}
|
}
|
||||||
|
@ -254,6 +256,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
|
||||||
* @param other the other mutable to compare to, not null
|
* @param other the other mutable to compare to, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableLong other) {
|
public int compareTo(MutableLong other) {
|
||||||
long anotherVal = other.value;
|
long anotherVal = other.value;
|
||||||
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
||||||
|
|
|
@ -60,6 +60,7 @@ public class MutableObject<T> implements Mutable<T>, Serializable {
|
||||||
*
|
*
|
||||||
* @return the value, may be null
|
* @return the value, may be null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public T getValue() {
|
public T getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
@ -69,6 +70,7 @@ public class MutableObject<T> implements Mutable<T>, Serializable {
|
||||||
*
|
*
|
||||||
* @param value the value to set
|
* @param value the value to set
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(T value) {
|
public void setValue(T value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
|
||||||
*
|
*
|
||||||
* @return the value as a Short, never null
|
* @return the value as a Short, never null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Short getValue() {
|
public Short getValue() {
|
||||||
return Short.valueOf(this.value);
|
return Short.valueOf(this.value);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
|
||||||
* @param value the value to set, not null
|
* @param value the value to set, not null
|
||||||
* @throws NullPointerException if the object is null
|
* @throws NullPointerException if the object is null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setValue(Number value) {
|
public void setValue(Number value) {
|
||||||
this.value = value.shortValue();
|
this.value = value.shortValue();
|
||||||
}
|
}
|
||||||
|
@ -264,6 +266,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
|
||||||
* @param other the other mutable to compare to, not null
|
* @param other the other mutable to compare to, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(MutableShort other) {
|
public int compareTo(MutableShort other) {
|
||||||
short anotherVal = other.value;
|
short anotherVal = other.value;
|
||||||
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);
|
||||||
|
|
|
@ -182,6 +182,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
|
||||||
*
|
*
|
||||||
* @return the length
|
* @return the length
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int length() {
|
public int length() {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
@ -302,6 +303,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
|
||||||
* @return the character at the index
|
* @return the character at the index
|
||||||
* @throws IndexOutOfBoundsException if the index is invalid
|
* @throws IndexOutOfBoundsException if the index is invalid
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public char charAt(int index) {
|
public char charAt(int index) {
|
||||||
if (index < 0 || index >= length()) {
|
if (index < 0 || index >= length()) {
|
||||||
throw new StringIndexOutOfBoundsException(index);
|
throw new StringIndexOutOfBoundsException(index);
|
||||||
|
@ -470,6 +472,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
|
||||||
* @return this, to enable chaining
|
* @return this, to enable chaining
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StrBuilder append(CharSequence seq) {
|
public StrBuilder append(CharSequence seq) {
|
||||||
if (seq == null) {
|
if (seq == null) {
|
||||||
return appendNull();
|
return appendNull();
|
||||||
|
@ -487,6 +490,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
|
||||||
* @return this, to enable chaining
|
* @return this, to enable chaining
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StrBuilder append(CharSequence seq, int startIndex, int length) {
|
public StrBuilder append(CharSequence seq, int startIndex, int length) {
|
||||||
if (seq == null) {
|
if (seq == null) {
|
||||||
return appendNull();
|
return appendNull();
|
||||||
|
@ -721,6 +725,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
|
||||||
* @return this, to enable chaining
|
* @return this, to enable chaining
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StrBuilder append(char ch) {
|
public StrBuilder append(char ch) {
|
||||||
int len = length();
|
int len = length();
|
||||||
ensureCapacity(len + 1);
|
ensureCapacity(len + 1);
|
||||||
|
@ -2005,6 +2010,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public CharSequence subSequence(int startIndex, int endIndex) {
|
public CharSequence subSequence(int startIndex, int endIndex) {
|
||||||
if (startIndex < 0) {
|
if (startIndex < 0) {
|
||||||
throw new StringIndexOutOfBoundsException(startIndex);
|
throw new StringIndexOutOfBoundsException(startIndex);
|
||||||
|
|
|
@ -500,6 +500,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
*
|
*
|
||||||
* @return true if there are more tokens
|
* @return true if there are more tokens
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
checkTokenized();
|
checkTokenized();
|
||||||
return tokenPos < tokens.length;
|
return tokenPos < tokens.length;
|
||||||
|
@ -511,6 +512,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
* @return the next String token
|
* @return the next String token
|
||||||
* @throws NoSuchElementException if there are no more elements
|
* @throws NoSuchElementException if there are no more elements
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String next() {
|
public String next() {
|
||||||
if (hasNext()) {
|
if (hasNext()) {
|
||||||
return tokens[tokenPos++];
|
return tokens[tokenPos++];
|
||||||
|
@ -523,6 +525,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
*
|
*
|
||||||
* @return the next token index
|
* @return the next token index
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int nextIndex() {
|
public int nextIndex() {
|
||||||
return tokenPos;
|
return tokenPos;
|
||||||
}
|
}
|
||||||
|
@ -532,6 +535,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
*
|
*
|
||||||
* @return true if there are previous tokens
|
* @return true if there are previous tokens
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasPrevious() {
|
public boolean hasPrevious() {
|
||||||
checkTokenized();
|
checkTokenized();
|
||||||
return tokenPos > 0;
|
return tokenPos > 0;
|
||||||
|
@ -542,6 +546,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
*
|
*
|
||||||
* @return the previous token
|
* @return the previous token
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String previous() {
|
public String previous() {
|
||||||
if (hasPrevious()) {
|
if (hasPrevious()) {
|
||||||
return tokens[--tokenPos];
|
return tokens[--tokenPos];
|
||||||
|
@ -554,6 +559,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
*
|
*
|
||||||
* @return the previous token index
|
* @return the previous token index
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int previousIndex() {
|
public int previousIndex() {
|
||||||
return tokenPos - 1;
|
return tokenPos - 1;
|
||||||
}
|
}
|
||||||
|
@ -563,6 +569,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
*
|
*
|
||||||
* @throws UnsupportedOperationException always
|
* @throws UnsupportedOperationException always
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
throw new UnsupportedOperationException("remove() is unsupported");
|
throw new UnsupportedOperationException("remove() is unsupported");
|
||||||
}
|
}
|
||||||
|
@ -572,6 +579,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
* @param obj this parameter ignored.
|
* @param obj this parameter ignored.
|
||||||
* @throws UnsupportedOperationException always
|
* @throws UnsupportedOperationException always
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void set(String obj) {
|
public void set(String obj) {
|
||||||
throw new UnsupportedOperationException("set() is unsupported");
|
throw new UnsupportedOperationException("set() is unsupported");
|
||||||
}
|
}
|
||||||
|
@ -581,6 +589,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
|
||||||
* @param obj this parameter ignored.
|
* @param obj this parameter ignored.
|
||||||
* @throws UnsupportedOperationException always
|
* @throws UnsupportedOperationException always
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void add(String obj) {
|
public void add(String obj) {
|
||||||
throw new UnsupportedOperationException("add() is unsupported");
|
throw new UnsupportedOperationException("add() is unsupported");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1800,6 +1800,7 @@ public class DateUtils {
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if the iterator has yet to reach the end date
|
* @return <code>true</code> if the iterator has yet to reach the end date
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return spot.before(endFinal);
|
return spot.before(endFinal);
|
||||||
}
|
}
|
||||||
|
@ -1809,6 +1810,7 @@ public class DateUtils {
|
||||||
*
|
*
|
||||||
* @return Object calendar for the next date
|
* @return Object calendar for the next date
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Calendar next() {
|
public Calendar next() {
|
||||||
if (spot.equals(endFinal)) {
|
if (spot.equals(endFinal)) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
|
@ -1823,6 +1825,7 @@ public class DateUtils {
|
||||||
* @throws UnsupportedOperationException
|
* @throws UnsupportedOperationException
|
||||||
* @see java.util.Iterator#remove()
|
* @see java.util.Iterator#remove()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -393,6 +393,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
* @return the formatted string
|
* @return the formatted string
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String format(long millis) {
|
public String format(long millis) {
|
||||||
return format(new Date(millis));
|
return format(new Date(millis));
|
||||||
}
|
}
|
||||||
|
@ -403,6 +404,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
* @param date the date to format
|
* @param date the date to format
|
||||||
* @return the formatted string
|
* @return the formatted string
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String format(Date date) {
|
public String format(Date date) {
|
||||||
return printer.format(date);
|
return printer.format(date);
|
||||||
}
|
}
|
||||||
|
@ -413,6 +415,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
* @param calendar the calendar to format
|
* @param calendar the calendar to format
|
||||||
* @return the formatted string
|
* @return the formatted string
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String format(Calendar calendar) {
|
public String format(Calendar calendar) {
|
||||||
return printer.format(calendar);
|
return printer.format(calendar);
|
||||||
}
|
}
|
||||||
|
@ -426,6 +429,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
* @return the specified string buffer
|
* @return the specified string buffer
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(long millis, StringBuffer buf) {
|
public StringBuffer format(long millis, StringBuffer buf) {
|
||||||
return printer.format(millis, buf);
|
return printer.format(millis, buf);
|
||||||
}
|
}
|
||||||
|
@ -438,6 +442,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
* @param buf the buffer to format into
|
* @param buf the buffer to format into
|
||||||
* @return the specified string buffer
|
* @return the specified string buffer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(Date date, StringBuffer buf) {
|
public StringBuffer format(Date date, StringBuffer buf) {
|
||||||
return printer.format(date, buf);
|
return printer.format(date, buf);
|
||||||
}
|
}
|
||||||
|
@ -450,6 +455,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
* @param buf the buffer to format into
|
* @param buf the buffer to format into
|
||||||
* @return the specified string buffer
|
* @return the specified string buffer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(Calendar calendar, StringBuffer buf) {
|
public StringBuffer format(Calendar calendar, StringBuffer buf) {
|
||||||
return printer.format(calendar, buf);
|
return printer.format(calendar, buf);
|
||||||
}
|
}
|
||||||
|
@ -461,6 +467,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see DateParser#parse(java.lang.String)
|
* @see DateParser#parse(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Date parse(String source) throws ParseException {
|
public Date parse(String source) throws ParseException {
|
||||||
return parser.parse(source);
|
return parser.parse(source);
|
||||||
}
|
}
|
||||||
|
@ -468,6 +475,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see DateParser#parse(java.lang.String, java.text.ParsePosition)
|
* @see DateParser#parse(java.lang.String, java.text.ParsePosition)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Date parse(String source, ParsePosition pos) {
|
public Date parse(String source, ParsePosition pos) {
|
||||||
return parser.parse(source, pos);
|
return parser.parse(source, pos);
|
||||||
}
|
}
|
||||||
|
@ -487,6 +495,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
*
|
*
|
||||||
* @return the pattern, {@link java.text.SimpleDateFormat} compatible
|
* @return the pattern, {@link java.text.SimpleDateFormat} compatible
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPattern() {
|
public String getPattern() {
|
||||||
return printer.getPattern();
|
return printer.getPattern();
|
||||||
}
|
}
|
||||||
|
@ -498,6 +507,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
*
|
*
|
||||||
* @return the time zone
|
* @return the time zone
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public TimeZone getTimeZone() {
|
public TimeZone getTimeZone() {
|
||||||
return printer.getTimeZone();
|
return printer.getTimeZone();
|
||||||
}
|
}
|
||||||
|
@ -507,6 +517,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
*
|
*
|
||||||
* @return the locale
|
* @return the locale
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
return printer.getLocale();
|
return printer.getLocale();
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#getPattern()
|
* @see org.apache.commons.lang3.time.DateParser#getPattern()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPattern() {
|
public String getPattern() {
|
||||||
return pattern;
|
return pattern;
|
||||||
}
|
}
|
||||||
|
@ -151,6 +152,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#getTimeZone()
|
* @see org.apache.commons.lang3.time.DateParser#getTimeZone()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public TimeZone getTimeZone() {
|
public TimeZone getTimeZone() {
|
||||||
return timeZone;
|
return timeZone;
|
||||||
}
|
}
|
||||||
|
@ -158,6 +160,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#getLocale()
|
* @see org.apache.commons.lang3.time.DateParser#getLocale()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
return locale;
|
return locale;
|
||||||
}
|
}
|
||||||
|
@ -219,6 +222,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String)
|
* @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object parseObject(String source) throws ParseException {
|
public Object parseObject(String source) throws ParseException {
|
||||||
return parse(source);
|
return parse(source);
|
||||||
}
|
}
|
||||||
|
@ -226,6 +230,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String)
|
* @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Date parse(String source) throws ParseException {
|
public Date parse(String source) throws ParseException {
|
||||||
Date date= parse(source, new ParsePosition(0));
|
Date date= parse(source, new ParsePosition(0));
|
||||||
if(date==null) {
|
if(date==null) {
|
||||||
|
@ -237,6 +242,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String, java.text.ParsePosition)
|
* @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String, java.text.ParsePosition)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object parseObject(String source, ParsePosition pos) {
|
public Object parseObject(String source, ParsePosition pos) {
|
||||||
return parse(source, pos);
|
return parse(source, pos);
|
||||||
}
|
}
|
||||||
|
@ -244,6 +250,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String, java.text.ParsePosition)
|
* @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String, java.text.ParsePosition)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Date parse(String source, ParsePosition pos) {
|
public Date parse(String source, ParsePosition pos) {
|
||||||
int offset= pos.getIndex();
|
int offset= pos.getIndex();
|
||||||
Matcher matcher= parsePattern.matcher(source.substring(offset));
|
Matcher matcher= parsePattern.matcher(source.substring(offset));
|
||||||
|
@ -336,6 +343,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
* ignore case comparison of keys
|
* ignore case comparison of keys
|
||||||
*/
|
*/
|
||||||
private static final Comparator<KeyValue> IGNORE_CASE_COMPARATOR = new Comparator<KeyValue> () {
|
private static final Comparator<KeyValue> IGNORE_CASE_COMPARATOR = new Comparator<KeyValue> () {
|
||||||
|
@Override
|
||||||
public int compare(KeyValue left, KeyValue right) {
|
public int compare(KeyValue left, KeyValue right) {
|
||||||
return left.key.compareToIgnoreCase(right.key);
|
return left.key.compareToIgnoreCase(right.key);
|
||||||
}
|
}
|
||||||
|
@ -565,6 +573,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isNumber() {
|
public boolean isNumber() {
|
||||||
char c= formatField.charAt(0);
|
char c= formatField.charAt(0);
|
||||||
if(c=='\'') {
|
if(c=='\'') {
|
||||||
|
@ -576,6 +585,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
||||||
escapeRegex(regex, formatField, true);
|
escapeRegex(regex, formatField, true);
|
||||||
return false;
|
return false;
|
||||||
|
@ -584,6 +594,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -605,6 +616,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isNumber() {
|
public boolean isNumber() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -612,6 +624,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
||||||
regex.append('(');
|
regex.append('(');
|
||||||
for(KeyValue textKeyValue : parser.getDisplayNames(field)) {
|
for(KeyValue textKeyValue : parser.getDisplayNames(field)) {
|
||||||
|
@ -624,6 +637,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
||||||
KeyValue[] textKeyValues= parser.getDisplayNames(field);
|
KeyValue[] textKeyValues= parser.getDisplayNames(field);
|
||||||
int idx= Arrays.binarySearch(textKeyValues, new KeyValue(value, -1), IGNORE_CASE_COMPARATOR);
|
int idx= Arrays.binarySearch(textKeyValues, new KeyValue(value, -1), IGNORE_CASE_COMPARATOR);
|
||||||
|
@ -657,6 +671,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isNumber() {
|
public boolean isNumber() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -664,6 +679,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
||||||
if(parser.isNextNumber()) {
|
if(parser.isNextNumber()) {
|
||||||
regex.append("(\\d{").append(parser.getFieldWidth()).append("}+)");
|
regex.append("(\\d{").append(parser.getFieldWidth()).append("}+)");
|
||||||
|
@ -677,6 +693,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
||||||
cal.set(field, modify(Integer.parseInt(value)));
|
cal.set(field, modify(Integer.parseInt(value)));
|
||||||
}
|
}
|
||||||
|
@ -742,6 +759,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isNumber() {
|
public boolean isNumber() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -749,6 +767,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
|
||||||
regex.append(validTimeZoneChars);
|
regex.append(validTimeZoneChars);
|
||||||
return true;
|
return true;
|
||||||
|
@ -757,6 +776,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
|
||||||
TimeZone tz;
|
TimeZone tz;
|
||||||
if(value.charAt(0)=='+' || value.charAt(0)=='-') {
|
if(value.charAt(0)=='+' || value.charAt(0)=='-') {
|
||||||
|
@ -781,6 +801,7 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
private static final Strategy TEXT_MONTH_STRATEGY = new TextStrategy(Calendar.MONTH);
|
private static final Strategy TEXT_MONTH_STRATEGY = new TextStrategy(Calendar.MONTH);
|
||||||
|
|
||||||
private static final Strategy NUMBER_MONTH_STRATEGY = new NumberStrategy(Calendar.MONTH) {
|
private static final Strategy NUMBER_MONTH_STRATEGY = new NumberStrategy(Calendar.MONTH) {
|
||||||
|
@Override
|
||||||
public int modify(int iValue) {
|
public int modify(int iValue) {
|
||||||
return iValue-1;
|
return iValue-1;
|
||||||
}
|
}
|
||||||
|
@ -793,11 +814,13 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
private static final Strategy DAY_OF_WEEK_IN_MONTH_STRATEGY = new NumberStrategy(Calendar.DAY_OF_WEEK_IN_MONTH);
|
private static final Strategy DAY_OF_WEEK_IN_MONTH_STRATEGY = new NumberStrategy(Calendar.DAY_OF_WEEK_IN_MONTH);
|
||||||
private static final Strategy HOUR_OF_DAY_STRATEGY = new NumberStrategy(Calendar.HOUR_OF_DAY);
|
private static final Strategy HOUR_OF_DAY_STRATEGY = new NumberStrategy(Calendar.HOUR_OF_DAY);
|
||||||
private static final Strategy MODULO_HOUR_OF_DAY_STRATEGY = new NumberStrategy(Calendar.HOUR_OF_DAY) {
|
private static final Strategy MODULO_HOUR_OF_DAY_STRATEGY = new NumberStrategy(Calendar.HOUR_OF_DAY) {
|
||||||
|
@Override
|
||||||
public int modify(int iValue) {
|
public int modify(int iValue) {
|
||||||
return iValue%24;
|
return iValue%24;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final Strategy MODULO_HOUR_STRATEGY = new NumberStrategy(Calendar.HOUR) {
|
private static final Strategy MODULO_HOUR_STRATEGY = new NumberStrategy(Calendar.HOUR) {
|
||||||
|
@Override
|
||||||
public int modify(int iValue) {
|
public int modify(int iValue) {
|
||||||
return iValue%12;
|
return iValue%12;
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,6 +375,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
* @param pos the position - ignored
|
* @param pos the position - ignored
|
||||||
* @return the buffer passed in
|
* @return the buffer passed in
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
|
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
|
||||||
if (obj instanceof Date) {
|
if (obj instanceof Date) {
|
||||||
return format((Date) obj, toAppendTo);
|
return format((Date) obj, toAppendTo);
|
||||||
|
@ -391,6 +392,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#format(long)
|
* @see org.apache.commons.lang3.time.DatePrinter#format(long)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String format(long millis) {
|
public String format(long millis) {
|
||||||
return format(new Date(millis));
|
return format(new Date(millis));
|
||||||
}
|
}
|
||||||
|
@ -398,6 +400,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date)
|
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String format(Date date) {
|
public String format(Date date) {
|
||||||
Calendar c = new GregorianCalendar(mTimeZone, mLocale); // hard code GregorianCalendar
|
Calendar c = new GregorianCalendar(mTimeZone, mLocale); // hard code GregorianCalendar
|
||||||
c.setTime(date);
|
c.setTime(date);
|
||||||
|
@ -407,6 +410,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar)
|
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String format(Calendar calendar) {
|
public String format(Calendar calendar) {
|
||||||
return format(calendar, new StringBuffer(mMaxLengthEstimate)).toString();
|
return format(calendar, new StringBuffer(mMaxLengthEstimate)).toString();
|
||||||
}
|
}
|
||||||
|
@ -414,6 +418,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#format(long, java.lang.StringBuffer)
|
* @see org.apache.commons.lang3.time.DatePrinter#format(long, java.lang.StringBuffer)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(long millis, StringBuffer buf) {
|
public StringBuffer format(long millis, StringBuffer buf) {
|
||||||
return format(new Date(millis), buf);
|
return format(new Date(millis), buf);
|
||||||
}
|
}
|
||||||
|
@ -421,6 +426,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date, java.lang.StringBuffer)
|
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date, java.lang.StringBuffer)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(Date date, StringBuffer buf) {
|
public StringBuffer format(Date date, StringBuffer buf) {
|
||||||
Calendar c = new GregorianCalendar(mTimeZone, mLocale); // hard code GregorianCalendar
|
Calendar c = new GregorianCalendar(mTimeZone, mLocale); // hard code GregorianCalendar
|
||||||
c.setTime(date);
|
c.setTime(date);
|
||||||
|
@ -430,6 +436,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar, java.lang.StringBuffer)
|
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar, java.lang.StringBuffer)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public StringBuffer format(Calendar calendar, StringBuffer buf) {
|
public StringBuffer format(Calendar calendar, StringBuffer buf) {
|
||||||
return applyRules(calendar, buf);
|
return applyRules(calendar, buf);
|
||||||
}
|
}
|
||||||
|
@ -454,6 +461,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#getPattern()
|
* @see org.apache.commons.lang3.time.DatePrinter#getPattern()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPattern() {
|
public String getPattern() {
|
||||||
return mPattern;
|
return mPattern;
|
||||||
}
|
}
|
||||||
|
@ -461,6 +469,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#getTimeZone()
|
* @see org.apache.commons.lang3.time.DatePrinter#getTimeZone()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public TimeZone getTimeZone() {
|
public TimeZone getTimeZone() {
|
||||||
return mTimeZone;
|
return mTimeZone;
|
||||||
}
|
}
|
||||||
|
@ -468,6 +477,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.commons.lang3.time.DatePrinter#getLocale()
|
* @see org.apache.commons.lang3.time.DatePrinter#getLocale()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Locale getLocale() {
|
public Locale getLocale() {
|
||||||
return mLocale;
|
return mLocale;
|
||||||
}
|
}
|
||||||
|
@ -593,6 +603,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -600,6 +611,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
buffer.append(mValue);
|
buffer.append(mValue);
|
||||||
}
|
}
|
||||||
|
@ -624,6 +636,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return mValue.length();
|
return mValue.length();
|
||||||
}
|
}
|
||||||
|
@ -631,6 +644,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
buffer.append(mValue);
|
buffer.append(mValue);
|
||||||
}
|
}
|
||||||
|
@ -658,6 +672,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
int max = 0;
|
int max = 0;
|
||||||
for (int i=mValues.length; --i >= 0; ) {
|
for (int i=mValues.length; --i >= 0; ) {
|
||||||
|
@ -672,6 +687,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
buffer.append(mValues[calendar.get(mField)]);
|
buffer.append(mValues[calendar.get(mField)]);
|
||||||
}
|
}
|
||||||
|
@ -695,6 +711,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -702,6 +719,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
appendTo(buffer, calendar.get(mField));
|
appendTo(buffer, calendar.get(mField));
|
||||||
}
|
}
|
||||||
|
@ -709,6 +727,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void appendTo(StringBuffer buffer, int value) {
|
public final void appendTo(StringBuffer buffer, int value) {
|
||||||
if (value < 10) {
|
if (value < 10) {
|
||||||
buffer.append((char)(value + '0'));
|
buffer.append((char)(value + '0'));
|
||||||
|
@ -738,6 +757,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -745,6 +765,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
|
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
|
||||||
}
|
}
|
||||||
|
@ -752,6 +773,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void appendTo(StringBuffer buffer, int value) {
|
public final void appendTo(StringBuffer buffer, int value) {
|
||||||
if (value < 10) {
|
if (value < 10) {
|
||||||
buffer.append((char)(value + '0'));
|
buffer.append((char)(value + '0'));
|
||||||
|
@ -787,6 +809,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -794,6 +817,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
appendTo(buffer, calendar.get(mField));
|
appendTo(buffer, calendar.get(mField));
|
||||||
}
|
}
|
||||||
|
@ -801,6 +825,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void appendTo(StringBuffer buffer, int value) {
|
public final void appendTo(StringBuffer buffer, int value) {
|
||||||
if (value < 100) {
|
if (value < 100) {
|
||||||
for (int i = mSize; --i >= 2; ) {
|
for (int i = mSize; --i >= 2; ) {
|
||||||
|
@ -842,6 +867,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -849,6 +875,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
appendTo(buffer, calendar.get(mField));
|
appendTo(buffer, calendar.get(mField));
|
||||||
}
|
}
|
||||||
|
@ -856,6 +883,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void appendTo(StringBuffer buffer, int value) {
|
public final void appendTo(StringBuffer buffer, int value) {
|
||||||
if (value < 100) {
|
if (value < 100) {
|
||||||
buffer.append((char)(value / 10 + '0'));
|
buffer.append((char)(value / 10 + '0'));
|
||||||
|
@ -882,6 +910,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -889,6 +918,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
appendTo(buffer, calendar.get(Calendar.YEAR) % 100);
|
appendTo(buffer, calendar.get(Calendar.YEAR) % 100);
|
||||||
}
|
}
|
||||||
|
@ -896,6 +926,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void appendTo(StringBuffer buffer, int value) {
|
public final void appendTo(StringBuffer buffer, int value) {
|
||||||
buffer.append((char)(value / 10 + '0'));
|
buffer.append((char)(value / 10 + '0'));
|
||||||
buffer.append((char)(value % 10 + '0'));
|
buffer.append((char)(value % 10 + '0'));
|
||||||
|
@ -918,6 +949,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -925,6 +957,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
|
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
|
||||||
}
|
}
|
||||||
|
@ -932,6 +965,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void appendTo(StringBuffer buffer, int value) {
|
public final void appendTo(StringBuffer buffer, int value) {
|
||||||
buffer.append((char)(value / 10 + '0'));
|
buffer.append((char)(value / 10 + '0'));
|
||||||
buffer.append((char)(value % 10 + '0'));
|
buffer.append((char)(value % 10 + '0'));
|
||||||
|
@ -957,6 +991,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return mRule.estimateLength();
|
return mRule.estimateLength();
|
||||||
}
|
}
|
||||||
|
@ -964,6 +999,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
int value = calendar.get(Calendar.HOUR);
|
int value = calendar.get(Calendar.HOUR);
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
|
@ -975,6 +1011,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, int value) {
|
public void appendTo(StringBuffer buffer, int value) {
|
||||||
mRule.appendTo(buffer, value);
|
mRule.appendTo(buffer, value);
|
||||||
}
|
}
|
||||||
|
@ -999,6 +1036,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return mRule.estimateLength();
|
return mRule.estimateLength();
|
||||||
}
|
}
|
||||||
|
@ -1006,6 +1044,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
int value = calendar.get(Calendar.HOUR_OF_DAY);
|
int value = calendar.get(Calendar.HOUR_OF_DAY);
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
|
@ -1017,6 +1056,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, int value) {
|
public void appendTo(StringBuffer buffer, int value) {
|
||||||
mRule.appendTo(buffer, value);
|
mRule.appendTo(buffer, value);
|
||||||
}
|
}
|
||||||
|
@ -1074,6 +1114,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return Math.max(mStandard.length(), mDaylight.length());
|
return Math.max(mStandard.length(), mDaylight.length());
|
||||||
}
|
}
|
||||||
|
@ -1081,6 +1122,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
if (mTimeZone.useDaylightTime() && calendar.get(Calendar.DST_OFFSET) != 0) {
|
if (mTimeZone.useDaylightTime() && calendar.get(Calendar.DST_OFFSET) != 0) {
|
||||||
buffer.append(mDaylight);
|
buffer.append(mDaylight);
|
||||||
|
@ -1112,6 +1154,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int estimateLength() {
|
public int estimateLength() {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
@ -1119,6 +1162,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
public void appendTo(StringBuffer buffer, Calendar calendar) {
|
||||||
int offset = calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET);
|
int offset = calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET);
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ public final class ImmutablePair<L, R> extends Pair<L, R> {
|
||||||
* @return never
|
* @return never
|
||||||
* @throws UnsupportedOperationException as this operation is not supported
|
* @throws UnsupportedOperationException as this operation is not supported
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public R setValue(R value) {
|
public R setValue(R value) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ public class MutablePair<L, R> extends Pair<L, R> {
|
||||||
* @param value the right value to set, not null
|
* @param value the right value to set, not null
|
||||||
* @return the old value for the right element
|
* @return the old value for the right element
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public R setValue(R value) {
|
public R setValue(R value) {
|
||||||
R result = getRight();
|
R result = getRight();
|
||||||
setRight(value);
|
setRight(value);
|
||||||
|
|
|
@ -87,6 +87,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
||||||
*
|
*
|
||||||
* @return the left element as the key, may be null
|
* @return the left element as the key, may be null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final L getKey() {
|
public final L getKey() {
|
||||||
return getLeft();
|
return getLeft();
|
||||||
}
|
}
|
||||||
|
@ -99,6 +100,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
||||||
*
|
*
|
||||||
* @return the right element as the value, may be null
|
* @return the right element as the value, may be null
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public R getValue() {
|
public R getValue() {
|
||||||
return getRight();
|
return getRight();
|
||||||
}
|
}
|
||||||
|
@ -111,6 +113,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
||||||
* @param other the other pair, not null
|
* @param other the other pair, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(Pair<L, R> other) {
|
public int compareTo(Pair<L, R> other) {
|
||||||
return new CompareToBuilder().append(getLeft(), other.getLeft())
|
return new CompareToBuilder().append(getLeft(), other.getLeft())
|
||||||
.append(getRight(), other.getRight()).toComparison();
|
.append(getRight(), other.getRight()).toComparison();
|
||||||
|
|
|
@ -91,6 +91,7 @@ public abstract class Triple<L, M, R> implements Comparable<Triple<L, M, R>>, Se
|
||||||
* @param other the other triple, not null
|
* @param other the other triple, not null
|
||||||
* @return negative if this is less, zero if equal, positive if greater
|
* @return negative if this is less, zero if equal, positive if greater
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(Triple<L, M, R> other) {
|
public int compareTo(Triple<L, M, R> other) {
|
||||||
return new CompareToBuilder().append(getLeft(), other.getLeft())
|
return new CompareToBuilder().append(getLeft(), other.getLeft())
|
||||||
.append(getMiddle(), other.getMiddle())
|
.append(getMiddle(), other.getMiddle())
|
||||||
|
|
|
@ -451,6 +451,7 @@ public class AnnotationUtilsTest {
|
||||||
|
|
||||||
InvocationHandler generatedTestInvocationHandler = new InvocationHandler() {
|
InvocationHandler generatedTestInvocationHandler = new InvocationHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||||
if ("equals".equals(method.getName()) && method.getParameterTypes().length == 1) {
|
if ("equals".equals(method.getName()) && method.getParameterTypes().length == 1) {
|
||||||
return Boolean.valueOf(proxy == args[0]);
|
return Boolean.valueOf(proxy == args[0]);
|
||||||
|
|
|
@ -228,12 +228,15 @@ public class ArrayUtilsTest extends TestCase {
|
||||||
} catch (IllegalArgumentException ex) {}
|
} catch (IllegalArgumentException ex) {}
|
||||||
|
|
||||||
map = ArrayUtils.toMap(new Object[] {new Map.Entry<Object, Object>() {
|
map = ArrayUtils.toMap(new Object[] {new Map.Entry<Object, Object>() {
|
||||||
|
@Override
|
||||||
public Object getKey() {
|
public Object getKey() {
|
||||||
return "foo";
|
return "foo";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public Object getValue() {
|
public Object getValue() {
|
||||||
return "bar";
|
return "bar";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public Object setValue(Object value) {
|
public Object setValue(Object value) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,14 +489,17 @@ public class ObjectUtilsTest {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char charAt(int arg0) {
|
public char charAt(int arg0) {
|
||||||
return value.charAt(arg0);
|
return value.charAt(arg0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int length() {
|
public int length() {
|
||||||
return value.length();
|
return value.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public CharSequence subSequence(int arg0, int arg1) {
|
public CharSequence subSequence(int arg0, int arg1) {
|
||||||
return value.subSequence(arg0, arg1);
|
return value.subSequence(arg0, arg1);
|
||||||
}
|
}
|
||||||
|
@ -509,6 +512,7 @@ public class ObjectUtilsTest {
|
||||||
|
|
||||||
static final class CharSequenceComparator implements Comparator<CharSequence> {
|
static final class CharSequenceComparator implements Comparator<CharSequence> {
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compare(CharSequence o1, CharSequence o2) {
|
public int compare(CharSequence o1, CharSequence o2) {
|
||||||
return o1.toString().compareTo(o2.toString());
|
return o1.toString().compareTo(o2.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@ public class RangeTest {
|
||||||
public void testComparableConstructors() {
|
public void testComparableConstructors() {
|
||||||
Comparable c =
|
Comparable c =
|
||||||
new Comparable() {
|
new Comparable() {
|
||||||
|
@Override
|
||||||
public int compareTo(Object other) {
|
public int compareTo(Object other) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +81,7 @@ public class RangeTest {
|
||||||
@Test
|
@Test
|
||||||
public void testIsWithCompare(){
|
public void testIsWithCompare(){
|
||||||
Comparator<Integer> c = new Comparator<Integer>(){
|
Comparator<Integer> c = new Comparator<Integer>(){
|
||||||
|
@Override
|
||||||
public int compare(Integer o1, Integer o2) {
|
public int compare(Integer o1, Integer o2) {
|
||||||
return 0; // all integers are equal
|
return 0; // all integers are equal
|
||||||
}
|
}
|
||||||
|
@ -98,6 +100,7 @@ public class RangeTest {
|
||||||
public void testBetweenWithCompare(){
|
public void testBetweenWithCompare(){
|
||||||
// TODO add tests with a better comparator
|
// TODO add tests with a better comparator
|
||||||
Comparator<Integer> c = new Comparator<Integer>(){
|
Comparator<Integer> c = new Comparator<Integer>(){
|
||||||
|
@Override
|
||||||
public int compare(Integer o1, Integer o2) {
|
public int compare(Integer o1, Integer o2) {
|
||||||
return 0; // all integers are equal
|
return 0; // all integers are equal
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,14 +453,17 @@ public class StringUtilsEqualsIndexOfTest extends TestCase {
|
||||||
this.seq = seq;
|
this.seq = seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public char charAt(int index) {
|
public char charAt(int index) {
|
||||||
return seq.charAt(index);
|
return seq.charAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int length() {
|
public int length() {
|
||||||
return seq.length();
|
return seq.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public CharSequence subSequence(int start, int end) {
|
public CharSequence subSequence(int start, int end) {
|
||||||
return new CustomCharSequence(seq.subSequence(start, end));
|
return new CustomCharSequence(seq.subSequence(start, end));
|
||||||
}
|
}
|
||||||
|
@ -474,6 +477,7 @@ public class StringUtilsEqualsIndexOfTest extends TestCase {
|
||||||
return seq.equals(other.seq);
|
return seq.equals(other.seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return seq.toString();
|
return seq.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public class CompareToBuilderTest {
|
||||||
public int getA() {
|
public int getA() {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int compareTo(TestObject rhs) {
|
public int compareTo(TestObject rhs) {
|
||||||
return a < rhs.a ? -1 : a > rhs.a ? +1 : 0;
|
return a < rhs.a ? -1 : a > rhs.a ? +1 : 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ public class ReflectionToStringBuilderConcurrencyTest {
|
||||||
final ExecutorService threadPool = Executors.newFixedThreadPool(2);
|
final ExecutorService threadPool = Executors.newFixedThreadPool(2);
|
||||||
// Consumes toStrings
|
// Consumes toStrings
|
||||||
Callable<Integer> consumer = new Callable<Integer>() {
|
Callable<Integer> consumer = new Callable<Integer>() {
|
||||||
|
@Override
|
||||||
public Integer call() {
|
public Integer call() {
|
||||||
for (int i = 0; i < REPEAT; i++) {
|
for (int i = 0; i < REPEAT; i++) {
|
||||||
String s = ReflectionToStringBuilder.toString(holder);
|
String s = ReflectionToStringBuilder.toString(holder);
|
||||||
|
@ -100,6 +101,7 @@ public class ReflectionToStringBuilderConcurrencyTest {
|
||||||
};
|
};
|
||||||
// Produces changes in the list
|
// Produces changes in the list
|
||||||
Callable<Integer> producer = new Callable<Integer>() {
|
Callable<Integer> producer = new Callable<Integer>() {
|
||||||
|
@Override
|
||||||
public Integer call() {
|
public Integer call() {
|
||||||
for (int i = 0; i < DATA_SIZE; i++) {
|
for (int i = 0; i < DATA_SIZE; i++) {
|
||||||
list.remove(list.get(0));
|
list.remove(list.get(0));
|
||||||
|
|
|
@ -67,6 +67,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest {
|
||||||
this.testFixture = testFixture;
|
this.testFixture = testFixture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (random.nextBoolean()) {
|
if (random.nextBoolean()) {
|
||||||
testFixture.add();
|
testFixture.add();
|
||||||
|
@ -84,6 +85,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest {
|
||||||
this.testFixture = testFixture;
|
this.testFixture = testFixture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
ReflectionToStringBuilder.toString(testFixture);
|
ReflectionToStringBuilder.toString(testFixture);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ public class ToStringStyleConcurrencyTest {
|
||||||
final ExecutorService threadPool = Executors.newFixedThreadPool(2);
|
final ExecutorService threadPool = Executors.newFixedThreadPool(2);
|
||||||
// Consumes toStrings
|
// Consumes toStrings
|
||||||
Callable<Integer> consumer = new Callable<Integer>() {
|
Callable<Integer> consumer = new Callable<Integer>() {
|
||||||
|
@Override
|
||||||
public Integer call() {
|
public Integer call() {
|
||||||
for (int i = 0; i < REPEAT; i++) {
|
for (int i = 0; i < REPEAT; i++) {
|
||||||
// Calls ToStringStyle
|
// Calls ToStringStyle
|
||||||
|
|
|
@ -91,6 +91,7 @@ public class CallableBackgroundInitializerTest extends TestCase {
|
||||||
/**
|
/**
|
||||||
* Records this invocation and returns the test result.
|
* Records this invocation and returns the test result.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Integer call() throws Exception {
|
public Integer call() throws Exception {
|
||||||
callCount++;
|
callCount++;
|
||||||
return RESULT;
|
return RESULT;
|
||||||
|
|
|
@ -147,6 +147,7 @@ public class EventListenerSupportTest extends TestCase
|
||||||
EventListenerSupport<VetoableChangeListener> listenerSupport = EventListenerSupport.create(VetoableChangeListener.class);
|
EventListenerSupport<VetoableChangeListener> listenerSupport = EventListenerSupport.create(VetoableChangeListener.class);
|
||||||
listenerSupport.addListener(new VetoableChangeListener() {
|
listenerSupport.addListener(new VetoableChangeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void vetoableChange(PropertyChangeEvent e) {
|
public void vetoableChange(PropertyChangeEvent e) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -220,6 +221,7 @@ public class EventListenerSupportTest extends TestCase
|
||||||
{
|
{
|
||||||
listenerSupport.addListener(new VetoableChangeListener()
|
listenerSupport.addListener(new VetoableChangeListener()
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public void vetoableChange(PropertyChangeEvent e)
|
public void vetoableChange(PropertyChangeEvent e)
|
||||||
{
|
{
|
||||||
listenerSupport.removeListener(this);
|
listenerSupport.removeListener(this);
|
||||||
|
@ -231,6 +233,7 @@ public class EventListenerSupportTest extends TestCase
|
||||||
{
|
{
|
||||||
return new VetoableChangeListener()
|
return new VetoableChangeListener()
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public void vetoableChange(PropertyChangeEvent e)
|
public void vetoableChange(PropertyChangeEvent e)
|
||||||
{
|
{
|
||||||
calledListeners.add(this);
|
calledListeners.add(this);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class EventUtilsTest extends TestCase
|
||||||
{
|
{
|
||||||
EventUtils.addEventListener(src, PropertyChangeListener.class, new PropertyChangeListener()
|
EventUtils.addEventListener(src, PropertyChangeListener.class, new PropertyChangeListener()
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent e)
|
public void propertyChange(PropertyChangeEvent e)
|
||||||
{
|
{
|
||||||
// Do nothing!
|
// Do nothing!
|
||||||
|
@ -201,6 +202,7 @@ public class EventUtilsTest extends TestCase
|
||||||
return count == null ? 0 : count.intValue();
|
return count == null ? 0 : count.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
|
||||||
{
|
{
|
||||||
Integer count = eventCounts.get(method.getName());
|
Integer count = eventCounts.get(method.getName());
|
||||||
|
|
|
@ -115,10 +115,12 @@ public class MethodUtilsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TestMutable implements Mutable<Object> {
|
private static class TestMutable implements Mutable<Object> {
|
||||||
|
@Override
|
||||||
public Object getValue() {
|
public Object getValue() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setValue(Object value) {
|
public void setValue(Object value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,6 +412,7 @@ public class ExtendedMessageFormatTest extends TestCase {
|
||||||
*/
|
*/
|
||||||
private static class LowerCaseFormatFactory implements FormatFactory {
|
private static class LowerCaseFormatFactory implements FormatFactory {
|
||||||
private static final Format LOWER_INSTANCE = new LowerCaseFormat();
|
private static final Format LOWER_INSTANCE = new LowerCaseFormat();
|
||||||
|
@Override
|
||||||
public Format getFormat(String name, String arguments, Locale locale) {
|
public Format getFormat(String name, String arguments, Locale locale) {
|
||||||
return LOWER_INSTANCE;
|
return LOWER_INSTANCE;
|
||||||
}
|
}
|
||||||
|
@ -421,6 +422,7 @@ public class ExtendedMessageFormatTest extends TestCase {
|
||||||
*/
|
*/
|
||||||
private static class UpperCaseFormatFactory implements FormatFactory {
|
private static class UpperCaseFormatFactory implements FormatFactory {
|
||||||
private static final Format UPPER_INSTANCE = new UpperCaseFormat();
|
private static final Format UPPER_INSTANCE = new UpperCaseFormat();
|
||||||
|
@Override
|
||||||
public Format getFormat(String name, String arguments, Locale locale) {
|
public Format getFormat(String name, String arguments, Locale locale) {
|
||||||
return UPPER_INSTANCE;
|
return UPPER_INSTANCE;
|
||||||
}
|
}
|
||||||
|
@ -429,6 +431,7 @@ public class ExtendedMessageFormatTest extends TestCase {
|
||||||
* {@link FormatFactory} implementation to override date format "short" to "default".
|
* {@link FormatFactory} implementation to override date format "short" to "default".
|
||||||
*/
|
*/
|
||||||
private static class OverrideShortDateFormatFactory implements FormatFactory {
|
private static class OverrideShortDateFormatFactory implements FormatFactory {
|
||||||
|
@Override
|
||||||
public Format getFormat(String name, String arguments, Locale locale) {
|
public Format getFormat(String name, String arguments, Locale locale) {
|
||||||
return !"short".equals(arguments) ? null
|
return !"short".equals(arguments) ? null
|
||||||
: locale == null ? DateFormat
|
: locale == null ? DateFormat
|
||||||
|
|
|
@ -281,6 +281,7 @@ public class FastDateFormatTest {
|
||||||
|
|
||||||
for(int i= 0; i<NTHREADS; ++i) {
|
for(int i= 0; i<NTHREADS; ++i) {
|
||||||
pool.submit(new Runnable() {
|
pool.submit(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for(int i= 0; i<NROUNDS; ++i) {
|
for(int i= 0; i<NROUNDS; ++i) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue