Add missing @Override markers

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@753646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-14 12:58:05 +00:00
parent fede75d58f
commit 43db58d70f
30 changed files with 229 additions and 0 deletions

View File

@ -94,6 +94,7 @@ public NestableError(String msg, Throwable cause) {
/**
* {@inheritDoc}
*/
@Override
public Throwable getCause() {
return cause;
}
@ -105,6 +106,7 @@ public Throwable getCause() {
*
* @return String message string of the throwable
*/
@Override
public String getMessage() {
if (super.getMessage() != null) {
return super.getMessage();
@ -170,6 +172,7 @@ public int indexOfThrowable(Class type, int fromIndex) {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace() {
delegate.printStackTrace();
}
@ -177,6 +180,7 @@ public void printStackTrace() {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace(PrintStream out) {
delegate.printStackTrace(out);
}
@ -184,6 +188,7 @@ public void printStackTrace(PrintStream out) {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace(PrintWriter out) {
delegate.printStackTrace(out);
}

View File

@ -154,6 +154,7 @@ public NestableException(String msg, Throwable cause) {
/**
* {@inheritDoc}
*/
@Override
public Throwable getCause() {
return cause;
}
@ -165,6 +166,7 @@ public Throwable getCause() {
*
* @return String message string of the throwable
*/
@Override
public String getMessage() {
if (super.getMessage() != null) {
return super.getMessage();
@ -230,6 +232,7 @@ public int indexOfThrowable(Class type, int fromIndex) {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace() {
delegate.printStackTrace();
}
@ -237,6 +240,7 @@ public void printStackTrace() {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace(PrintStream out) {
delegate.printStackTrace(out);
}
@ -244,6 +248,7 @@ public void printStackTrace(PrintStream out) {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace(PrintWriter out) {
delegate.printStackTrace(out);
}

View File

@ -98,6 +98,7 @@ public NestableRuntimeException(String msg, Throwable cause) {
/**
* {@inheritDoc}
*/
@Override
public Throwable getCause() {
return cause;
}
@ -109,6 +110,7 @@ public Throwable getCause() {
*
* @return String message string of the throwable
*/
@Override
public String getMessage() {
if (super.getMessage() != null) {
return super.getMessage();
@ -174,6 +176,7 @@ public int indexOfThrowable(Class type, int fromIndex) {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace() {
delegate.printStackTrace();
}
@ -181,6 +184,7 @@ public void printStackTrace() {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace(PrintStream out) {
delegate.printStackTrace(out);
}
@ -188,6 +192,7 @@ public void printStackTrace(PrintStream out) {
/**
* {@inheritDoc}
*/
@Override
public void printStackTrace(PrintWriter out) {
delegate.printStackTrace(out);
}

View File

@ -177,6 +177,7 @@ public DoubleRange(Number number1, Number number2) {
*
* @return the minimum number in this range
*/
@Override
public Number getMinimumNumber() {
if (minObject == null) {
minObject = new Double(min);
@ -191,6 +192,7 @@ public Number getMinimumNumber() {
*
* @return the minimum number in this range
*/
@Override
public long getMinimumLong() {
return (long) min;
}
@ -202,6 +204,7 @@ public long getMinimumLong() {
*
* @return the minimum number in this range
*/
@Override
public int getMinimumInteger() {
return (int) min;
}
@ -211,6 +214,7 @@ public int getMinimumInteger() {
*
* @return the minimum number in this range
*/
@Override
public double getMinimumDouble() {
return min;
}
@ -222,6 +226,7 @@ public double getMinimumDouble() {
*
* @return the minimum number in this range
*/
@Override
public float getMinimumFloat() {
return (float) min;
}
@ -231,6 +236,7 @@ public float getMinimumFloat() {
*
* @return the maximum number in this range
*/
@Override
public Number getMaximumNumber() {
if (maxObject == null) {
maxObject = new Double(max);
@ -245,6 +251,7 @@ public Number getMaximumNumber() {
*
* @return the maximum number in this range
*/
@Override
public long getMaximumLong() {
return (long) max;
}
@ -256,6 +263,7 @@ public long getMaximumLong() {
*
* @return the maximum number in this range
*/
@Override
public int getMaximumInteger() {
return (int) max;
}
@ -265,6 +273,7 @@ public int getMaximumInteger() {
*
* @return the maximum number in this range
*/
@Override
public double getMaximumDouble() {
return max;
}
@ -276,6 +285,7 @@ public double getMaximumDouble() {
*
* @return the maximum number in this range
*/
@Override
public float getMaximumFloat() {
return (float) max;
}
@ -292,6 +302,7 @@ public float getMaximumFloat() {
* @param number the number to test, may be <code>null</code>
* @return <code>true</code> if the specified number occurs within this range
*/
@Override
public boolean containsNumber(Number number) {
if (number == null) {
return false;
@ -310,6 +321,7 @@ public boolean containsNumber(Number number) {
* @return <code>true</code> if the specified number occurs within this
* range by <code>double</code> comparison
*/
@Override
public boolean containsDouble(double value) {
return value >= min && value <= max;
}
@ -327,6 +339,7 @@ public boolean containsDouble(double value) {
* @return <code>true</code> if the specified range occurs entirely within this range
* @throws IllegalArgumentException if the range is not of this type
*/
@Override
public boolean containsRange(Range range) {
if (range == null) {
return false;
@ -344,6 +357,7 @@ public boolean containsRange(Range range) {
* @param range the range to test, may be <code>null</code>
* @return <code>true</code> if the specified range overlaps with this range
*/
@Override
public boolean overlapsRange(Range range) {
if (range == null) {
return false;
@ -364,6 +378,7 @@ public boolean overlapsRange(Range range) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -381,6 +396,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
@ -400,6 +416,7 @@ public int hashCode() {
*
* @return the <code>String</code> representation of this range
*/
@Override
public String toString() {
if (toString == null) {
StringBuffer buf = new StringBuffer(32);

View File

@ -177,6 +177,7 @@ public FloatRange(Number number1, Number number2) {
*
* @return the minimum number in this range
*/
@Override
public Number getMinimumNumber() {
if (minObject == null) {
minObject = new Float(min);
@ -191,6 +192,7 @@ public Number getMinimumNumber() {
*
* @return the minimum number in this range
*/
@Override
public long getMinimumLong() {
return (long) min;
}
@ -202,6 +204,7 @@ public long getMinimumLong() {
*
* @return the minimum number in this range
*/
@Override
public int getMinimumInteger() {
return (int) min;
}
@ -211,6 +214,7 @@ public int getMinimumInteger() {
*
* @return the minimum number in this range
*/
@Override
public double getMinimumDouble() {
return min;
}
@ -220,6 +224,7 @@ public double getMinimumDouble() {
*
* @return the minimum number in this range
*/
@Override
public float getMinimumFloat() {
return min;
}
@ -229,6 +234,7 @@ public float getMinimumFloat() {
*
* @return the maximum number in this range
*/
@Override
public Number getMaximumNumber() {
if (maxObject == null) {
maxObject = new Float(max);
@ -243,6 +249,7 @@ public Number getMaximumNumber() {
*
* @return the maximum number in this range
*/
@Override
public long getMaximumLong() {
return (long) max;
}
@ -254,6 +261,7 @@ public long getMaximumLong() {
*
* @return the maximum number in this range
*/
@Override
public int getMaximumInteger() {
return (int) max;
}
@ -263,6 +271,7 @@ public int getMaximumInteger() {
*
* @return the maximum number in this range
*/
@Override
public double getMaximumDouble() {
return max;
}
@ -272,6 +281,7 @@ public double getMaximumDouble() {
*
* @return the maximum number in this range
*/
@Override
public float getMaximumFloat() {
return max;
}
@ -288,6 +298,7 @@ public float getMaximumFloat() {
* @param number the number to test, may be <code>null</code>
* @return <code>true</code> if the specified number occurs within this range
*/
@Override
public boolean containsNumber(Number number) {
if (number == null) {
return false;
@ -306,6 +317,7 @@ public boolean containsNumber(Number number) {
* @return <code>true</code> if the specified number occurs within this
* range by <code>float</code> comparison
*/
@Override
public boolean containsFloat(float value) {
return value >= min && value <= max;
}
@ -323,6 +335,7 @@ public boolean containsFloat(float value) {
* @return <code>true</code> if the specified range occurs entirely within this range
* @throws IllegalArgumentException if the range is not of this type
*/
@Override
public boolean containsRange(Range range) {
if (range == null) {
return false;
@ -340,6 +353,7 @@ public boolean containsRange(Range range) {
* @param range the range to test, may be <code>null</code>
* @return <code>true</code> if the specified range overlaps with this range
*/
@Override
public boolean overlapsRange(Range range) {
if (range == null) {
return false;
@ -360,6 +374,7 @@ public boolean overlapsRange(Range range) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -377,6 +392,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
@ -394,6 +410,7 @@ public int hashCode() {
*
* @return the <code>String</code> representation of this range
*/
@Override
public String toString() {
if (toString == null) {
StringBuffer buf = new StringBuffer(32);

View File

@ -416,6 +416,7 @@ public int getProperWhole() {
*
* @return the whole number fraction part
*/
@Override
public int intValue() {
return numerator / denominator;
}
@ -426,6 +427,7 @@ public int intValue() {
*
* @return the whole number fraction part
*/
@Override
public long longValue() {
return (long) numerator / denominator;
}
@ -436,6 +438,7 @@ public long longValue() {
*
* @return the fraction as a <code>float</code>
*/
@Override
public float floatValue() {
return ((float) numerator) / ((float) denominator);
}
@ -446,6 +449,7 @@ public float floatValue() {
*
* @return the fraction as a <code>double</code>
*/
@Override
public double doubleValue() {
return ((double) numerator) / ((double) denominator);
}
@ -829,6 +833,7 @@ public Fraction divideBy(Fraction fraction) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -846,6 +851,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (hashCode == 0) {
// hashcode update should be atomic.
@ -894,6 +900,7 @@ public int compareTo(Object object) {
*
* @return a <code>String</code> form of the fraction
*/
@Override
public String toString() {
if (toString == null) {
toString = new StringBuffer(32)

View File

@ -160,6 +160,7 @@ public IntRange(Number number1, Number number2) {
*
* @return the minimum number in this range
*/
@Override
public Number getMinimumNumber() {
if (minObject == null) {
minObject = new Integer(min);
@ -172,6 +173,7 @@ public Number getMinimumNumber() {
*
* @return the minimum number in this range
*/
@Override
public long getMinimumLong() {
return min;
}
@ -181,6 +183,7 @@ public long getMinimumLong() {
*
* @return the minimum number in this range
*/
@Override
public int getMinimumInteger() {
return min;
}
@ -190,6 +193,7 @@ public int getMinimumInteger() {
*
* @return the minimum number in this range
*/
@Override
public double getMinimumDouble() {
return min;
}
@ -199,6 +203,7 @@ public double getMinimumDouble() {
*
* @return the minimum number in this range
*/
@Override
public float getMinimumFloat() {
return min;
}
@ -208,6 +213,7 @@ public float getMinimumFloat() {
*
* @return the maximum number in this range
*/
@Override
public Number getMaximumNumber() {
if (maxObject == null) {
maxObject = new Integer(max);
@ -220,6 +226,7 @@ public Number getMaximumNumber() {
*
* @return the maximum number in this range
*/
@Override
public long getMaximumLong() {
return max;
}
@ -229,6 +236,7 @@ public long getMaximumLong() {
*
* @return the maximum number in this range
*/
@Override
public int getMaximumInteger() {
return max;
}
@ -238,6 +246,7 @@ public int getMaximumInteger() {
*
* @return the maximum number in this range
*/
@Override
public double getMaximumDouble() {
return max;
}
@ -247,6 +256,7 @@ public double getMaximumDouble() {
*
* @return the maximum number in this range
*/
@Override
public float getMaximumFloat() {
return max;
}
@ -263,6 +273,7 @@ public float getMaximumFloat() {
* @param number the number to test, may be <code>null</code>
* @return <code>true</code> if the specified number occurs within this range
*/
@Override
public boolean containsNumber(Number number) {
if (number == null) {
return false;
@ -281,6 +292,7 @@ public boolean containsNumber(Number number) {
* @return <code>true</code> if the specified number occurs within this
* range by <code>int</code> comparison
*/
@Override
public boolean containsInteger(int value) {
return value >= min && value <= max;
}
@ -298,6 +310,7 @@ public boolean containsInteger(int value) {
* @return <code>true</code> if the specified range occurs entirely within this range
* @throws IllegalArgumentException if the range is not of this type
*/
@Override
public boolean containsRange(Range range) {
if (range == null) {
return false;
@ -315,6 +328,7 @@ public boolean containsRange(Range range) {
* @param range the range to test, may be <code>null</code>
* @return <code>true</code> if the specified range overlaps with this range
*/
@Override
public boolean overlapsRange(Range range) {
if (range == null) {
return false;
@ -335,6 +349,7 @@ public boolean overlapsRange(Range range) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -351,6 +366,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
@ -368,6 +384,7 @@ public int hashCode() {
*
* @return the <code>String</code> representation of this range
*/
@Override
public String toString() {
if (toString == null) {
StringBuffer buf = new StringBuffer(32);

View File

@ -59,6 +59,7 @@ public JVMRandom() {
* @param seed ignored
* @throws UnsupportedOperationException
*/
@Override
public synchronized void setSeed(long seed) {
if (this.constructed) {
throw new UnsupportedOperationException();
@ -71,6 +72,7 @@ public synchronized void setSeed(long seed) {
* @return Nothing, this method always throws an UnsupportedOperationException.
* @throws UnsupportedOperationException
*/
@Override
public synchronized double nextGaussian() {
throw new UnsupportedOperationException();
}
@ -81,6 +83,7 @@ public synchronized double nextGaussian() {
* @param byteArray ignored
* @throws UnsupportedOperationException
*/
@Override
public void nextBytes(byte[] byteArray) {
throw new UnsupportedOperationException();
}
@ -91,6 +94,7 @@ public void nextBytes(byte[] byteArray) {
*
* @return the random int
*/
@Override
public int nextInt() {
return nextInt(Integer.MAX_VALUE);
}
@ -103,6 +107,7 @@ public int nextInt() {
* @return the random int
* @throws IllegalArgumentException when <code>n &lt;= 0</code>
*/
@Override
public int nextInt(int n) {
if (n <= 0) {
throw new IllegalArgumentException(
@ -117,6 +122,7 @@ public int nextInt(int n) {
* from the Math.random() sequence.</p>
* @return the random long
*/
@Override
public long nextLong() {
// possible loss of precision?
return nextLong(Long.MAX_VALUE);
@ -148,6 +154,7 @@ public static long nextLong(long n) {
*
* @return the random boolean
*/
@Override
public boolean nextBoolean() {
return Math.random() > 0.5;
}
@ -158,6 +165,7 @@ public boolean nextBoolean() {
*
* @return the random float
*/
@Override
public float nextFloat() {
return (float)Math.random();
}
@ -166,6 +174,7 @@ public float nextFloat() {
*
* @return the random double
*/
@Override
public double nextDouble() {
return Math.random();
}

View File

@ -161,6 +161,7 @@ public LongRange(Number number1, Number number2) {
*
* @return the minimum number in this range
*/
@Override
public Number getMinimumNumber() {
if (minObject == null) {
minObject = new Long(min);
@ -173,6 +174,7 @@ public Number getMinimumNumber() {
*
* @return the minimum number in this range
*/
@Override
public long getMinimumLong() {
return min;
}
@ -184,6 +186,7 @@ public long getMinimumLong() {
*
* @return the minimum number in this range
*/
@Override
public int getMinimumInteger() {
return (int) min;
}
@ -195,6 +198,7 @@ public int getMinimumInteger() {
*
* @return the minimum number in this range
*/
@Override
public double getMinimumDouble() {
return min;
}
@ -206,6 +210,7 @@ public double getMinimumDouble() {
*
* @return the minimum number in this range
*/
@Override
public float getMinimumFloat() {
return min;
}
@ -215,6 +220,7 @@ public float getMinimumFloat() {
*
* @return the maximum number in this range
*/
@Override
public Number getMaximumNumber() {
if (maxObject == null) {
maxObject = new Long(max);
@ -227,6 +233,7 @@ public Number getMaximumNumber() {
*
* @return the maximum number in this range
*/
@Override
public long getMaximumLong() {
return max;
}
@ -238,6 +245,7 @@ public long getMaximumLong() {
*
* @return the maximum number in this range cast to an <code>int</code>.
*/
@Override
public int getMaximumInteger() {
return (int) max;
}
@ -249,6 +257,7 @@ public int getMaximumInteger() {
*
* @return The maximum number in this range as a <code>double</code>.
*/
@Override
public double getMaximumDouble() {
return max;
}
@ -260,6 +269,7 @@ public double getMaximumDouble() {
*
* @return The maximum number in this range as a <code>float</code>.
*/
@Override
public float getMaximumFloat() {
return max;
}
@ -276,6 +286,7 @@ public float getMaximumFloat() {
* @param number the number to test, may be <code>null</code>
* @return <code>true</code> if the specified number occurs within this range
*/
@Override
public boolean containsNumber(Number number) {
if (number == null) {
return false;
@ -294,6 +305,7 @@ public boolean containsNumber(Number number) {
* @return <code>true</code> if the specified number occurs within this
* range by <code>long</code> comparison
*/
@Override
public boolean containsLong(long value) {
return value >= min && value <= max;
}
@ -311,6 +323,7 @@ public boolean containsLong(long value) {
* @return <code>true</code> if the specified range occurs entirely within this range
* @throws IllegalArgumentException if the range is not of this type
*/
@Override
public boolean containsRange(Range range) {
if (range == null) {
return false;
@ -328,6 +341,7 @@ public boolean containsRange(Range range) {
* @param range the range to test, may be <code>null</code>
* @return <code>true</code> if the specified range overlaps with this range
*/
@Override
public boolean overlapsRange(Range range) {
if (range == null) {
return false;
@ -348,6 +362,7 @@ public boolean overlapsRange(Range range) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -364,6 +379,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
@ -381,6 +397,7 @@ public int hashCode() {
*
* @return the <code>String</code> representation of this range
*/
@Override
public String toString() {
if (toString == null) {
StringBuffer buf = new StringBuffer(32);

View File

@ -140,6 +140,7 @@ public NumberRange(Number num1, Number num2) {
*
* @return the minimum number in this range
*/
@Override
public Number getMinimumNumber() {
return min;
}
@ -149,6 +150,7 @@ public Number getMinimumNumber() {
*
* @return the maximum number in this range
*/
@Override
public Number getMaximumNumber() {
return max;
}
@ -166,6 +168,7 @@ public Number getMaximumNumber() {
* @return <code>true</code> if the specified number occurs within this range
* @throws IllegalArgumentException if the number is of a different type to the range
*/
@Override
public boolean containsNumber(Number number) {
if (number == null) {
return false;
@ -193,6 +196,7 @@ public boolean containsNumber(Number number) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -209,6 +213,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = 17;
@ -226,6 +231,7 @@ public int hashCode() {
*
* @return the <code>String</code> representation of this range
*/
@Override
public String toString() {
if (toString == null) {
StringBuffer buf = new StringBuffer(32);

View File

@ -378,6 +378,7 @@ public boolean overlapsRange(Range range) {
* @param obj the reference object with which to compare
* @return <code>true</code> if this object is equal
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
@ -399,6 +400,7 @@ public boolean equals(Object obj) {
*
* @return a hash code value for this object
*/
@Override
public int hashCode() {
int result = 17;
result = 37 * result + getClass().hashCode();
@ -418,6 +420,7 @@ public int hashCode() {
*
* @return the <code>String</code> representation of this range
*/
@Override
public String toString() {
StringBuffer buf = new StringBuffer(32);
buf.append("Range[");

View File

@ -109,6 +109,7 @@ public int compareTo(Object obj) {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof MutableBoolean) {
return value == ((MutableBoolean) obj).booleanValue();
@ -132,6 +133,7 @@ public Object getValue() {
* @return the integer <code>1231</code> if this object represents <code>true</code>; returns the integer
* <code>1237</code> if this object represents <code>false</code>.
*/
@Override
public int hashCode() {
return value ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode();
}
@ -165,6 +167,7 @@ public void setValue(Object value) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -107,6 +107,7 @@ public void setValue(Object value) {
*
* @return the numeric value represented by this object after conversion to type byte.
*/
@Override
public byte byteValue() {
return value;
}
@ -116,6 +117,7 @@ public byte byteValue() {
*
* @return the numeric value represented by this object after conversion to type int.
*/
@Override
public int intValue() {
return value;
}
@ -125,6 +127,7 @@ public int intValue() {
*
* @return the numeric value represented by this object after conversion to type long.
*/
@Override
public long longValue() {
return value;
}
@ -134,6 +137,7 @@ public long longValue() {
*
* @return the numeric value represented by this object after conversion to type float.
*/
@Override
public float floatValue() {
return value;
}
@ -143,6 +147,7 @@ public float floatValue() {
*
* @return the numeric value represented by this object after conversion to type double.
*/
@Override
public double doubleValue() {
return value;
}
@ -239,6 +244,7 @@ public void subtract(Number operand) {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof MutableByte) {
return value == ((MutableByte) obj).byteValue();
@ -251,6 +257,7 @@ public boolean equals(Object obj) {
*
* @return a suitable hashcode
*/
@Override
public int hashCode() {
return value;
}
@ -274,6 +281,7 @@ public int compareTo(Object obj) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -109,6 +109,7 @@ public void setValue(Object value) {
*
* @return the numeric value represented by this object after conversion to type int.
*/
@Override
public int intValue() {
return (int) value;
}
@ -118,6 +119,7 @@ public int intValue() {
*
* @return the numeric value represented by this object after conversion to type long.
*/
@Override
public long longValue() {
return (long) value;
}
@ -127,6 +129,7 @@ public long longValue() {
*
* @return the numeric value represented by this object after conversion to type float.
*/
@Override
public float floatValue() {
return (float) value;
}
@ -136,6 +139,7 @@ public float floatValue() {
*
* @return the numeric value represented by this object after conversion to type double.
*/
@Override
public double doubleValue() {
return value;
}
@ -271,6 +275,7 @@ public void subtract(Number operand) {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
return (obj instanceof MutableDouble)
&& (Double.doubleToLongBits(((MutableDouble) obj).value) == Double.doubleToLongBits(value));
@ -281,6 +286,7 @@ public boolean equals(Object obj) {
*
* @return a suitable hashcode
*/
@Override
public int hashCode() {
long bits = Double.doubleToLongBits(value);
return (int) (bits ^ (bits >>> 32));
@ -305,6 +311,7 @@ public int compareTo(Object obj) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -181,6 +181,7 @@ public void subtract(Number operand) {
*
* @return the numeric value represented by this object after conversion to type int.
*/
@Override
public int intValue() {
return (int) value;
}
@ -190,6 +191,7 @@ public int intValue() {
*
* @return the numeric value represented by this object after conversion to type long.
*/
@Override
public long longValue() {
return (long) value;
}
@ -199,6 +201,7 @@ public long longValue() {
*
* @return the numeric value represented by this object after conversion to type float.
*/
@Override
public float floatValue() {
return value;
}
@ -208,6 +211,7 @@ public float floatValue() {
*
* @return the numeric value represented by this object after conversion to type double.
*/
@Override
public double doubleValue() {
return value;
}
@ -273,6 +277,7 @@ public Float toFloat() {
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
* @see java.lang.Float#floatToIntBits(float)
*/
@Override
public boolean equals(Object obj) {
return (obj instanceof MutableFloat)
&& (Float.floatToIntBits(((MutableFloat) obj).value) == Float.floatToIntBits(value));
@ -284,6 +289,7 @@ public boolean equals(Object obj) {
*
* @return a suitable hashcode
*/
@Override
public int hashCode() {
return Float.floatToIntBits(value);
}
@ -306,6 +312,7 @@ public int compareTo(Object obj) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -179,6 +179,7 @@ public void subtract(Number operand) {
*
* @return the numeric value represented by this object after conversion to type int.
*/
@Override
public int intValue() {
return value;
}
@ -188,6 +189,7 @@ public int intValue() {
*
* @return the numeric value represented by this object after conversion to type long.
*/
@Override
public long longValue() {
return value;
}
@ -197,6 +199,7 @@ public long longValue() {
*
* @return the numeric value represented by this object after conversion to type float.
*/
@Override
public float floatValue() {
return value;
}
@ -206,6 +209,7 @@ public float floatValue() {
*
* @return the numeric value represented by this object after conversion to type double.
*/
@Override
public double doubleValue() {
return value;
}
@ -230,6 +234,7 @@ public Integer toInteger() {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof MutableInt) {
return value == ((MutableInt) obj).intValue();
@ -242,6 +247,7 @@ public boolean equals(Object obj) {
*
* @return a suitable hashcode
*/
@Override
public int hashCode() {
return value;
}
@ -265,6 +271,7 @@ public int compareTo(Object obj) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -179,6 +179,7 @@ public void subtract(Number operand) {
*
* @return the numeric value represented by this object after conversion to type int.
*/
@Override
public int intValue() {
return (int) value;
}
@ -188,6 +189,7 @@ public int intValue() {
*
* @return the numeric value represented by this object after conversion to type long.
*/
@Override
public long longValue() {
return value;
}
@ -197,6 +199,7 @@ public long longValue() {
*
* @return the numeric value represented by this object after conversion to type float.
*/
@Override
public float floatValue() {
return value;
}
@ -206,6 +209,7 @@ public float floatValue() {
*
* @return the numeric value represented by this object after conversion to type double.
*/
@Override
public double doubleValue() {
return value;
}
@ -230,6 +234,7 @@ public Long toLong() {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof MutableLong) {
return value == ((MutableLong) obj).longValue();
@ -242,6 +247,7 @@ public boolean equals(Object obj) {
*
* @return a suitable hashcode
*/
@Override
public int hashCode() {
return (int) (value ^ (value >>> 32));
}
@ -265,6 +271,7 @@ public int compareTo(Object obj) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -85,6 +85,7 @@ public void setValue(Object value) {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof MutableObject) {
Object other = ((MutableObject) obj).value;
@ -98,6 +99,7 @@ public boolean equals(Object obj) {
*
* @return the value's hash code or <code>0</code> if the value is <code>null</code>.
*/
@Override
public int hashCode() {
return value == null ? 0 : value.hashCode();
}
@ -107,6 +109,7 @@ public int hashCode() {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return value == null ? "null" : value.toString();
}

View File

@ -179,6 +179,7 @@ public void subtract(Number operand) {
*
* @return the numeric value represented by this object after conversion to type short.
*/
@Override
public short shortValue() {
return value;
}
@ -188,6 +189,7 @@ public short shortValue() {
*
* @return the numeric value represented by this object after conversion to type int.
*/
@Override
public int intValue() {
return value;
}
@ -197,6 +199,7 @@ public int intValue() {
*
* @return the numeric value represented by this object after conversion to type long.
*/
@Override
public long longValue() {
return value;
}
@ -206,6 +209,7 @@ public long longValue() {
*
* @return the numeric value represented by this object after conversion to type float.
*/
@Override
public float floatValue() {
return value;
}
@ -215,6 +219,7 @@ public float floatValue() {
*
* @return the numeric value represented by this object after conversion to type double.
*/
@Override
public double doubleValue() {
return value;
}
@ -239,6 +244,7 @@ public Short toShort() {
* the object to compare with.
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof MutableShort) {
return value == ((MutableShort) obj).shortValue();
@ -251,6 +257,7 @@ public boolean equals(Object obj) {
*
* @return a suitable hashcode
*/
@Override
public int hashCode() {
return value;
}
@ -274,6 +281,7 @@ public int compareTo(Object obj) {
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}

View File

@ -64,6 +64,7 @@ public CompositeFormat(Format parser, Format formatter) {
* @return <code>toAppendTo</code>
* @see Format#format(Object, StringBuffer, FieldPosition)
*/
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo,
FieldPosition pos) {
return formatter.format(obj, toAppendTo, pos);
@ -79,6 +80,7 @@ public StringBuffer format(Object obj, StringBuffer toAppendTo,
* @return the parsed Object
* @see Format#parseObject(String, ParsePosition)
*/
@Override
public Object parseObject(String source, ParsePosition pos) {
return parser.parseObject(source, pos);
}

View File

@ -130,6 +130,7 @@ public ExtendedMessageFormat(String pattern, Locale locale, Map registry) {
/**
* {@inheritDoc}
*/
@Override
public String toPattern() {
return toPattern;
}
@ -139,6 +140,7 @@ public String toPattern() {
*
* @param pattern String
*/
@Override
public final void applyPattern(String pattern) {
if (registry == null) {
super.applyPattern(pattern);
@ -209,6 +211,7 @@ public final void applyPattern(String pattern) {
* {@inheritDoc}
* @throws UnsupportedOperationException
*/
@Override
public void setFormat(int formatElementIndex, Format newFormat) {
throw new UnsupportedOperationException();
}
@ -217,6 +220,7 @@ public void setFormat(int formatElementIndex, Format newFormat) {
* {@inheritDoc}
* @throws UnsupportedOperationException
*/
@Override
public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
throw new UnsupportedOperationException();
}
@ -225,6 +229,7 @@ public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
* {@inheritDoc}
* @throws UnsupportedOperationException
*/
@Override
public void setFormats(Format[] newFormats) {
throw new UnsupportedOperationException();
}
@ -233,6 +238,7 @@ public void setFormats(Format[] newFormats) {
* {@inheritDoc}
* @throws UnsupportedOperationException
*/
@Override
public void setFormatsByArgumentIndex(Format[] newFormats) {
throw new UnsupportedOperationException();
}

View File

@ -2480,6 +2480,7 @@ public boolean equals(StrBuilder other) {
* @param obj the object to check, null returns false
* @return true if the builders contain the same characters in the same order
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof StrBuilder) {
return equals((StrBuilder) obj);
@ -2492,6 +2493,7 @@ public boolean equals(Object obj) {
*
* @return a hash code
*/
@Override
public int hashCode() {
char buf[] = buffer;
int hash = 0;
@ -2511,6 +2513,7 @@ public int hashCode() {
*
* @return the builder as a String
*/
@Override
public String toString() {
return new String(buffer, 0, size);
}
@ -2572,6 +2575,7 @@ class StrBuilderTokenizer extends StrTokenizer {
}
/** {@inheritDoc} */
@Override
protected List tokenize(char[] chars, int offset, int count) {
if (chars == null) {
return super.tokenize(StrBuilder.this.buffer, 0, StrBuilder.this.size());
@ -2581,6 +2585,7 @@ protected List tokenize(char[] chars, int offset, int count) {
}
/** {@inheritDoc} */
@Override
public String getContent() {
String str = super.getContent();
if (str == null) {
@ -2607,11 +2612,13 @@ class StrBuilderReader extends Reader {
}
/** {@inheritDoc} */
@Override
public void close() {
// do nothing
}
/** {@inheritDoc} */
@Override
public int read() {
if (ready() == false) {
return -1;
@ -2620,6 +2627,7 @@ public int read() {
}
/** {@inheritDoc} */
@Override
public int read(char b[], int off, int len) {
if (off < 0 || len < 0 || off > b.length ||
(off + len) > b.length || (off + len) < 0) {
@ -2640,6 +2648,7 @@ public int read(char b[], int off, int len) {
}
/** {@inheritDoc} */
@Override
public long skip(long n) {
if (pos + n > StrBuilder.this.size()) {
n = StrBuilder.this.size() - pos;
@ -2652,21 +2661,25 @@ public long skip(long n) {
}
/** {@inheritDoc} */
@Override
public boolean ready() {
return pos < StrBuilder.this.size();
}
/** {@inheritDoc} */
@Override
public boolean markSupported() {
return true;
}
/** {@inheritDoc} */
@Override
public void mark(int readAheadLimit) {
mark = pos;
}
/** {@inheritDoc} */
@Override
public void reset() {
pos = mark;
}
@ -2684,36 +2697,43 @@ class StrBuilderWriter extends Writer {
}
/** {@inheritDoc} */
@Override
public void close() {
// do nothing
}
/** {@inheritDoc} */
@Override
public void flush() {
// do nothing
}
/** {@inheritDoc} */
@Override
public void write(int c) {
StrBuilder.this.append((char) c);
}
/** {@inheritDoc} */
@Override
public void write(char[] cbuf) {
StrBuilder.this.append(cbuf);
}
/** {@inheritDoc} */
@Override
public void write(char[] cbuf, int off, int len) {
StrBuilder.this.append(cbuf, off, len);
}
/** {@inheritDoc} */
@Override
public void write(String str) {
StrBuilder.this.append(str);
}
/** {@inheritDoc} */
@Override
public void write(String str, int off, int len) {
StrBuilder.this.append(str, off, len);
}

View File

@ -147,6 +147,7 @@ static class MapStrLookup extends StrLookup {
* @param key the key to be looked up, may be null
* @return the matching value, null if no match
*/
@Override
public String lookup(String key) {
if (map == null) {
return null;

View File

@ -295,6 +295,7 @@ static final class CharSetMatcher extends StrMatcher {
* @param bufferEnd the end index of the active buffer, valid for buffer
* @return the number of matching characters, zero for no match
*/
@Override
public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) {
return Arrays.binarySearch(chars, buffer[pos]) >= 0 ? 1 : 0;
}
@ -327,6 +328,7 @@ static final class CharMatcher extends StrMatcher {
* @param bufferEnd the end index of the active buffer, valid for buffer
* @return the number of matching characters, zero for no match
*/
@Override
public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) {
return ch == buffer[pos] ? 1 : 0;
}
@ -359,6 +361,7 @@ static final class StringMatcher extends StrMatcher {
* @param bufferEnd the end index of the active buffer, valid for buffer
* @return the number of matching characters, zero for no match
*/
@Override
public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) {
int len = chars.length;
if (pos + len > bufferEnd) {
@ -395,6 +398,7 @@ static final class NoMatcher extends StrMatcher {
* @param bufferEnd the end index of the active buffer, valid for buffer
* @return the number of matching characters, zero for no match
*/
@Override
public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) {
return 0;
}
@ -422,6 +426,7 @@ static final class TrimMatcher extends StrMatcher {
* @param bufferEnd the end index of the active buffer, valid for buffer
* @return the number of matching characters, zero for no match
*/
@Override
public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) {
return buffer[pos] <= 32 ? 1 : 0;
}

View File

@ -1083,6 +1083,7 @@ public String getContent() {
*
* @return a new instance of this Tokenizer which has been reset.
*/
@Override
public Object clone() {
try {
return cloneReset();
@ -1114,6 +1115,7 @@ Object cloneReset() throws CloneNotSupportedException {
*
* @return the string content being parsed
*/
@Override
public String toString() {
if (tokens == null) {
return "StrTokenizer[not tokenized yet]";

View File

@ -621,6 +621,7 @@ Object getValue() {
* @param obj2 Object to consider equality of
* @return boolean <code>true</code> if equal
*/
@Override
public boolean equals(Object obj2) {
if (obj2 instanceof Token) {
Token tok2 = (Token) obj2;
@ -648,6 +649,7 @@ public boolean equals(Object obj2) {
*
* @return The hashcode for the token
*/
@Override
public int hashCode() {
return this.value.hashCode();
}
@ -657,6 +659,7 @@ public int hashCode() {
*
* @return String representation of the token
*/
@Override
public String toString() {
return StringUtils.repeat(this.value.toString(), this.count);
}

View File

@ -784,6 +784,7 @@ protected NumberRule selectNumberRule(int field, int padding) {
* @param pos the position - ignored
* @return the buffer passed in
*/
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
if (obj instanceof Date) {
return format((Date) obj, toAppendTo);
@ -899,6 +900,7 @@ protected StringBuffer applyRules(Calendar calendar, StringBuffer buf) {
* @param pos the parsing position
* @return <code>null</code> as not supported
*/
@Override
public Object parseObject(String source, ParsePosition pos) {
pos.setIndex(0);
pos.setErrorIndex(0);
@ -971,6 +973,7 @@ public int getMaxLengthEstimate() {
* @param obj the object to compare to
* @return <code>true</code> if equal
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof FastDateFormat == false) {
return false;
@ -993,6 +996,7 @@ public boolean equals(Object obj) {
*
* @return a hashcode compatible with equals
*/
@Override
public int hashCode() {
int total = 0;
total += mPattern.hashCode();
@ -1008,6 +1012,7 @@ public int hashCode() {
*
* @return a debugging string
*/
@Override
public String toString() {
return "FastDateFormat[" + mPattern + "]";
}
@ -1663,6 +1668,7 @@ private static class TimeZoneDisplayKey {
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return mStyle * 31 + mLocale.hashCode();
}
@ -1670,6 +1676,7 @@ public int hashCode() {
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@ -1709,6 +1716,7 @@ public Pair(Object obj1, Object obj2) {
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@ -1730,6 +1738,7 @@ public boolean equals(Object obj) {
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return
(mObj1 == null ? 0 : mObj1.hashCode()) +
@ -1739,6 +1748,7 @@ public int hashCode() {
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return "[" + mObj1 + ':' + mObj2 + ']';
}

View File

@ -357,6 +357,7 @@ public long getStartTime() {
*
* @return the time as a String
*/
@Override
public String toString() {
return DurationFormatUtils.formatDurationHMS(getTime());
}

View File

@ -57,10 +57,12 @@ public static Test suite() {
return suite;
}
@Override
protected void setUp() throws Exception {
super.setUp();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
@ -197,9 +199,11 @@ public Object getValue() {
public Object setValue(Object value) {
throw new UnsupportedOperationException();
}
@Override
public boolean equals(Object o) {
throw new UnsupportedOperationException();
}
@Override
public int hashCode() {
throw new UnsupportedOperationException();
}

View File

@ -41,6 +41,7 @@ public class StrBuilderAppendInsertTest extends TestCase {
/** Test subclass of Object, with a toString method. */
private static Object FOO = new Object() {
@Override
public String toString() {
return "foo";
}
@ -486,10 +487,12 @@ public void testAppendln_Object() {
public void testAppendln_String() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(String str) {
count[0]++;
return super.append(str);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -505,10 +508,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_String_int_int() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(String str, int startIndex, int length) {
count[0]++;
return super.append(str, startIndex, length);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -524,10 +529,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_StringBuffer() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(StringBuffer str) {
count[0]++;
return super.append(str);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -543,10 +550,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_StringBuffer_int_int() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(StringBuffer str, int startIndex, int length) {
count[0]++;
return super.append(str, startIndex, length);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -562,10 +571,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_StrBuilder() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(StrBuilder str) {
count[0]++;
return super.append(str);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -581,10 +592,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_StrBuilder_int_int() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(StrBuilder str, int startIndex, int length) {
count[0]++;
return super.append(str, startIndex, length);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -600,10 +613,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_CharArray() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(char[] str) {
count[0]++;
return super.append(str);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();
@ -619,10 +634,12 @@ public StrBuilder appendNewLine() {
public void testAppendln_CharArray_int_int() {
final int[] count = new int[2];
StrBuilder sb = new StrBuilder() {
@Override
public StrBuilder append(char[] str, int startIndex, int length) {
count[0]++;
return super.append(str, startIndex, length);
}
@Override
public StrBuilder appendNewLine() {
count[1]++;
return super.appendNewLine();