summaryrefslogtreecommitdiff
path: root/src/main/java/bjc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/bjc')
-rw-r--r--src/main/java/bjc/esodata/Multimap.java2
-rw-r--r--src/main/java/bjc/esodata/Stack.java10
-rw-r--r--src/main/java/bjc/esodata/ThresholdSet.java10
3 files changed, 14 insertions, 8 deletions
diff --git a/src/main/java/bjc/esodata/Multimap.java b/src/main/java/bjc/esodata/Multimap.java
index f0876db..a79f1b0 100644
--- a/src/main/java/bjc/esodata/Multimap.java
+++ b/src/main/java/bjc/esodata/Multimap.java
@@ -11,6 +11,8 @@ import java.util.*;
* have to remove that pair as many times as you added it.
*
* @author Ben Culkin
+ * @param <KeyType> The type of keys in the map.
+ * @param <ValueType> The type of values in the map.
*/
public class Multimap<KeyType, ValueType> {
private Map<KeyType, ThresholdSet<ValueType>> backing;
diff --git a/src/main/java/bjc/esodata/Stack.java b/src/main/java/bjc/esodata/Stack.java
index f2e00e3..5ee5ef2 100644
--- a/src/main/java/bjc/esodata/Stack.java
+++ b/src/main/java/bjc/esodata/Stack.java
@@ -95,7 +95,7 @@ public abstract class Stack<T> {
* @param elms
* The elements to insert.
*/
- public void pushAll(T... elms) {
+ public void pushAll(@SuppressWarnings("unchecked") T... elms) {
for (T elm : elms) {
push(elm);
}
@@ -436,7 +436,7 @@ public abstract class Stack<T> {
* @param actions
* The actions to execute.
*/
- public void multicleave(final int n, final Consumer<Stack<T>>... actions) {
+ public void multicleave(final int n, @SuppressWarnings("unchecked") final Consumer<Stack<T>>... actions) {
List<T> elms = multipoprev(n);
for (final Consumer<Stack<T>> action : actions) {
@@ -462,7 +462,7 @@ public abstract class Stack<T> {
* @param actions
* The actions to execute.
*/
- public void cleave(final Consumer<Stack<T>>... actions) {
+ public void cleave(@SuppressWarnings("unchecked") final Consumer<Stack<T>>... actions) {
multicleave(1, actions);
}
@@ -501,7 +501,7 @@ public abstract class Stack<T> {
* @param actions
* The actions to execute.
*/
- public void multispread(final int n, final Consumer<Stack<T>>... actions) {
+ public void multispread(final int n, @SuppressWarnings("unchecked") final Consumer<Stack<T>>... actions) {
List<List<T>> nelms = new LinkedList<>();
for (int i = 0; i < actions.length; i++) {
@@ -536,7 +536,7 @@ public abstract class Stack<T> {
* @param conses
* The actions to execute.
*/
- public void spread(final Consumer<Stack<T>>... conses) {
+ public void spread(@SuppressWarnings("unchecked") final Consumer<Stack<T>>... conses) {
multispread(1, conses);
}
diff --git a/src/main/java/bjc/esodata/ThresholdSet.java b/src/main/java/bjc/esodata/ThresholdSet.java
index 50d95d0..ae277e1 100644
--- a/src/main/java/bjc/esodata/ThresholdSet.java
+++ b/src/main/java/bjc/esodata/ThresholdSet.java
@@ -46,6 +46,7 @@ public class ThresholdSet<KeyType> {
@Override
public boolean remove(Object o) {
// Will throw a ClassCastException if you give us something bad.
+ @SuppressWarnings("unchecked")
KeyType k = (KeyType) o;
int ret = ThresholdSet.this.remove(k);
@@ -60,6 +61,7 @@ public class ThresholdSet<KeyType> {
@Override
public boolean contains(Object o) {
// Will throw a ClassCastException if you give us something bad.
+ @SuppressWarnings("unchecked")
KeyType k = (KeyType) o;
int ret = ThresholdSet.this.contains(k);
@@ -107,7 +109,7 @@ public class ThresholdSet<KeyType> {
*
* @return An array containing the results of adding the keys.
*/
- public int[] addKeys(KeyType... keys) {
+ public int[] addKeys(@SuppressWarnings("unchecked") KeyType... keys) {
int[] ret = new int[keys.length];
for (int i = 0; i < keys.length; i++) {
@@ -157,7 +159,7 @@ public class ThresholdSet<KeyType> {
*
* @return The results from removing the keys.
*/
- public int[] removeKeys(KeyType... keys) {
+ public int[] removeKeys(@SuppressWarnings("unchecked") KeyType... keys) {
int[] ret = new int[keys.length];
for (int i = 0; i < keys.length; i++) {
@@ -212,7 +214,7 @@ public class ThresholdSet<KeyType> {
*
* @return The containment counts for each key.
*/
- public int[] containsKeys(KeyType... keys) {
+ public int[] containsKeys(@SuppressWarnings("unchecked") KeyType... keys) {
int[] ret = new int[keys.length];
for (int i = 0; i < keys.length; i++) {
@@ -264,9 +266,11 @@ public class ThresholdSet<KeyType> {
/**
* Static threshold set constructor.
+ * @param <KType> The type of keys for the threshold set.
*
* @param keys
* The initial keys to add to the threshold set.
+ * @return A threshold set with the given keys.
*/
@SafeVarargs
public static <KType> ThresholdSet<KType> TS(KType... keys) {