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/data/Multimap.java15
-rw-r--r--src/main/java/bjc/esodata/ThresholdSet.java13
2 files changed, 24 insertions, 4 deletions
diff --git a/src/main/java/bjc/data/Multimap.java b/src/main/java/bjc/data/Multimap.java
new file mode 100644
index 0000000..3a9ca44
--- /dev/null
+++ b/src/main/java/bjc/data/Multimap.java
@@ -0,0 +1,15 @@
+package bjc.data;
+
+/**
+ * A map with support for multiple values per key.
+ *
+ * @param <KeyType>
+ * The type of the keys for the map.
+ * @param <ValueType>
+ * The type of the values for the map.
+ *
+ * @author Ben Culkin
+ */
+public class Multimap<KeyType, ValueType> {
+
+}
diff --git a/src/main/java/bjc/esodata/ThresholdSet.java b/src/main/java/bjc/esodata/ThresholdSet.java
index 20b4ceb..bc1b517 100644
--- a/src/main/java/bjc/esodata/ThresholdSet.java
+++ b/src/main/java/bjc/esodata/ThresholdSet.java
@@ -28,6 +28,7 @@ public class ThresholdSet<KeyType> {
* the set will contain key after it returns (as a matter of fact, attempting to add the
* component might actually cause it to be removed from the collection).
*/
+ @Override
public boolean add(KeyType key) {
// Qualified-this; allows us to reference the 'this' of our enclosing type.
int ret = ThresholdSet.this.add(key);
@@ -38,6 +39,7 @@ public class ThresholdSet<KeyType> {
return true;
}
+ @Override
public boolean remove(Object o) {
// Will throw a ClassCastException if you give us something bad.
KeyType k = (KeyType)o;
@@ -50,6 +52,7 @@ public class ThresholdSet<KeyType> {
return false;
}
+ @Override
public boolean contains(Object o) {
// Will throw a ClassCastException if you give us something bad.
KeyType k = (KeyType)o;
@@ -62,10 +65,12 @@ public class ThresholdSet<KeyType> {
return false;
}
+ @Override
public int size() {
return ThresholdSet.this.setSize();
}
+ @Override
public Iterator<KeyType> iterator() {
return ThresholdSet.this.setIterator();
}
@@ -93,7 +98,7 @@ public class ThresholdSet<KeyType> {
* The keys to add.
* @return An array containing the results of adding the keys.
*/
- public int[] addAll(KeyType... keys) {
+ public int[] addKeys(KeyType... keys) {
int[] ret = new int[keys.length];
for (int i = 0; i < keys.length; i++) {
@@ -141,7 +146,7 @@ public class ThresholdSet<KeyType> {
*
* @return The results from removing the keys.
*/
- public int[] removeAll(KeyType... keys) {
+ public int[] removeKeys(KeyType... keys) {
int[] ret = new int[keys.length];
for (int i = 0; i < keys.length; i++) {
@@ -162,7 +167,7 @@ public class ThresholdSet<KeyType> {
*/
public int remove(KeyType key) {
if (keySet.contains(key)) {
- // No more occurances
+ // No more occurrences
keySet.remove(key);
return 0;
@@ -196,7 +201,7 @@ public class ThresholdSet<KeyType> {
*
* @return The containment counts for each key.
*/
- public int[] containsAll(KeyType... keys) {
+ public int[] containsKeys(KeyType... keys) {
int[] ret = new int[keys.length];
for (int i = 0; i < keys.length; i++) {