Skip to content

Commit

Permalink
Fix Javadoc errors reported by Javadoc lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cboehme committed Jan 9, 2017
1 parent b472d4c commit c8f6c1f
Show file tree
Hide file tree
Showing 47 changed files with 203 additions and 180 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@
<configuration>
<show>public</show>
<nohelp>true</nohelp>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* <li>multipart resource record level.
* </ul>
* This information is emitted as an entity named
* &quot;{@value Marc21EventNames#LEADER_ENTITY}&quot. It is emitted directly
* &quot;{@value Marc21EventNames#LEADER_ENTITY}&quot;. It is emitted directly
* after the <i>start-record</i> event. The entity contains the following
* literals:
* <ol>
Expand Down
47 changes: 31 additions & 16 deletions src/main/java/org/culturegraph/mf/commons/Require.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ private Require() {
* Throws an {@link IllegalArgumentException} if {@code object} is
* {@literal null}.
*
* @return {@code object}
* @param <T> type of the object passed as parameter
* @param object reference to be checked
* @return the {@code object}
*/
public static <T> T notNull(final T object) {
return notNull(object, "parameter must not be null");
Expand All @@ -41,9 +43,10 @@ public static <T> T notNull(final T object) {
* Throws an {@link IllegalArgumentException} if {@code object} is
* {@literal null}.
*
* @param message
* exception message
* @return {@code object}
* @param <T> type of the object passed as parameter
* @param object reference to be checked
* @param message exception message
* @return the {@code object}
*/
public static <T> T notNull(final T object, final String message) {
if (object == null) {
Expand All @@ -55,7 +58,8 @@ public static <T> T notNull(final T object, final String message) {
/**
* Throws an {@link IllegalArgumentException} if {@code value} is negative.
*
* @return {@code value}
* @param value the value to be checked
* @return the {@code value}
*/
public static int notNegative(final int value) {
return notNegative(value, "parameter must not be negative");
Expand All @@ -64,9 +68,9 @@ public static int notNegative(final int value) {
/**
* Throws an {@link IllegalArgumentException} if {@code value} is negative.
*
* @param message
* exception message
* @return {@code value}
* @param value the value to be checked
* @param message exception message
* @return the {@code value}
*/
public static int notNegative(final int value, final String message) {
if (value < 0) {
Expand All @@ -77,6 +81,8 @@ public static int notNegative(final int value, final String message) {

/**
* Throws an {@link IllegalArgumentException} if {@code condition} is false.
*
* @param condition the condition to be checked
*/
public static void that(final boolean condition) {
that(condition, "parameter is not valid");
Expand All @@ -85,8 +91,8 @@ public static void that(final boolean condition) {
/**
* Throws an {@link IllegalArgumentException} if {@code condition} is false.
*
* @param message
* exception message
* @param condition the condition to be checked
* @param message exception message
*/
public static void that(final boolean condition, final String message) {
if (!condition) {
Expand All @@ -98,7 +104,9 @@ public static void that(final boolean condition, final String message) {
* Throws an {@link IndexOutOfBoundsException} if {@code index} is negative
* or equal to or greater than {@code arrayLength}.
*
* @return {@code index}
* @param index the index value to be checked
* @param arrayLength the upper bound against which {@code index} is checked
* @return the {@code index}
*/
public static int validArrayIndex(final int index, final int arrayLength) {
return validArrayIndex(index, arrayLength, "array index out of range");
Expand All @@ -108,9 +116,10 @@ public static int validArrayIndex(final int index, final int arrayLength) {
* Throws an {@link IndexOutOfBoundsException} if {@code index} is negative
* or equal to or greater than {@code arrayLength}.
*
* @param message
* exception message
* @return {@code index}
* @param index the index value to be checked
* @param arrayLength the upper bound against which {@code index} is checked
* @param message exception message
* @return the {@code index}
*/
public static int validArrayIndex(final int index, final int arrayLength,
final String message) {
Expand All @@ -125,6 +134,10 @@ public static int validArrayIndex(final int index, final int arrayLength,
* {@code sliceLength} is negative or the sum of both is greater than
* {@code arrayLength}. Note that this means that a slice of length zero
* starting at array length is a valid slice.
*
* @param sliceFrom the start index of the slice to be checked
* @param sliceLength the length of the slice to be checked
* @param arrayLength the upper bound against which the slice is checked
*/
public static void validArraySlice(final int sliceFrom,
final int sliceLength, final int arrayLength) {
Expand All @@ -139,8 +152,10 @@ public static void validArraySlice(final int sliceFrom,
* starting at array length is a valid slice.
*
*
* @param message
* exception message
* @param sliceFrom the start index of the slice to be checked
* @param sliceLength the length of the slice to be checked
* @param arrayLength the upper bound against which the slice is checked
* @param message exception message
*/
public static void validArraySlice(final int sliceFrom,
final int sliceLength, final int arrayLength, final String message) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/culturegraph/mf/commons/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static String format(final String format, final String varStartIndicator,
* Copies the contents of {@code str} into the {@code currentBuffer}. If the size of
* the buffer is not sufficient to store the string then a new buffer is allocated.
* {@code copyToBuffer} is intended to be used as shown in the example:
* <pre>
* <pre>{@code
* final int INITIAL_SIZE = 10;
* char[] myBuffer = new char[INITIAL_SIZE];
*
Expand All @@ -112,7 +112,7 @@ public static String format(final String format, final String varStartIndicator,
* // Process data in myBuffer in the range from 0 to dataLen
* }
* myBuffer = null;
* </pre>
* }</pre>
*
* This allows the buffer to be reused but at the same time frees the user from
* having to manage the size of the buffer.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/culturegraph/mf/commons/XmlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@


/**
* @author Christoph Böhme <[email protected]>
* Utility functions for working with XML data as strings.
*
* @author Christoph Böhme
*/
public final class XmlUtil {

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/culturegraph/mf/commons/tries/ACNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@


/**
* @author Markus Michael Geipel
* Node representing a character in a trie.
*
* @param <P>
* @param <P> type of the value associated with this node in the trie.
* @author Markus Michael Geipel
*/
final class ACNode<P> {

Expand Down
19 changes: 9 additions & 10 deletions src/main/java/org/culturegraph/mf/commons/tries/CharMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
import java.util.Set;

/**
* A {@link Map} with char as key. Used for set matching, tries etc. <br>
* <strong>Important:</strong> It is optimized for size in memory. No extra information for fast entry/keySet/values iteration etc. is held.
* A {@link Map} with char as key. Used for set matching, tries etc.
*
* @author Markus Michael Geipel
* <strong>Important:</strong> It is optimized for size in memory. No extra
* information for fast entry/keySet/values iteration etc. is held.
*
* @param <V>
* @param <V> type of the values in the map
* @author Markus Michael Geipel
*/
final class CharMap<V> implements Map<Character, V> {

Expand Down Expand Up @@ -88,11 +89,6 @@ public V put(final Character key, final V value) {
return null;
}

/**
* @param key
* @param value
* @return the parameter value
*/
public void put(final char key, final V value) {
if (size > LOAD_FACTOR * table.length) {
expand();
Expand Down Expand Up @@ -190,8 +186,9 @@ public Set<java.util.Map.Entry<Character, V>> entrySet() {
}

/**
* Entry in the map.
*
* @param <V>
* @param <V> type of the value of the entry.
*/
private static final class Entry<V> implements Map.Entry<Character, V> {
private final char key;
Expand Down Expand Up @@ -236,5 +233,7 @@ public V setValue(final V value) {
public String toString() {
return key + "=" + value;
}

}

}
18 changes: 10 additions & 8 deletions src/main/java/org/culturegraph/mf/commons/tries/SetMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
import java.util.Queue;

/**
* Implementation of the Aho-Corasick algorithm
* Implementation of the Aho-Corasick algorithm.
*
* @param <T> type of stored value
* @author Markus Michael Geipel
*
* @param <T>
* type of value stored
*/
public final class SetMatcher<T> {
private final ACNode<T> root = new ACNode<T>(null, 0);
private final ACNode<T> root = new ACNode<>(null, 0);
private boolean isPrepared;

public void put(final String key, final T value) {
Expand Down Expand Up @@ -129,9 +127,10 @@ private void prepare() {
}

/**
* prints dot description of the automaton to out for visualization in GraphViz. Used for debugging and education.
* Prints dot description of the automaton to out for visualization in
* GraphViz. Used for debugging and education.
*
* @param out
* @param out the stream t which the description is written
*/
public void printAutomaton(final PrintStream out) {
out.println("digraph ahocorasick {");
Expand All @@ -156,8 +155,9 @@ private void printDebug(final PrintStream out, final ACNode<T> node) {
}

/**
* Describes a match.
*
* @param <T>
* @param <T> type of the stored value
*/
public static final class Match<T> {
private final T value;
Expand Down Expand Up @@ -187,5 +187,7 @@ public int getLength() {
public String toString() {
return value + " " + start + "+" + length;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public SimpleRegexTrie() {
* Enables the use of simple character classes like 'a[agt][ac]'. Calls the
* method of {@link WildcardTrie} for further treatment.
*
* @param keys
* @param value
* @param keys pattern of keys
* @param value value to associate with the key pattern
*/
public void put(final String keys, final P value) {
if (keys.matches(".*" + SIMPLE_CHARACTER_CLASS + ".*")) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/culturegraph/mf/commons/tries/SimpleTrie.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
package org.culturegraph.mf.commons.tries;

/**
* A simple Trie, nothing fancy at all
* A simple Trie, nothing fancy at all.
*
* @author Markus Michael Geipel
* @param <P> type of value stored
* @author Markus Michael Geipel
*/
public final class SimpleTrie<P> {
private final Node<P> root = new Node<P>(null);
private final Node<P> root = new Node<>(null);

public void put(final String key, final P value){

Expand Down Expand Up @@ -58,8 +57,9 @@ public P get(final String key){
}

/**
* Node in the trie.
*
* @param <P>
* @param <P> type of the value associated with this node.
*/
private static final class Node<P> {
private final P value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
/**
* A simple Trie, which accepts a trailing wildcard
*
* @param <P> type of value stored
* @author Markus Michael Geipel
* @author Pascal Christoph
*
* @param <P>
* type of value stored
*/
public final class WildcardTrie<P> {
public static final char STAR_WILDCARD = '*';
Expand All @@ -44,11 +42,11 @@ public final class WildcardTrie<P> {
private Set<Node<P>> nextNodes = new HashSet<Node<P>>();

/**
* inserts keys into the try. Use '|' to concatenate. Use '*' (0,inf) and
* Inserts keys into the try. Use '|' to concatenate. Use '*' (0,inf) and
* '?' (1,1) to express wildcards.
*
* @param keys
* @param value
* @param keys pattern of keys to register
* @param value value to associate with the key pattern.
*/
public void put(final String keys, final P value) {
if (keys.contains(OR_STRING)) {
Expand Down Expand Up @@ -126,8 +124,9 @@ public List<P> get(final String key) {
}

/**
* Node in the trie.
*
* @param <T>
* @param <T> type of the value associated with this node.
*/
private final class Node<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
package org.culturegraph.mf.commons.types;

import java.util.HashMap;
import java.util.Map;

/**
* @author "Markus Michael Geipel"
* Implementation of {@link Map} that delegates to another map if it does not
* contain a value for key.
*
* @param <K>
* @param <V>
* @param <K> type of the keys
* @param <V> type of the values
* @author Markus Michael Geipel
*/
public final class ScopedHashMap<K, V> extends HashMap<K, V> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
import org.slf4j.LoggerFactory;

/**
* creates a new thread in which subsequent flow elements run.
* Creates a new thread in which subsequent flow elements run.
*
* @param <T>
* Object type
* @param <T> Object type
*
* @author Markus Micheal Geipel
*/
Expand Down Expand Up @@ -114,7 +113,8 @@ public void closeStream() {

/**
* Pushes the content in the {@link BlockingQueue} to the receiver.
* @param <T>
*
* @param <T> the type of objects the {@link ObjectPipeDecoupler} works on
*/
static final class Feeder<T> implements Runnable {
public static final Object RED_PILL = new Object();
Expand Down
Loading

0 comments on commit c8f6c1f

Please sign in to comment.