diff --git a/jlib-container.iml b/jlib-container.iml
index cd475b98..46c7aaac 100644
--- a/jlib-container.iml
+++ b/jlib-container.iml
@@ -19,7 +19,7 @@
-
+
diff --git a/pom.xml b/pom.xml
index 47602136..90970288 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,8 +21,8 @@
limitations under the License.
-->
-
4.0.0
diff --git a/src/main/java/org/jlib/container/Container.java b/src/main/java/org/jlib/container/Container.java
index 78ec9636..dcb89efd 100644
--- a/src/main/java/org/jlib/container/Container.java
+++ b/src/main/java/org/jlib/container/Container.java
@@ -31,14 +31,14 @@
import org.jlib.container.operation.ToSet;
public interface Container-
-extends Iterable
- ,
- ContainsSingle
- ,
- ContainsMultiple
- ,
- Count
- ,
- IsEmpty
- ,
- ToArray
- ,
- ToRandomAccessList
- ,
- ToSequentialList
- ,
- ToSet
- {
+ extends Iterable
- ,
+ ContainsSingle
- ,
+ ContainsMultiple
- ,
+ Count
- ,
+ IsEmpty
- ,
+ ToArray
- ,
+ ToRandomAccessList
- ,
+ ToSequentialList
- ,
+ ToSet
- {
// unifying
}
diff --git a/src/main/java/org/jlib/container/iterator/IterableUtility.java b/src/main/java/org/jlib/container/iterator/IterableUtility.java
index 77f87536..7077e1f7 100644
--- a/src/main/java/org/jlib/container/iterator/IterableUtility.java
+++ b/src/main/java/org/jlib/container/iterator/IterableUtility.java
@@ -28,7 +28,6 @@
import org.jlib.iterator.RemoveIterable;
import org.jlib.iterator.RemoveIterator;
import org.jlib.iterator.SingletonIterable;
-
import org.jlib.operator.observer.Observer;
/**
@@ -38,6 +37,8 @@
*/
public final class IterableUtility {
+ private IterableUtility() {}
+
/**
* Removes all Items of the specified {@link RemoveIterable}.
*
@@ -51,7 +52,7 @@ public final class IterableUtility {
* if an error occurs during one of the remove operations
*/
public static
- void removeAll(final RemoveIterable
- iterable)
- throws InvalidIterableStateException {
+ throws InvalidIterableStateException {
for (final RemoveIterator
- iterator = iterable.iterator(); iterator.hasNext(); ) {
iterator.next();
iterator.remove();
@@ -77,7 +78,7 @@ public static
- void removeAll(final RemoveIterable
- iterable)
@SafeVarargs
public static
- void removeAll(final ObservedRemoveIterable
- iterable,
final Observer
- ... observers)
- throws InvalidIterableStateException {
+ throws InvalidIterableStateException {
for (final ObservedRemoveIterator
- iterator = iterable.iterator(); iterator.hasNext(); ) {
iterator.next();
iterator.remove(observers);
@@ -87,6 +88,4 @@ public static
- void removeAll(final ObservedRemoveIterable
- iterable,
public static
- BidiIterable
- singletonIterable(final Item item) {
return new SingletonIterable<>(item);
}
-
- private IterableUtility() {}
}
diff --git a/src/main/java/org/jlib/container/iterator/NoItemToReplaceException.java b/src/main/java/org/jlib/container/iterator/NoItemToReplaceException.java
index f652ff55..7e45996a 100644
--- a/src/main/java/org/jlib/container/iterator/NoItemToReplaceException.java
+++ b/src/main/java/org/jlib/container/iterator/NoItemToReplaceException.java
@@ -32,7 +32,7 @@
* @author Igor Akkerman
*/
public class NoItemToReplaceException
-extends InvalidIteratorStateException {
+ extends InvalidIteratorStateException {
private static final long serialVersionUID = - 1299720624484946758L;
diff --git a/src/main/java/org/jlib/container/iterator/ObservedRemoveIterable.java b/src/main/java/org/jlib/container/iterator/ObservedRemoveIterable.java
index d3c59053..32536184 100644
--- a/src/main/java/org/jlib/container/iterator/ObservedRemoveIterable.java
+++ b/src/main/java/org/jlib/container/iterator/ObservedRemoveIterable.java
@@ -32,7 +32,7 @@
* @author Igor Akkerman
*/
public interface ObservedRemoveIterable
-
-extends RemoveIterable
- {
+ extends RemoveIterable
- {
/**
* Returns a new {@link ObservedRemoveIterator} over the Items of this {@link ObservedRemoveIterable}.
diff --git a/src/main/java/org/jlib/container/iterator/ObservedRemoveIterator.java b/src/main/java/org/jlib/container/iterator/ObservedRemoveIterator.java
index 5ced7d3f..f381963d 100644
--- a/src/main/java/org/jlib/container/iterator/ObservedRemoveIterator.java
+++ b/src/main/java/org/jlib/container/iterator/ObservedRemoveIterator.java
@@ -24,7 +24,6 @@
import org.jlib.iterator.InvalidIterableStateException;
import org.jlib.iterator.NoItemToRemoveException;
import org.jlib.iterator.RemoveIterator;
-
import org.jlib.operator.observer.Observer;
import org.jlib.operator.observer.ObserverException;
@@ -38,7 +37,7 @@
* @author Igor Akkerman
*/
public interface ObservedRemoveIterator
-
-extends RemoveIterator
- {
+ extends RemoveIterator
- {
/**
* Removes the last traversed Item.
@@ -62,7 +61,7 @@ public interface ObservedRemoveIterator
-
*/
@SuppressWarnings({ "unchecked", "DuplicateThrows" })
void remove(Observer
- ... observers)
- throws NoItemToRemoveException, InvalidIterableStateException, ObserverException, RuntimeException;
+ throws NoItemToRemoveException, InvalidIterableStateException, ObserverException, RuntimeException;
/**
* Registers the specified {@link Observer} for the remove operations
diff --git a/src/main/java/org/jlib/container/iterator/ObservedReplaceIterable.java b/src/main/java/org/jlib/container/iterator/ObservedReplaceIterable.java
index a1ece5d1..51f4d3c1 100644
--- a/src/main/java/org/jlib/container/iterator/ObservedReplaceIterable.java
+++ b/src/main/java/org/jlib/container/iterator/ObservedReplaceIterable.java
@@ -30,7 +30,7 @@
* @author Igor Akkerman
*/
public interface ObservedReplaceIterable
-
-extends ReplaceIterable
- {
+ extends ReplaceIterable
- {
/**
* Returns a new {@link ObservedReplaceIterator} over the Items of this {@link ObservedReplaceIterable}.
diff --git a/src/main/java/org/jlib/container/iterator/ObservedReplaceIterator.java b/src/main/java/org/jlib/container/iterator/ObservedReplaceIterator.java
index 7c53147b..de9a32f2 100644
--- a/src/main/java/org/jlib/container/iterator/ObservedReplaceIterator.java
+++ b/src/main/java/org/jlib/container/iterator/ObservedReplaceIterator.java
@@ -34,7 +34,7 @@
* @author Igor Akkerman
*/
public interface ObservedReplaceIterator
-
-extends ReplaceIterator
- {
+ extends ReplaceIterator
- {
/**
* Replaces the last traversed Item with the specified value.
@@ -54,7 +54,7 @@ public interface ObservedReplaceIterator
-
*/
@SuppressWarnings("unchecked")
void replace(Item newItem, Observer
- ... observers)
- throws NoItemToReplaceException, ObserverException;
+ throws NoItemToReplaceException, ObserverException;
/**
* Registers the specified {@link Observer} for the replace operations
diff --git a/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterable.java b/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterable.java
index f09d7703..f486fb70 100644
--- a/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterable.java
+++ b/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterable.java
@@ -30,9 +30,9 @@
* @author Igor Akkerman
*/
public interface ObservedReplaceRemoveIterable
-
-extends ReplaceRemoveIterator
- ,
- ObservedReplaceIterator
- ,
- ObservedRemoveIterator
- {
+ extends ReplaceRemoveIterator
- ,
+ ObservedReplaceIterator
- ,
+ ObservedRemoveIterator
- {
ObservedReplaceRemoveIterator
- iterator();
}
diff --git a/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterator.java b/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterator.java
index db554f02..364da861 100644
--- a/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterator.java
+++ b/src/main/java/org/jlib/container/iterator/ObservedReplaceRemoveIterator.java
@@ -30,8 +30,8 @@
* @author Igor Akkerman
*/
public interface ObservedReplaceRemoveIterator
-
-extends ReplaceRemoveIterator
- ,
- ObservedReplaceIterator
- ,
- ObservedRemoveIterator
- {
+ extends ReplaceRemoveIterator
- ,
+ ObservedReplaceIterator
- ,
+ ObservedRemoveIterator
- {
// unifying interface
}
diff --git a/src/main/java/org/jlib/container/iterator/ReplaceIterable.java b/src/main/java/org/jlib/container/iterator/ReplaceIterable.java
index 23a05cd8..97efdea3 100644
--- a/src/main/java/org/jlib/container/iterator/ReplaceIterable.java
+++ b/src/main/java/org/jlib/container/iterator/ReplaceIterable.java
@@ -30,7 +30,7 @@
* @author Igor Akkerman
*/
public interface ReplaceIterable
-
-extends Iterable
- {
+ extends Iterable
- {
/**
* Returns a new {@link ReplaceIterator} over the Items of this {@link ReplaceIterable}.
diff --git a/src/main/java/org/jlib/container/iterator/ReplaceIterator.java b/src/main/java/org/jlib/container/iterator/ReplaceIterator.java
index 6911f7e5..079e7b02 100644
--- a/src/main/java/org/jlib/container/iterator/ReplaceIterator.java
+++ b/src/main/java/org/jlib/container/iterator/ReplaceIterator.java
@@ -34,7 +34,7 @@
* @author Igor Akkerman
*/
public interface ReplaceIterator
-
-extends Iterator
- {
+ extends Iterator
- {
/**
* Replaces the last traversed Item with the specified Item.
@@ -46,5 +46,5 @@ public interface ReplaceIterator
-
* if no Item has been traversed by this {@link ReplaceIterator}
*/
void replace(Item newItem)
- throws InvalidIteratorStateException;
+ throws InvalidIteratorStateException;
}
diff --git a/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterable.java b/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterable.java
index 548e57ab..aa17d10e 100644
--- a/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterable.java
+++ b/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterable.java
@@ -32,8 +32,8 @@
* @author Igor Akkerman
*/
public interface ReplaceRemoveIterable
-
-extends ReplaceIterable
- ,
- RemoveIterable
- {
+ extends ReplaceIterable
- ,
+ RemoveIterable
- {
/**
* Returns a new {@link ReplaceRemoveIterator} over the Items of this {@link ReplaceRemoveIterable}.
diff --git a/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterator.java b/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterator.java
index ef4ed454..84fe9832 100644
--- a/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterator.java
+++ b/src/main/java/org/jlib/container/iterator/ReplaceRemoveIterator.java
@@ -32,7 +32,7 @@
* @author Igor Akkerman
*/
public interface ReplaceRemoveIterator
-
-extends ReplaceIterator
- ,
- RemoveIterator
- {
+ extends ReplaceIterator
- ,
+ RemoveIterator
- {
// unifying interface
}
diff --git a/src/main/java/org/jlib/container/operation/AlmightyContainer.java b/src/main/java/org/jlib/container/operation/AlmightyContainer.java
index 562457ab..8f2e7de5 100644
--- a/src/main/java/org/jlib/container/operation/AlmightyContainer.java
+++ b/src/main/java/org/jlib/container/operation/AlmightyContainer.java
@@ -22,21 +22,21 @@
package org.jlib.container.operation;
public interface AlmightyContainer
-
-extends ContainsSingle
- ,
- ContainsMultiple
- ,
- Count
- ,
- IsEmpty
- ,
- ObservedRemoveMultiple
- ,
- ObservedRemoveAll
- ,
- ObservedRetain
- ,
- RemoveSingleByValue
- ,
- RemoveMultipleByValue
- ,
- RemoveAll
- ,
- Retain
- ,
- ToArray
- ,
- ToRandomAccessList
- ,
- ToSequentialList
- ,
- ToSet
- ,
- Iterable
- {
+ extends ContainsSingle
- ,
+ ContainsMultiple
- ,
+ Count
- ,
+ IsEmpty
- ,
+ ObservedRemoveMultiple
- ,
+ ObservedRemoveAll
- ,
+ ObservedRetain
- ,
+ RemoveSingleByValue
- ,
+ RemoveMultipleByValue
- ,
+ RemoveAll
- ,
+ Retain
- ,
+ ToArray
- ,
+ ToRandomAccessList
- ,
+ ToSequentialList
- ,
+ ToSet
- ,
+ Iterable
- {
// unifying
}
diff --git a/src/main/java/org/jlib/container/operation/BaseFunctionsIterableHashCode.java b/src/main/java/org/jlib/container/operation/BaseFunctionsIterableHashCode.java
index 96173efc..a5411ef8 100644
--- a/src/main/java/org/jlib/container/operation/BaseFunctionsIterableHashCode.java
+++ b/src/main/java/org/jlib/container/operation/BaseFunctionsIterableHashCode.java
@@ -26,17 +26,17 @@
import org.jlib.basefunctions.HashCodeEngine;
public class BaseFunctionsIterableHashCode
-
-implements HashCode> {
+ implements HashCode> {
private static final BaseFunctionsIterableHashCode> INSTANCE = new BaseFunctionsIterableHashCode<>();
+ private BaseFunctionsIterableHashCode() {}
+
@SuppressWarnings("unchecked")
public static
- BaseFunctionsIterableHashCode
- getInstance() {
return (BaseFunctionsIterableHashCode
- ) INSTANCE;
}
- private BaseFunctionsIterableHashCode() {}
-
@Override
public int hashCode(final Iterable
- items) {
final HashCodeEngine> hashCodeEngine = /*
diff --git a/src/main/java/org/jlib/container/operation/ContainsMultiple.java b/src/main/java/org/jlib/container/operation/ContainsMultiple.java
index bbc5a026..4426446e 100644
--- a/src/main/java/org/jlib/container/operation/ContainsMultiple.java
+++ b/src/main/java/org/jlib/container/operation/ContainsMultiple.java
@@ -41,5 +41,5 @@ public interface ContainsMultiple
- {
*/
& ContainsSingle
- > /*
*/ boolean contains(ContainsIterable items)
- throws InvalidContainerArgumentException, InvalidContainerStateException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/ContainsSingle.java b/src/main/java/org/jlib/container/operation/ContainsSingle.java
index d4cef964..408163c9 100644
--- a/src/main/java/org/jlib/container/operation/ContainsSingle.java
+++ b/src/main/java/org/jlib/container/operation/ContainsSingle.java
@@ -24,5 +24,5 @@
public interface ContainsSingle
- {
boolean contains(Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/Count.java b/src/main/java/org/jlib/container/operation/Count.java
index ffb8c637..4d1954e8 100644
--- a/src/main/java/org/jlib/container/operation/Count.java
+++ b/src/main/java/org/jlib/container/operation/Count.java
@@ -21,8 +21,7 @@
package org.jlib.container.operation;
-public interface Count
-
- {
+public interface Count
- {
/**
* Returns the number of Items in this {@link Object}.
@@ -33,5 +32,5 @@ public interface Count
-
* if an error occurs during the operation
*/
int count()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/CountIterableToArray.java b/src/main/java/org/jlib/container/operation/CountIterableToArray.java
index db49cb00..d0759663 100644
--- a/src/main/java/org/jlib/container/operation/CountIterableToArray.java
+++ b/src/main/java/org/jlib/container/operation/CountIterableToArray.java
@@ -24,8 +24,8 @@
import org.jlib.basefunctions.ApplicationObject;
public final class CountIterableToArray
- & Iterable
- >
-extends ApplicationObject
-implements ToArray
- {
+ extends ApplicationObject
+ implements ToArray
- {
private final DelegateContainer delegateIterable;
diff --git a/src/main/java/org/jlib/container/operation/DefaultContainsMultiple.java b/src/main/java/org/jlib/container/operation/DefaultContainsMultiple.java
index 7c3d2db7..a70a8af1 100644
--- a/src/main/java/org/jlib/container/operation/DefaultContainsMultiple.java
+++ b/src/main/java/org/jlib/container/operation/DefaultContainsMultiple.java
@@ -22,7 +22,7 @@
package org.jlib.container.operation;
public class DefaultContainsMultiple
-
-implements ContainsMultiple
- {
+ implements ContainsMultiple
- {
private final ContainsSingle
- containedItems;
@@ -34,7 +34,7 @@ public DefaultContainsMultiple(final ContainsSingle
- containedItems) {
@Override
public & ContainsSingle
- > /*
*/ boolean contains(final ContainsIterable lookupItems)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
for (final Item lookupItem : lookupItems)
if (! containedItems.contains(lookupItem))
diff --git a/src/main/java/org/jlib/container/operation/DefaultRemoveMultipleByMultiple.java b/src/main/java/org/jlib/container/operation/DefaultRemoveMultipleByMultiple.java
index 8701a1f0..39238b82 100644
--- a/src/main/java/org/jlib/container/operation/DefaultRemoveMultipleByMultiple.java
+++ b/src/main/java/org/jlib/container/operation/DefaultRemoveMultipleByMultiple.java
@@ -22,7 +22,7 @@
package org.jlib.container.operation;
public class DefaultRemoveMultipleByMultiple
-
-implements RemoveMultipleByValue
- {
+ implements RemoveMultipleByValue
- {
private final Iterable
- containedItems;
@@ -38,7 +38,7 @@ public class DefaultRemoveMultipleByMultiple
-
@Override
public & ContainsSingle
- > /*
*/ void remove(final ContainsIterable removedItems)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
for (final Item containedItem : containedItems)
if (removedItems.contains(containedItem))
diff --git a/src/main/java/org/jlib/container/operation/DefaultRetain.java b/src/main/java/org/jlib/container/operation/DefaultRetain.java
index b611ef49..255fa201 100644
--- a/src/main/java/org/jlib/container/operation/DefaultRetain.java
+++ b/src/main/java/org/jlib/container/operation/DefaultRetain.java
@@ -24,7 +24,7 @@
import org.jlib.container.operation.containsadapter.IterativeContainsAdapter;
public class DefaultRetain
-
-implements Retain
- {
+ implements Retain
- {
private final RemoveSingleByValue
- removableContainedItems;
@@ -40,7 +40,7 @@ public class DefaultRetain
-
@Override
@SuppressWarnings("TypeMayBeWeakened")
public void retain(final IterativeContainsAdapter
- retainedItems)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
for (final Item containedItem : containedItems)
if (! retainedItems.contains(containedItem))
diff --git a/src/main/java/org/jlib/container/operation/EqualCount.java b/src/main/java/org/jlib/container/operation/EqualCount.java
index 0d39b3ca..fee4c002 100644
--- a/src/main/java/org/jlib/container/operation/EqualCount.java
+++ b/src/main/java/org/jlib/container/operation/EqualCount.java
@@ -27,13 +27,13 @@ public class EqualCount
- {
private static final EqualCount> INSTANCE = new EqualCount<>();
+ private EqualCount() {}
+
@SuppressWarnings("unchecked")
public static
- EqualCount
- getInstance() {
return (EqualCount
- ) INSTANCE;
}
- private EqualCount() {}
-
public boolean haveEqualCount(final Count
- thisObject, @Nullable final Object otherObject) {
return otherObject instanceof Count> && //
thisObject.count() == ((Count>) otherObject).count();
diff --git a/src/main/java/org/jlib/container/operation/ForbiddenCastException.java b/src/main/java/org/jlib/container/operation/ForbiddenCastException.java
index acb4b730..751250ca 100644
--- a/src/main/java/org/jlib/container/operation/ForbiddenCastException.java
+++ b/src/main/java/org/jlib/container/operation/ForbiddenCastException.java
@@ -22,11 +22,10 @@
package org.jlib.container.operation;
import org.jlib.exception.InvalidStateException;
-
-import static org.jlib.message.MessageUtility.message;
+import static org.jlib.message.Messages.message;
public class ForbiddenCastException
-extends InvalidStateException {
+ extends InvalidStateException {
private static final long serialVersionUID = - 2378979200033998213L;
diff --git a/src/main/java/org/jlib/container/operation/ForwardingAlmightyContainer.java b/src/main/java/org/jlib/container/operation/ForwardingAlmightyContainer.java
index 39878eb7..4e9fdf2d 100644
--- a/src/main/java/org/jlib/container/operation/ForwardingAlmightyContainer.java
+++ b/src/main/java/org/jlib/container/operation/ForwardingAlmightyContainer.java
@@ -41,27 +41,27 @@
* @author Igor Akkerman
*/
public class ForwardingAlmightyContainer
-
-extends ApplicationObject
-implements AlmightyContainer
- {
+ extends ApplicationObject
+ implements AlmightyContainer
- {
private final AlmightyContainer
- disabledAlmightyContainer = new AlmightyContainer
- () {
@Override
public & ContainsSingle
- > /*
*/ boolean contains(final ContainsIterable items)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public int count()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public boolean isEmpty()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@@ -74,76 +74,76 @@ public Iterator
- iterator() {
@Override
public final & ContainsSingle
- > /*
*/ void remove(final ContainsIterable items, final Observer
- ... observers)
- throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
throw new ForbiddenCastException(this);
}
@SafeVarargs
@Override
public final void removeAll(final Observer
- ... observers)
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public & ContainsSingle
- > /*
*/ void remove(final ContainsIterable items)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public void removeAll()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public Item[] toArray()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public List
- toRandomAccessList()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public List
- toSequentialList()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public Set
- toSet()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public boolean contains(final Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public void remove(final Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@Override
public void retain(final IterativeContainsAdapter
- items)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
@SafeVarargs
@Override
public final void retain(final Iterable
- items, final Observer
- ... observers)
- throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
throw new ForbiddenCastException(this);
}
};
@@ -182,57 +182,57 @@ public final void retain(final Iterable
- items, final Observer
- ... obs
@Override
public void removeAll()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
delegateRemoveAll.removeAll();
}
@Override
@SuppressWarnings("unchecked")
public void removeAll(final Observer
- ... observers)
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
delegateObservedRemoveAll.removeAll(observers);
}
@Override
public boolean isEmpty()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateIsEmpty.isEmpty();
}
@Override
public Set
- toSet()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateToSet.toSet();
}
@Override
public List
- toSequentialList()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateToSequentialList.toSequentialList();
}
@Override
public Item[] toArray()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateToArray.toArray();
}
@Override
public int count()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateCount.count();
}
@Override
public List
- toRandomAccessList()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateToRandomAccessList.toRandomAccessList();
}
@Override
public & ContainsSingle
- > /*
*/ boolean contains(final ContainsIterable items)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
return delegateContainsMultiple.contains(items);
}
@@ -240,27 +240,27 @@ public List
- toRandomAccessList()
@SuppressWarnings({ "unchecked", "DuplicateThrows" })
public & ContainsSingle
- > /*
*/ void remove(final ContainsIterable items, final Observer
- ... observers)
- throws ItemToRemoveNotContainedException, InvalidContainerArgumentException, InvalidContainerStateException,
- ObserverException {
+ throws ItemToRemoveNotContainedException, InvalidContainerArgumentException, InvalidContainerStateException,
+ ObserverException {
delegateObservedRemoveMultiple.remove(items, observers);
}
@Override
public & ContainsSingle
- > /*
*/ void remove(final ContainsIterable items)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
delegateRemoveMultipleByValue.remove(items);
}
@Override
public void remove(final Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
delegateRemoveSingleByValue.remove(item);
}
@Override
public boolean contains(final Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
return delegateContainsSingle.contains(item);
}
@@ -335,14 +335,14 @@ public void setDelegateContainsSingle(final ContainsSingle
- delegateContain
@Override
public void retain(final IterativeContainsAdapter
- items)
- throws InvalidContainerArgumentException, InvalidContainerStateException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException {
delegateRetain.retain(items);
}
@SafeVarargs
@Override
public final void retain(final Iterable
- items, final Observer
- ... observers)
- throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
+ throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
delegateObservedRetain.retain(items, observers);
}
}
diff --git a/src/main/java/org/jlib/container/operation/FromIteratorIsEmpty.java b/src/main/java/org/jlib/container/operation/FromIteratorIsEmpty.java
index 393ae68e..f77d3ae8 100644
--- a/src/main/java/org/jlib/container/operation/FromIteratorIsEmpty.java
+++ b/src/main/java/org/jlib/container/operation/FromIteratorIsEmpty.java
@@ -24,7 +24,7 @@
import org.jlib.iterator.IterableUtility;
public class FromIteratorIsEmpty
-
-implements IsEmpty
- {
+ implements IsEmpty
- {
private final Iterable
- iterable;
@@ -35,7 +35,7 @@ public FromIteratorIsEmpty(final Iterable
- iterable) {
@Override
public boolean isEmpty()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return IterableUtility.isEmpty(iterable);
}
}
diff --git a/src/main/java/org/jlib/container/operation/InvalidContainerArgumentException.java b/src/main/java/org/jlib/container/operation/InvalidContainerArgumentException.java
index 81f68a94..0e7441a6 100644
--- a/src/main/java/org/jlib/container/operation/InvalidContainerArgumentException.java
+++ b/src/main/java/org/jlib/container/operation/InvalidContainerArgumentException.java
@@ -23,11 +23,10 @@
import org.jlib.exception.InvalidArgumentException;
import org.jlib.message.Message;
-
-import static org.jlib.message.MessageUtility.message;
+import static org.jlib.message.Messages.message;
public abstract class InvalidContainerArgumentException
-extends InvalidArgumentException {
+ extends InvalidArgumentException {
private static final long serialVersionUID = - 6765111335075525788L;
diff --git a/src/main/java/org/jlib/container/operation/InvalidContainerStateException.java b/src/main/java/org/jlib/container/operation/InvalidContainerStateException.java
index 2c39ac03..46110356 100644
--- a/src/main/java/org/jlib/container/operation/InvalidContainerStateException.java
+++ b/src/main/java/org/jlib/container/operation/InvalidContainerStateException.java
@@ -23,11 +23,10 @@
import org.jlib.exception.InvalidStateException;
import org.jlib.message.Message;
-
-import static org.jlib.message.MessageUtility.message;
+import static org.jlib.message.Messages.message;
public abstract class InvalidContainerStateException
-extends InvalidStateException {
+ extends InvalidStateException {
private static final long serialVersionUID = - 6765111335075525788L;
diff --git a/src/main/java/org/jlib/container/operation/IsEmpty.java b/src/main/java/org/jlib/container/operation/IsEmpty.java
index 1ff9c5cf..5bce1d8a 100644
--- a/src/main/java/org/jlib/container/operation/IsEmpty.java
+++ b/src/main/java/org/jlib/container/operation/IsEmpty.java
@@ -33,5 +33,5 @@ public interface IsEmpty
- {
* if an error occurs during the operation
*/
boolean isEmpty()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/IsEmptyFromItemsCount.java b/src/main/java/org/jlib/container/operation/IsEmptyFromItemsCount.java
index f22bf423..1af83622 100644
--- a/src/main/java/org/jlib/container/operation/IsEmptyFromItemsCount.java
+++ b/src/main/java/org/jlib/container/operation/IsEmptyFromItemsCount.java
@@ -22,7 +22,7 @@
package org.jlib.container.operation;
public class IsEmptyFromItemsCount
-
-implements IsEmpty
- {
+ implements IsEmpty
- {
private final Count
- delegateContainer;
@@ -32,7 +32,7 @@ public IsEmptyFromItemsCount(final Count
- count) {
@Override
public boolean isEmpty()
- throws InvalidContainerStateException {
+ throws InvalidContainerStateException {
return delegateContainer.count() == 0;
}
}
diff --git a/src/main/java/org/jlib/container/operation/ItemAlreadyContainedException.java b/src/main/java/org/jlib/container/operation/ItemAlreadyContainedException.java
index e3dc9a5b..ef3790bc 100644
--- a/src/main/java/org/jlib/container/operation/ItemAlreadyContainedException.java
+++ b/src/main/java/org/jlib/container/operation/ItemAlreadyContainedException.java
@@ -21,8 +21,7 @@
package org.jlib.container.operation;
-
-import static org.jlib.message.MessageUtility.message;
+import static org.jlib.message.Messages.message;
/**
* {@link InvalidContainerArgumentException} thrown when trying to invalidly add
@@ -31,7 +30,7 @@
* @author Igor Akkerman
*/
public class ItemAlreadyContainedException
-extends InvalidContainerArgumentException {
+ extends InvalidContainerArgumentException {
private static final long serialVersionUID = 1090527595338576596L;
diff --git a/src/main/java/org/jlib/container/operation/ItemToRemoveNotContainedException.java b/src/main/java/org/jlib/container/operation/ItemToRemoveNotContainedException.java
index 5fe923ab..33906e2f 100644
--- a/src/main/java/org/jlib/container/operation/ItemToRemoveNotContainedException.java
+++ b/src/main/java/org/jlib/container/operation/ItemToRemoveNotContainedException.java
@@ -21,7 +21,7 @@
package org.jlib.container.operation;
-import static org.jlib.message.MessageUtility.message;
+import static org.jlib.message.Messages.message;
/**
* {@link InvalidContainerArgumentException} thrown when a {@link RemoveSingleByValue} does not contain
@@ -30,7 +30,7 @@
* @author Igor Akkerman
*/
public class ItemToRemoveNotContainedException
-extends InvalidContainerArgumentException {
+ extends InvalidContainerArgumentException {
private static final long serialVersionUID = - 2921569537644842654L;
@@ -44,13 +44,13 @@ public class ItemToRemoveNotContainedException
* Item to retain
*/
public ItemToRemoveNotContainedException(
- final RemoveMultipleByValue> container, final Object item) {
+ final RemoveMultipleByValue> container, final Object item) {
super(container, message(item));
}
public ItemToRemoveNotContainedException(
- final RemoveMultipleByValue> container, final Object item,
- final Exception cause) {
+ final RemoveMultipleByValue> container, final Object item,
+ final Exception cause) {
super(container, message(item), cause);
}
}
diff --git a/src/main/java/org/jlib/container/operation/IterableToRandomAccessList.java b/src/main/java/org/jlib/container/operation/IterableToRandomAccessList.java
index c39d9177..28e87bf1 100644
--- a/src/main/java/org/jlib/container/operation/IterableToRandomAccessList.java
+++ b/src/main/java/org/jlib/container/operation/IterableToRandomAccessList.java
@@ -27,8 +27,8 @@
import org.jlib.basefunctions.ApplicationObject;
public class IterableToRandomAccessList
-
-extends ApplicationObject
-implements ToRandomAccessList
- {
+ extends ApplicationObject
+ implements ToRandomAccessList
- {
private static final int DEFAULT_EXPECTED_ITEMS_COUNT = 20;
diff --git a/src/main/java/org/jlib/container/operation/IterativeEquals.java b/src/main/java/org/jlib/container/operation/IterativeEquals.java
index ff6762bf..317ee572 100644
--- a/src/main/java/org/jlib/container/operation/IterativeEquals.java
+++ b/src/main/java/org/jlib/container/operation/IterativeEquals.java
@@ -21,23 +21,22 @@
package org.jlib.container.operation;
-import org.jlib.basefunctions.Equals;
-
import org.checkerframework.checker.nullness.qual.Nullable;
+import org.jlib.basefunctions.Equals;
import static org.jlib.iterator.IterableUtility.provideEqualItems;
public final class IterativeEquals
-
-implements Equals> {
+ implements Equals> {
private static final IterativeEquals> INSTANCE = new IterativeEquals<>();
+ private IterativeEquals() {}
+
@SuppressWarnings("unchecked")
public static
- IterativeEquals
- getInstance() {
return (IterativeEquals
- ) INSTANCE;
}
- private IterativeEquals() {}
-
@Override
@SuppressWarnings("unchecked")
public boolean areEqual(final Iterable
- iterable1, @Nullable final Object iterable2) {
diff --git a/src/main/java/org/jlib/container/operation/ObservedRemoveAll.java b/src/main/java/org/jlib/container/operation/ObservedRemoveAll.java
index 7acba180..7cbe4355 100644
--- a/src/main/java/org/jlib/container/operation/ObservedRemoveAll.java
+++ b/src/main/java/org/jlib/container/operation/ObservedRemoveAll.java
@@ -46,5 +46,5 @@ public interface ObservedRemoveAll
- {
*/
@SuppressWarnings("unchecked")
void removeAll(Observer
- ... observers)
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/ObservedRemoveMultiple.java b/src/main/java/org/jlib/container/operation/ObservedRemoveMultiple.java
index c3fc0bbb..0a8aa826 100644
--- a/src/main/java/org/jlib/container/operation/ObservedRemoveMultiple.java
+++ b/src/main/java/org/jlib/container/operation/ObservedRemoveMultiple.java
@@ -36,7 +36,7 @@ public interface ObservedRemoveMultiple
- {
& ContainsSingle
- > /*
*/ void remove(ContainsIterable items, Observer
- ... observers)
- throws ItemToRemoveNotContainedException, InvalidContainerArgumentException, InvalidContainerStateException,
- ObserverException;
+ throws ItemToRemoveNotContainedException, InvalidContainerArgumentException, InvalidContainerStateException,
+ ObserverException;
}
diff --git a/src/main/java/org/jlib/container/operation/ObservedRetain.java b/src/main/java/org/jlib/container/operation/ObservedRetain.java
index b0650d1e..8c78e05c 100644
--- a/src/main/java/org/jlib/container/operation/ObservedRetain.java
+++ b/src/main/java/org/jlib/container/operation/ObservedRetain.java
@@ -60,5 +60,5 @@ public interface ObservedRetain
- {
*/
@SuppressWarnings("unchecked")
void retain(Iterable
- items, Observer
- ... observers)
- throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException;
}
diff --git a/src/main/java/org/jlib/container/operation/RemoveAll.java b/src/main/java/org/jlib/container/operation/RemoveAll.java
index 40ef32ad..a20b97d7 100644
--- a/src/main/java/org/jlib/container/operation/RemoveAll.java
+++ b/src/main/java/org/jlib/container/operation/RemoveAll.java
@@ -30,5 +30,5 @@ public interface RemoveAll
- {
* if an error occurs during the operation
*/
void removeAll()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/RemoveMultipleByValue.java b/src/main/java/org/jlib/container/operation/RemoveMultipleByValue.java
index efe29577..536d19e0 100644
--- a/src/main/java/org/jlib/container/operation/RemoveMultipleByValue.java
+++ b/src/main/java/org/jlib/container/operation/RemoveMultipleByValue.java
@@ -29,8 +29,7 @@
*
* @author Igor Akkerman
*/
-public interface RemoveMultipleByValue
-
- {
+public interface RemoveMultipleByValue
- {
/**
* Removes all Items from this object for which the specified {@link ContainsSingle}'s
@@ -48,5 +47,5 @@ public interface RemoveMultipleByValue
-
*/
& ContainsSingle
- > /*
*/ void remove(ContainsIterable items)
- throws InvalidContainerArgumentException, InvalidContainerStateException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/RemoveSingleByValue.java b/src/main/java/org/jlib/container/operation/RemoveSingleByValue.java
index c41a9b12..098ee70f 100644
--- a/src/main/java/org/jlib/container/operation/RemoveSingleByValue.java
+++ b/src/main/java/org/jlib/container/operation/RemoveSingleByValue.java
@@ -45,5 +45,5 @@ public interface RemoveSingleByValue
- {
* if an error occurs during the operation
*/
void remove(Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/RemoveSingleFromContainsItemByValue.java b/src/main/java/org/jlib/container/operation/RemoveSingleFromContainsItemByValue.java
index 85c1c94b..4f5c7816 100644
--- a/src/main/java/org/jlib/container/operation/RemoveSingleFromContainsItemByValue.java
+++ b/src/main/java/org/jlib/container/operation/RemoveSingleFromContainsItemByValue.java
@@ -30,8 +30,8 @@
* @author Igor Akkerman
*/
public interface RemoveSingleFromContainsItemByValue
-
-extends RemoveSingleByValue
- ,
- ContainsSingle
- {
+ extends RemoveSingleByValue
- ,
+ ContainsSingle
- {
/**
* Removes all Items from this object for which the specified {@link ContainsSingle}'s
@@ -49,5 +49,5 @@ public interface RemoveSingleFromContainsItemByValue
-
*/
@Override
void remove(Item item)
- throws InvalidContainerArgumentException, InvalidContainerStateException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/Retain.java b/src/main/java/org/jlib/container/operation/Retain.java
index 11b7b73a..cabbc44b 100644
--- a/src/main/java/org/jlib/container/operation/Retain.java
+++ b/src/main/java/org/jlib/container/operation/Retain.java
@@ -45,5 +45,5 @@ public interface Retain
- {
* if an error occurs during the operation
*/
void retain(IterativeContainsAdapter
- items)
- throws InvalidContainerArgumentException, InvalidContainerStateException;
+ throws InvalidContainerArgumentException, InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/SoleItemNotRemoveableException.java b/src/main/java/org/jlib/container/operation/SoleItemNotRemoveableException.java
index 379dd179..e1d4dfa7 100644
--- a/src/main/java/org/jlib/container/operation/SoleItemNotRemoveableException.java
+++ b/src/main/java/org/jlib/container/operation/SoleItemNotRemoveableException.java
@@ -28,7 +28,7 @@
* @author Igor Akkerman
*/
public class SoleItemNotRemoveableException
-extends InvalidContainerStateException {
+ extends InvalidContainerStateException {
private static final long serialVersionUID = - 7467942886021869121L;
diff --git a/src/main/java/org/jlib/container/operation/ToArray.java b/src/main/java/org/jlib/container/operation/ToArray.java
index 19a32783..8716f7b2 100644
--- a/src/main/java/org/jlib/container/operation/ToArray.java
+++ b/src/main/java/org/jlib/container/operation/ToArray.java
@@ -33,5 +33,5 @@ public interface ToArray
- {
* if an error occurs during the operation
*/
Item[] toArray()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/ToRandomAccessList.java b/src/main/java/org/jlib/container/operation/ToRandomAccessList.java
index 618d07fe..1d7298c5 100644
--- a/src/main/java/org/jlib/container/operation/ToRandomAccessList.java
+++ b/src/main/java/org/jlib/container/operation/ToRandomAccessList.java
@@ -38,5 +38,5 @@ public interface ToRandomAccessList
- {
* if an error occurs during the operation
*/
List
- toRandomAccessList()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/ToSequentialList.java b/src/main/java/org/jlib/container/operation/ToSequentialList.java
index 3dd302a1..cc17a283 100644
--- a/src/main/java/org/jlib/container/operation/ToSequentialList.java
+++ b/src/main/java/org/jlib/container/operation/ToSequentialList.java
@@ -36,5 +36,5 @@ public interface ToSequentialList
- {
* if an error occurs during the operation
*/
List
- toSequentialList()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/ToSet.java b/src/main/java/org/jlib/container/operation/ToSet.java
index 6e959011..683304b5 100644
--- a/src/main/java/org/jlib/container/operation/ToSet.java
+++ b/src/main/java/org/jlib/container/operation/ToSet.java
@@ -26,5 +26,5 @@
public interface ToSet
- {
Set
- toSet()
- throws InvalidContainerStateException;
+ throws InvalidContainerStateException;
}
diff --git a/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapter.java b/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapter.java
index 6ce6f152..6fba6fd7 100644
--- a/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapter.java
+++ b/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapter.java
@@ -26,8 +26,8 @@
import org.jlib.container.operation.ContainsSingle;
public abstract class ContainsAdapter
-
-implements Iterable
- ,
- ContainsSingle
- {
+ implements Iterable
- ,
+ ContainsSingle
- {
private final Iterable
- items;
diff --git a/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapterUtility.java b/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapterUtility.java
index b0df8841..122cd2e1 100644
--- a/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapterUtility.java
+++ b/src/main/java/org/jlib/container/operation/containsadapter/ContainsAdapterUtility.java
@@ -23,23 +23,24 @@
import java.util.Collection;
-import org.jlib.array.ArrayUtility;
-
import org.jlib.container.operation.ContainsSingle;
import org.jlib.container.operation.InvalidContainerArgumentException;
import org.jlib.container.operation.InvalidContainerStateException;
+import org.jlib.array.ArrayUtility;
import static org.jlib.container.iterator.IterableUtility.singletonIterable;
public final class ContainsAdapterUtility {
+ private ContainsAdapterUtility() {}
+
public static