Added Loads of documentation to almost everything
This commit is contained in:
@@ -2,10 +2,23 @@ package speiger.src.collections.PACKAGE.functions;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* Type-Specific Class for Comparator to reduce (un)boxing
|
||||
*/
|
||||
public interface COMPARATOR extends Comparator<CLASS_TYPE>
|
||||
{
|
||||
/**
|
||||
* Type-Specific compare function to reduce (un)boxing
|
||||
* @see Comparator#compare(Object, Object)
|
||||
*/
|
||||
int compare(KEY_TYPE o1, KEY_TYPE o2);
|
||||
|
||||
/** {@inheritDoc}
|
||||
* <p>This default implementation delegates to the corresponding type-specific method.
|
||||
* @deprecated Please use the corresponding type-specific method instead.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
default int compare(CLASS_TYPE o1, CLASS_TYPE o2) {
|
||||
return compare(OBJ_TO_KEY(o1), OBJ_TO_KEY(o2));
|
||||
}
|
||||
|
||||
+39
-9
@@ -8,40 +8,70 @@ import speiger.src.collections.utils.SanityChecks;
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Type-Specific Consumer interface that reduces (un)boxing and allows to merge other consumer types into this interface
|
||||
*/
|
||||
public interface CONSUMER extends Consumer<CLASS_TYPE>, JAVA_CONSUMER
|
||||
#else
|
||||
|
||||
/**
|
||||
* Type-Specific Consumer interface that reduces (un)boxing and allows to merge other consumer types into this interface
|
||||
*/
|
||||
public interface CONSUMER extends Consumer<CLASS_TYPE>
|
||||
#endif
|
||||
{
|
||||
/**
|
||||
* Type-Specific method to reduce (un)boxing.
|
||||
* Performs this operation on the given argument.
|
||||
*
|
||||
* @param t the input argument
|
||||
*/
|
||||
void accept(KEY_TYPE t);
|
||||
|
||||
#if !JDK_CONSUMER
|
||||
|
||||
/** {@inheritDoc}
|
||||
* <p>This default implementation delegates to the corresponding type-specific method.
|
||||
* @deprecated Please use the corresponding type-specific method instead.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
default void accept(JAVA_TYPE t) { accept(SanityChecks.SANITY_CAST(t)); }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
public default CONSUMER andThen(CONSUMER after) {
|
||||
Objects.requireNonNull(after);
|
||||
return T -> {accept(T); after.accept(T);};
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* <p>This default implementation delegates to the corresponding type-specific method.
|
||||
* @deprecated Please use the corresponding type-specific method instead.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
default void accept(CLASS_TYPE t) { accept(OBJ_TO_KEY(t)); }
|
||||
|
||||
@Deprecated
|
||||
/** {@inheritDoc}
|
||||
* <p>This default implementation delegates to the corresponding type-specific method.
|
||||
* @deprecated Please use the corresponding type-specific method instead.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
default CONSUMER andThen(Consumer<? super CLASS_TYPE> after) {
|
||||
Objects.requireNonNull(after);
|
||||
return T -> {accept(T); after.accept(KEY_TO_OBJ(T));};
|
||||
}
|
||||
|
||||
#if PRIMITIVES
|
||||
@Deprecated
|
||||
/** {@inheritDoc}
|
||||
* <p>This default implementation delegates to the corresponding type-specific method.
|
||||
* @deprecated Please use the corresponding type-specific method instead.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
default CONSUMER andThen(JAVA_CONSUMER after) {
|
||||
Objects.requireNonNull(after);
|
||||
return T -> {accept(T); after.accept(T);};
|
||||
}
|
||||
|
||||
#endif
|
||||
default CONSUMER andThen(CONSUMER after) {
|
||||
Objects.requireNonNull(after);
|
||||
return T -> {accept(T); after.accept(T);};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user