You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jg...@apache.org on 2007/09/26 17:12:08 UTC
svn commit: r579689 - in
/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util:
AsyncHttpClientException.java DateParseException.java LangUtils.java
NameValuePair.java NeedMoreDataException.java package.html
Author: jgenender
Date: Wed Sep 26 08:12:07 2007
New Revision: 579689
URL: http://svn.apache.org/viewvc?rev=579689&view=rev
Log:
More javadoc
Added:
geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/package.html
Modified:
geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/AsyncHttpClientException.java
geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/DateParseException.java
geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/LangUtils.java
geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NameValuePair.java
geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NeedMoreDataException.java
Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/AsyncHttpClientException.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/AsyncHttpClientException.java?rev=579689&r1=579688&r2=579689&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/AsyncHttpClientException.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/AsyncHttpClientException.java Wed Sep 26 08:12:07 2007
@@ -19,19 +19,42 @@
*/
package org.apache.ahc.util;
+/**
+ * The Class AsyncHttpClientException. Generic unchecked exception used with the
+ * AsyncHttpClient API.
+ */
public class AsyncHttpClientException extends Error {
+ /**
+ * Instantiates a new async http client exception.
+ */
public AsyncHttpClientException() {
}
+ /**
+ * Instantiates a new async http client exception.
+ *
+ * @param string the string
+ */
public AsyncHttpClientException(String string) {
super(string);
}
+ /**
+ * Instantiates a new async http client exception.
+ *
+ * @param string the string
+ * @param throwable the throwable
+ */
public AsyncHttpClientException(String string, Throwable throwable) {
super(string, throwable);
}
+ /**
+ * Instantiates a new async http client exception.
+ *
+ * @param throwable the throwable
+ */
public AsyncHttpClientException(Throwable throwable) {
super(throwable);
}
Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/DateParseException.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/DateParseException.java?rev=579689&r1=579688&r2=579689&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/DateParseException.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/DateParseException.java Wed Sep 26 08:12:07 2007
@@ -21,22 +21,23 @@
/**
* An exception to indicate an error parsing a date string.
- *
+ *
* @see DateUtil
- *
* @author Michael Becke
*/
public class DateParseException extends Exception {
/**
- *
+ * Instantiates a new date parse exception.
*/
public DateParseException() {
super();
}
/**
- * @param message the exception message
+ * Instantiates a new date parse exception.
+ *
+ * @param message the message
*/
public DateParseException(String message) {
super(message);
Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/LangUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/LangUtils.java?rev=579689&r1=579688&r2=579689&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/LangUtils.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/LangUtils.java Wed Sep 26 08:12:07 2007
@@ -22,31 +22,68 @@
/**
* A set of utility methods to help produce consistent Object#equals(Object) and
* Object#hashCode methods.
- *
+ *
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
- *
*/
public final class LangUtils {
+ /** The Constant HASH_SEED. */
public static final int HASH_SEED = 17;
+
+ /** The Constant HASH_OFFSET. */
public static final int HASH_OFFSET = 37;
+ /**
+ * Instantiates a new LangUtils object.
+ */
private LangUtils() {
super();
}
+ /**
+ * Hash code.
+ *
+ * @param seed the seed
+ * @param hashcode the hashcode
+ *
+ * @return the calculated hash value
+ */
public static int hashCode(final int seed, final int hashcode) {
return seed * HASH_OFFSET + hashcode;
}
+ /**
+ * Hash code.
+ *
+ * @param seed the seed
+ * @param obj the obj
+ *
+ * @return the calculated hash value
+ */
public static int hashCode(final int seed, final Object obj) {
return hashCode(seed, obj != null ? obj.hashCode() : 0);
}
+ /**
+ * Hash code.
+ *
+ * @param seed the seed
+ * @param b the b
+ *
+ * @return the calculated hash value
+ */
public static int hashCode(final int seed, final boolean b) {
return hashCode(seed, b ? 1 : 0);
}
+ /**
+ * Equals.
+ *
+ * @param obj1 the obj1
+ * @param obj2 the obj2
+ *
+ * @return true, if the objects equal
+ */
public static boolean equals(final Object obj1, final Object obj2) {
return obj1 == null ? obj2 == null : obj1.equals(obj2);
}
Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NameValuePair.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NameValuePair.java?rev=579689&r1=579688&r2=579689&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NameValuePair.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NameValuePair.java Wed Sep 26 08:12:07 2007
@@ -21,15 +21,15 @@
import java.io.Serializable;
+/**
+ * The Class NameValuePair. A wrapper class to represent name/value Strings.
+ */
public class NameValuePair implements Serializable {
- /**
- * Name.
- */
+
+ /** Name. */
private String name;
- /**
- * Value.
- */
+ /** Value. */
private String value;
@@ -42,7 +42,7 @@
/**
* Constructor.
- *
+ *
* @param name The name.
* @param value The value.
*/
@@ -53,9 +53,10 @@
/**
- * Set the name.
- *
+ * Sets the name.
+ *
* @param name The new name
+ *
* @see #getName()
*/
public void setName(String name) {
@@ -64,9 +65,10 @@
/**
- * Return the name.
- *
+ * Returns the name.
+ *
* @return String name The name
+ *
* @see #setName(String)
*/
public String getName() {
@@ -75,8 +77,8 @@
/**
- * Set the value.
- *
+ * Sets the value.
+ *
* @param value The new value.
*/
public void setValue(String value) {
@@ -85,8 +87,8 @@
/**
- * Return the current value.
- *
+ * Returns the current value.
+ *
* @return String value The current value.
*/
public String getValue() {
@@ -97,13 +99,20 @@
/**
* Get a String representation of this pair.
- *
+ *
* @return A string representation.
*/
public String toString() {
return "name=" + name + ", " + "value=" + value;
}
+ /**
+ * Equals.
+ *
+ * @param object to compare with <code>this</code>
+ *
+ * @return true, if the objects equal
+ */
public boolean equals(final Object object) {
if (object == null) {
return false;
@@ -120,6 +129,11 @@
}
}
+ /**
+ * Hash code.
+ *
+ * @return the calculated hash value
+ */
public int hashCode() {
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.name);
Modified: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NeedMoreDataException.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NeedMoreDataException.java?rev=579689&r1=579688&r2=579689&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NeedMoreDataException.java (original)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/NeedMoreDataException.java Wed Sep 26 08:12:07 2007
@@ -19,21 +19,43 @@
package org.apache.ahc.util;
+/**
+ * The Class NeedMoreDataException. Represents an exception if the decoders need more data.
+ */
public class NeedMoreDataException extends Exception {
+ /**
+ * Instantiates a new need more data exception.
+ */
public NeedMoreDataException() {
super();
}
+ /**
+ * Instantiates a new need more data exception.
+ *
+ * @param string the string
+ */
public NeedMoreDataException(String string) {
super(string);
}
+ /**
+ * Instantiates a new need more data exception.
+ *
+ * @param string the string
+ * @param throwable the throwable
+ */
public NeedMoreDataException(String string, Throwable throwable) {
super(string,
throwable);
}
+ /**
+ * Instantiates a new need more data exception.
+ *
+ * @param throwable the throwable
+ */
public NeedMoreDataException(Throwable throwable) {
super(throwable);
}
Added: geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/package.html
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/package.html?rev=579689&view=auto
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/package.html (added)
+++ geronimo/sandbox/AsyncHttpClient/src/main/java/org/apache/ahc/util/package.html Wed Sep 26 08:12:07 2007
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+</head>
+<body bgcolor="white">
+AsynHttpClient utility and support classes.
+</body>
+</html>