Skip to content

Commit fd46b5f

Browse files
committed
JavaDoc
1 parent 52b940f commit fd46b5f

File tree

9 files changed

+74
-5
lines changed

9 files changed

+74
-5
lines changed

core/src/main/java/org/bouncycastle/util/IPAddress.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* Utility methods for processing String objects containing IP addresses.
5+
*/
36
public class IPAddress
47
{
58
/**

core/src/main/java/org/bouncycastle/util/Integers.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* Utility methods for ints.
5+
*/
36
public class Integers
47
{
58
public static int rotateLeft(int i, int distance)

core/src/main/java/org/bouncycastle/util/Memoable.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* Interface for Memoable objects. Memoable objects allow the taking of a snapshot of their internal state
5+
* via the copy() method and then reseting the object back to that state later using the reset() method.
6+
*/
37
public interface Memoable
48
{
59
/**
@@ -8,7 +12,7 @@ public interface Memoable
812
* The returned object may be used simply to store the state, or may be used as a similar object
913
* starting from the copied state.
1014
*/
11-
public Memoable copy();
15+
Memoable copy();
1216

1317
/**
1418
* Restore a copied object state into this object.
@@ -19,5 +23,5 @@ public interface Memoable
1923
* @throws ClassCastException if the provided object is not of the correct type.
2024
* @throws MemoableResetException if the <b>other</b> parameter is in some other way invalid.
2125
*/
22-
public void reset(Memoable other);
26+
void reset(Memoable other);
2327
}

core/src/main/java/org/bouncycastle/util/Pack.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* Utility methods for converting byte arrays into ints and longs, and back again.
5+
*/
36
public abstract class Pack
47
{
58
public static int bigEndianToInt(byte[] bs, int off)

core/src/main/java/org/bouncycastle/util/Selector.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* Interface a selector from a store should conform to.
5+
*
6+
* @param <T> the type stored in the store.
7+
*/
38
public interface Selector<T>
49
extends Cloneable
510
{
11+
/**
12+
* Match the passed in object, returning true if it would be selected by this selector, false otherwise.
13+
*
14+
* @param obj the object to be matched.
15+
* @return true if the object is a match for this selector, false otherwise.
16+
*/
617
boolean match(T obj);
718

819
Object clone();

core/src/main/java/org/bouncycastle/util/Store.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@
22

33
import java.util.Collection;
44

5+
/**
6+
* A generic interface describing a simple store of objects.
7+
*
8+
* @param <T> the object type stored.
9+
*/
510
public interface Store<T>
611
{
12+
/**
13+
* Return a possibly empty collection of objects that match the criteria implemented
14+
* in the passed in Selector.
15+
*
16+
* @param selector the selector defining the match criteria.
17+
* @return a collection of matching objects, empty if none available.
18+
* @throws StoreException if there is a failure during matching.
19+
*/
720
Collection<T> getMatches(Selector<T> selector)
821
throws StoreException;
922
}

core/src/main/java/org/bouncycastle/util/StoreException.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* Exception thrown if there's an issue doing a match in store.
5+
*/
36
public class StoreException
47
extends RuntimeException
58
{
69
private Throwable _e;
710

8-
public StoreException(String s, Throwable e)
11+
/**
12+
* Basic Constructor.
13+
*
14+
* @param msg message to be associated with this exception.
15+
* @param cause the throwable that caused this exception to be raised.
16+
*/
17+
public StoreException(String msg, Throwable cause)
918
{
10-
super(s);
11-
_e = e;
19+
super(msg);
20+
_e = cause;
1221
}
1322

1423
public Throwable getCause()

core/src/main/java/org/bouncycastle/util/StringList.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
package org.bouncycastle.util;
22

3+
/**
4+
* An interface defining a list of strings.
5+
*/
36
public interface StringList
47
extends Iterable<String>
58
{
9+
/**
10+
* Add a String to the list.
11+
*
12+
* @param s the String to add.
13+
* @return true
14+
*/
615
boolean add(String s);
716

17+
/**
18+
* Get the string at index index.
19+
*
20+
* @param index the index position of the String of interest.
21+
* @return the String at position index.
22+
*/
823
String get(int index);
924

1025
int size();
1126

27+
/**
28+
* Return the contents of the list as an array.
29+
*
30+
* @return an array of String.
31+
*/
1232
String[] toStringArray();
1333

1434
/**

core/src/main/java/org/bouncycastle/util/Strings.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import java.util.ArrayList;
99
import java.util.Vector;
1010

11+
/**
12+
* String utilities.
13+
*/
1114
public final class Strings
1215
{
1316
private static String LINE_SEPARATOR;

0 commit comments

Comments
 (0)