Javadoc only.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137992 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2004-10-21 01:18:34 +00:00
parent e65e22fe10
commit bbdd2932db
7 changed files with 55 additions and 10 deletions

View File

@ -32,7 +32,7 @@
* @author Gary Gregory * @author Gary Gregory
* @author Norm Deane * @author Norm Deane
* @since 2.0 * @since 2.0
* @version $Id: ClassUtils.java,v 1.32 2004/10/15 20:57:18 scolebourne Exp $ * @version $Id: ClassUtils.java,v 1.33 2004/10/21 01:18:33 ggregory Exp $
*/ */
public class ClassUtils { public class ClassUtils {
@ -505,6 +505,9 @@ public static boolean isInnerClass(Class cls) {
private static class ClassNameComparator implements Comparator { private static class ClassNameComparator implements Comparator {
/** /**
* Compares two <code>Class</code>s by name. * Compares two <code>Class</code>s by name.
* @param o1 The receiver of the comparison call to {@link String#compareTo(String)}.
* @param o2 The argument of the comparison call to {@link String#compareTo(String)}.
* @return The return value from {@link String#compareTo(String)}
* *
* @throws ClassCastException * @throws ClassCastException
* If <code>o1</code> or <code>o2</code> are not <code>Class</code> * If <code>o1</code> or <code>o2</code> are not <code>Class</code>
@ -536,6 +539,9 @@ private static class PackageNameComparator implements Comparator {
/** /**
* Compares two <code>Package</code>s by name. * Compares two <code>Package</code>s by name.
* *
* @param o1 The receiver of the comparison call to {@link String#compareTo(String)}.
* @param o2 The argument of the comparison call to {@link String#compareTo(String)}.
* @return The return value from {@link String#compareTo(String)}
* @throws ClassCastException * @throws ClassCastException
* If <code>o1</code> or <code>o2</code> are not <code>Package</code> * If <code>o1</code> or <code>o2</code> are not <code>Package</code>
* instances. * instances.

View File

@ -46,7 +46,7 @@
* @author Matthew Hawthorne * @author Matthew Hawthorne
* @author Stephen Colebourne * @author Stephen Colebourne
* @since 2.0 * @since 2.0
* @version $Id: NotImplementedException.java,v 1.9 2004/10/15 20:55:01 scolebourne Exp $ * @version $Id: NotImplementedException.java,v 1.10 2004/10/21 01:18:33 ggregory Exp $
*/ */
public class NotImplementedException public class NotImplementedException
extends UnsupportedOperationException implements Nestable { extends UnsupportedOperationException implements Nestable {
@ -122,6 +122,7 @@ public NotImplementedException(Class clazz) {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/** /**
* Gets the root cause of this exception. * Gets the root cause of this exception.
* @return the root cause of this exception.
* *
* @since 2.1 * @since 2.1
*/ */

View File

@ -42,7 +42,7 @@
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a> * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
* @author Pete Gieser * @author Pete Gieser
* @since 1.0 * @since 1.0
* @version $Id: ExceptionUtils.java,v 1.42 2004/10/09 10:04:04 scolebourne Exp $ * @version $Id: ExceptionUtils.java,v 1.43 2004/10/21 01:18:33 ggregory Exp $
*/ */
public class ExceptionUtils { public class ExceptionUtils {
@ -695,10 +695,15 @@ public static String[] getStackFrames(Throwable throwable) {
} }
/** /**
* <p>Returns an array where each element is a line from the argument.</p>
* <p>The end of line is determined by the value of {@link SystemUtils#LINE_SEPARATOR}.</p>
*
* <p>Functionality shared between the * <p>Functionality shared between the
* <code>getStackFrames(Throwable)</code> methods of this and the * <code>getStackFrames(Throwable)</code> methods of this and the
* {@link org.apache.commons.lang.exception.NestableDelegate} * {@link org.apache.commons.lang.exception.NestableDelegate}
* classes.</p> * classes.</p>
* @param stackTrace A stack trace String.
* @return an array where each element is a line from the argument.
*/ */
static String[] getStackFrames(String stackTrace) { static String[] getStackFrames(String stackTrace) {
String linebreak = SystemUtils.LINE_SEPARATOR; String linebreak = SystemUtils.LINE_SEPARATOR;

View File

@ -24,7 +24,7 @@
* *
* @author Henri Yandell * @author Henri Yandell
* @since 2.0 * @since 2.0
* @version $Id: JVMRandom.java,v 1.10 2004/02/18 22:56:13 ggregory Exp $ * @version $Id: JVMRandom.java,v 1.11 2004/10/21 01:18:33 ggregory Exp $
*/ */
public final class JVMRandom extends Random { public final class JVMRandom extends Random {
@ -42,6 +42,9 @@ public JVMRandom() {
/** /**
* Unsupported in 2.0. * Unsupported in 2.0.
*
* @param seed ignored
* @throws UnsupportedOperationException
*/ */
public synchronized void setSeed(long seed) { public synchronized void setSeed(long seed) {
if (this.constructed) { if (this.constructed) {
@ -51,6 +54,9 @@ public synchronized void setSeed(long seed) {
/** /**
* Unsupported in 2.0. * Unsupported in 2.0.
*
* @return Nothing, this method always throws an UnsupportedOperationException.
* @throws UnsupportedOperationException
*/ */
public synchronized double nextGaussian() { public synchronized double nextGaussian() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
@ -58,6 +64,9 @@ public synchronized double nextGaussian() {
/** /**
* Unsupported in 2.0. * Unsupported in 2.0.
*
* @param byteArray ignored
* @throws UnsupportedOperationException
*/ */
public void nextBytes(byte[] byteArray) { public void nextBytes(byte[] byteArray) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View File

@ -22,7 +22,7 @@
* *
* @author Stephen Colebourne * @author Stephen Colebourne
* @since 2.0 * @since 2.0
* @version $Id: LongRange.java,v 1.7 2004/02/18 22:56:13 ggregory Exp $ * @version $Id: LongRange.java,v 1.8 2004/10/21 01:18:33 ggregory Exp $
*/ */
public final class LongRange extends Range implements Serializable { public final class LongRange extends Range implements Serializable {
@ -240,6 +240,8 @@ public int getMaximumInteger() {
* <p>Gets the maximum number in this range as a <code>double</code>.</p> * <p>Gets the maximum number in this range as a <code>double</code>.</p>
* *
* <p>This conversion can lose information for large values.</p> * <p>This conversion can lose information for large values.</p>
*
* @return The maximum number in this range as a <code>double</code>.
*/ */
public double getMaximumDouble() { public double getMaximumDouble() {
return max; return max;
@ -249,6 +251,8 @@ public double getMaximumDouble() {
* <p>Gets the maximum number in this range as a <code>float</code>.</p> * <p>Gets the maximum number in this range as a <code>float</code>.</p>
* *
* <p>This conversion can lose information for large values.</p> * <p>This conversion can lose information for large values.</p>
*
* @return The maximum number in this range as a <code>float</code>.
*/ */
public float getMaximumFloat() { public float getMaximumFloat() {
return max; return max;

View File

@ -48,12 +48,18 @@ public class MappedMessageFormat {
private ArrayList markers = new ArrayList(2); private ArrayList markers = new ArrayList(2);
private ArrayList sources = new ArrayList(2); private ArrayList sources = new ArrayList(2);
/**
* Constructs a new instance.
*/
public MappedMessageFormat() { public MappedMessageFormat() {
} }
/** /**
* Defines a source of data that can later be substituted into * Defines a source of data that can later be substituted into
* strings passed to the "format" methods. * strings passed to the "format" methods.
*
* @param marker the marker prefix for the syntax "marker{key}", commonly the String <code>"$"</code>.
* @param source A Map where the keys are Strings and the values are non-<code>null</code> Objects.
*/ */
public void addSource(String marker, Map source) { public void addSource(String marker, Map source) {
nEntries++; nEntries++;
@ -65,12 +71,15 @@ public void addSource(String marker, Map source) {
* Expands any variable declarations using any of the known * Expands any variable declarations using any of the known
* variable marker strings. * variable marker strings.
* *
* @param param The String to expand.
* @return The expanded String
*
* @throws IllegalArgumentException if the input param references * @throws IllegalArgumentException if the input param references
* a variable which is not known to the specified source. * a variable which is not known to the specified source.
*/ */
public String format(String param) { public String format(String param) {
for(int i=0; i<nEntries; i++) { for(int i=0; i<nEntries; i++) {
param = format( param, (String) markers.get(i), (Map) sources.get(i)); param = format(param, (String) markers.get(i), (Map) sources.get(i));
} }
return param; return param;
} }
@ -79,14 +88,19 @@ public String format(String param) {
* Replace any occurrences within the string of the form * Replace any occurrences within the string of the form
* "marker{key}" with the value from source[key]. * "marker{key}" with the value from source[key].
* <p> * <p>
* Commonly, the variable marker is "$", in which case variables * Commonly, the variable marker is <code>"$"</code>, in which case variables
* are indicated by ${key} in the string. * are indicated by <code>${key}</code> in the string.
* <p> * <p>
* Returns the string after performing all substitutions. * Returns the string after performing all substitutions.
* <p> * <p>
* If no substitutions were made, the input string object is * If no substitutions were made, the input string object is
* returned (not a copy). * returned (not a copy).
* *
* @param str The String to expand.
* @param marker The variable marker, commonly, <code>"$"</code>, in which case variables
* are indicated by <code>${key}</code> in the string.
* @param source A Map where the keys are Strings and the values are non-<code>null</code> Objects.
* @return The expanded String or, if no substitutions were made, the input String object (not a copy).
* @throws IllegalArgumentException if the input param references * @throws IllegalArgumentException if the input param references
* a variable which is not known to the specified source. * a variable which is not known to the specified source.
*/ */

View File

@ -34,7 +34,7 @@
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a> * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
* @author Phil Steitz * @author Phil Steitz
* @since 2.0 * @since 2.0
* @version $Id: DateUtils.java,v 1.35 2004/10/16 21:06:18 scolebourne Exp $ * @version $Id: DateUtils.java,v 1.36 2004/10/21 01:18:33 ggregory Exp $
*/ */
public class DateUtils { public class DateUtils {
@ -739,6 +739,12 @@ public Object next() {
return spot.clone(); return spot.clone();
} }
/**
* Always throws UnsupportedOperationException.
*
* @throws UnsupportedOperationException
* @see java.util.Iterator#remove()
*/
public void remove() { public void remove() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }