Pair Module is now done.

This commit is contained in:
2022-12-07 04:35:29 +01:00
parent 8d9f7a6761
commit ce9343348e
4 changed files with 278 additions and 91 deletions
@@ -1,7 +1,12 @@
package speiger.src.collections.PACKAGE.misc.pairs;
#if IMMUTABLE_PAIR
import speiger.src.collections.PACKAGE.misc.pairs.impl.IMMUTABLE_PAIR;
#endif
#if MUTABLE_PAIR
import speiger.src.collections.PACKAGE.misc.pairs.impl.MUTABLE_PAIR;
#endif
/**
* Key Value Pair Interface that allows to reduce boxing/unboxing.
* @Type(T)
@@ -9,6 +14,7 @@ import speiger.src.collections.PACKAGE.misc.pairs.impl.MUTABLE_PAIR;
*/
public interface PAIR KEY_VALUE_GENERIC_TYPE
{
#if IMMUTABLE_PAIR
/**
* Empty Reference for Immutable Pairs
*/
@@ -68,6 +74,8 @@ public interface PAIR KEY_VALUE_GENERIC_TYPE
return new IMMUTABLE_PAIRKV_BRACES(pair.ENTRY_KEY(), pair.ENTRY_VALUE());
}
#endif
#if MUTABLE_PAIR
/**
* @Type(T)
* @ValueType(V)
@@ -118,6 +126,7 @@ public interface PAIR KEY_VALUE_GENERIC_TYPE
return new MUTABLE_PAIRKV_BRACES(pair.ENTRY_KEY(), pair.ENTRY_VALUE());
}
#endif
/**
* Sets the Key of the Pair.
* @param key the key that should be set.