From 42f7d379a430aaf2fad169f0170de04072b08b10 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 22 Apr 2016 14:48:04 -0400 Subject: Formatting changes --- .../java/bjc/utils/funcdata/IFunctionalMap.java | 120 ++++++++++----------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/IFunctionalMap.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IFunctionalMap.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IFunctionalMap.java index 0c96a9f..8a54246 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IFunctionalMap.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IFunctionalMap.java @@ -18,21 +18,45 @@ import java.util.function.Function; public interface IFunctionalMap { /** - * Add an entry to the map + * Check if this map contains the specified key * * @param key - * The key to put the value under - * @param val - * The value to add - * @return The previous value of the key in the map, or null if the key - * wasn't in the map. However, note that it may also return - * null if the key was set to null. + * The key to check + * @return Whether or not the map contains the key + */ + boolean containsKey(KeyType key); + + /** + * Extends this map, creating a new map that will delegate queries to + * the map, but store any added values itself * - * @throws UnsupportedOperationException - * if the map implementation doesn't support modifying the - * map + * @return An extended map */ - ValueType put(KeyType key, ValueType val); + IFunctionalMap extend(); + + /** + * Execute an action for each entry in the map + * + * @param action + * the action to execute for each entry in the map + */ + void forEach(BiConsumer action); + + /** + * Perform an action for each key in the map + * + * @param action + * The action to perform on each key in the map + */ + void forEachKey(Consumer action); + + /** + * Perform an action for each value in the map + * + * @param action + * The action to perform on each value in the map + */ + void forEachValue(Consumer action); /** * Get the value assigned to the given key @@ -45,6 +69,20 @@ public interface IFunctionalMap { */ ValueType get(KeyType key); + /** + * Get the number of entries in this map + * + * @return The number of entries in this map + */ + int getSize(); + + /** + * Get a list of all the keys in this map + * + * @return A list of all the keys in this map + */ + IFunctionalList keyList(); + /** * Transform the values returned by this map. * @@ -62,28 +100,21 @@ public interface IFunctionalMap { Function transformer); /** - * Check if this map contains the specified key + * Add an entry to the map * * @param key - * The key to check - * @return Whether or not the map contains the key - */ - boolean containsKey(KeyType key); - - /** - * Get a list of all the keys in this map - * - * @return A list of all the keys in this map - */ - IFunctionalList keyList(); - - /** - * Execute an action for each entry in the map + * The key to put the value under + * @param val + * The value to add + * @return The previous value of the key in the map, or null if the key + * wasn't in the map. However, note that it may also return + * null if the key was set to null. * - * @param action - * the action to execute for each entry in the map + * @throws UnsupportedOperationException + * if the map implementation doesn't support modifying the + * map */ - void forEach(BiConsumer action); + ValueType put(KeyType key, ValueType val); /** * Remove the value bound to the key @@ -97,41 +128,10 @@ public interface IFunctionalMap { */ ValueType remove(KeyType key); - /** - * Get the number of entries in this map - * - * @return The number of entries in this map - */ - int getSize(); - - /** - * Perform an action for each key in the map - * - * @param action - * The action to perform on each key in the map - */ - void forEachKey(Consumer action); - - /** - * Perform an action for each value in the map - * - * @param action - * The action to perform on each value in the map - */ - void forEachValue(Consumer action); - /** * Get a list of the values in this map * * @return A list of values in this map */ IFunctionalList valueList(); - - /** - * Extends this map, creating a new map that will delegate queries to - * the map, but store any added values itself - * - * @return An extended map - */ - IFunctionalMap extend(); } \ No newline at end of file -- cgit v1.2.3