summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/esodata/ThresholdSet.java
diff options
context:
space:
mode:
authorBen Culkin <scorpress@gmail.com>2020-04-14 16:43:40 -0400
committerBen Culkin <scorpress@gmail.com>2020-04-14 16:43:40 -0400
commite525a21d91879bc2026f5932e894c428b146d36c (patch)
treee4234419722ac302a0a93e0ad2ad36bd7ea2e5ca /src/main/java/bjc/esodata/ThresholdSet.java
parentf51f6da7319787348c38b875652b5c0e9f88c8aa (diff)
Cleanup some warnings and stuff
Diffstat (limited to 'src/main/java/bjc/esodata/ThresholdSet.java')
-rw-r--r--src/main/java/bjc/esodata/ThresholdSet.java10
1 files changed, 7 insertions, 3 deletions
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) {