Skip to content

Commit

Permalink
Merge branch 'master' of github.com:igorakkerman/jlib
Browse files Browse the repository at this point in the history
  • Loading branch information
igorakkerman committed Feb 11, 2015
2 parents a52d741 + 8d8fb97 commit 9d49ae6
Show file tree
Hide file tree
Showing 42 changed files with 154 additions and 128 deletions.
7 changes: 3 additions & 4 deletions jlib-container.iml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="jlib-core" />
<orderEntry type="module" module-name="jlib-codequality" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:1.8.10" level="project" />
<orderEntry type="module" module-name="jlib-basefunctions" />
<orderEntry type="module" module-name="jlib-operator" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.0" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:1.8.10" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:1.7.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.0.3-beta" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
<orderEntry type="module" module-name="jlib-codequality" />
</component>
</module>
2 changes: 1 addition & 1 deletion src/main/java/org/jlib/container/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.jlib.core.iterator.RemoveIterator;
import org.jlib.core.iterator.SingletonIterable;

import org.jlib.operator.observer.ValueObserver;
import org.jlib.operator.observer.Observer;

/**
* {@link Iterator} utility.
Expand Down Expand Up @@ -68,15 +68,15 @@ public static <Item> void removeAll(final RemoveIterable<Item> iterable)
* type of the items of {@code iterable}
*
* @param observers
* comma separated sequence of {@link ValueObserver} instances
* comma separated sequence of {@link Observer} instances
* attending the removal
*
* @throws InvalidIterableStateException
* if an error occurs during one of the remove operations
*/
@SafeVarargs
public static <Item> void removeAll(final ObservedRemoveIterable<Item> iterable,
final ValueObserver<Item>... observers)
final Observer<Item>... observers)
throws InvalidIterableStateException {
for (final ObservedRemoveIterator<Item> iterator = iterable.iterator(); iterator.hasNext(); ) {
iterator.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import org.jlib.core.iterator.NoItemToRemoveException;
import org.jlib.core.iterator.RemoveIterator;

import org.jlib.operator.observer.ValueObserver;
import org.jlib.operator.observer.ValueObserverException;
import org.jlib.operator.observer.Observer;
import org.jlib.operator.observer.ObserverException;

/**
* {@link RemoveIterator} allowing its remove operation to be attended by
* {@link ValueObserver} instances.
* {@link Observer} instances.
*
* @param <Item>
* type of the traversed items
Expand All @@ -44,7 +44,7 @@ public interface ObservedRemoveIterator<Item>
* Removes the last traversed Item.
*
* @param observers
* comma separated sequence of {@link ValueObserver} instances
* comma separated sequence of {@link Observer} instances
* attending the operation
*
* @throws NoItemToRemoveException
Expand All @@ -53,23 +53,23 @@ public interface ObservedRemoveIterator<Item>
* @throws InvalidIterableStateException
* if an error is caused by a delegate used to remove the Item
*
* @throws ValueObserverException
* if an error occurs during the {@link ValueObserver} operation
* @throws ObserverException
* if an error occurs during the {@link Observer} operation
*
* @throws RuntimeException
* if a {@link ValueObserver} operation throws this
* if a {@link Observer} operation throws this
* {@link RuntimeException}
*/
@SuppressWarnings({ "unchecked", "DuplicateThrows" })
void remove(ValueObserver<Item>... observers)
throws NoItemToRemoveException, InvalidIterableStateException, ValueObserverException, RuntimeException;
void remove(Observer<Item>... observers)
throws NoItemToRemoveException, InvalidIterableStateException, ObserverException, RuntimeException;

/**
* Registers the specified {@link ValueObserver} for the remove operations
* Registers the specified {@link Observer} for the remove operations
* of this {@link ObservedRemoveIterator}.
*
* @param removeObserver
* additional remove {@link ValueObserver}
* additional remove {@link Observer}
*/
void addRemoveObserver(ValueObserver<Item> removeObserver);
void addRemoveObserver(Observer<Item> removeObserver);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

package org.jlib.container.iterator;

import org.jlib.operator.observer.ValueObserver;
import org.jlib.operator.observer.ValueObserverException;
import org.jlib.operator.observer.Observer;
import org.jlib.operator.observer.ObserverException;

/**
* {@link ReplaceIterator} allowing its remove operation to be attended by
* {@link ValueObserver} instances.
* {@link Observer} instances.
*
* @param <Item>
* type of the traversed items
Expand All @@ -43,25 +43,25 @@ public interface ObservedReplaceIterator<Item>
* Item by which the former Item is replaced
*
* @param observers
* comma separated sequence of {@link ValueObserver} instances
* comma separated sequence of {@link Observer} instances
* attending the replacement
*
* @throws NoItemToReplaceException
* if not called immediately after traversing an Item
*
* @throws ValueObserverException
* if an error occurs during the {@link ValueObserver} operation
* @throws ObserverException
* if an error occurs during the {@link Observer} operation
*/
@SuppressWarnings("unchecked")
void replace(Item newItem, ValueObserver<Item>... observers)
throws NoItemToReplaceException, ValueObserverException;
void replace(Item newItem, Observer<Item>... observers)
throws NoItemToReplaceException, ObserverException;

/**
* Registers the specified {@link ValueObserver} for the replace operations
* Registers the specified {@link Observer} for the replace operations
* of this {@link ObservedReplaceIterator}.
*
* @param replaceObserver
* additional replace {@link ValueObserver}
* additional replace {@link Observer}
*/
void addReplaceObserver(ValueObserver<Item> replaceObserver);
void addReplaceObserver(Observer<Item> replaceObserver);
}
21 changes: 21 additions & 0 deletions src/main/java/org/jlib/container/operation/AlmightyContainer.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
* jlib - Open Source Java Library
*
* www.jlib.org
*
*
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jlib.container.operation;

public interface AlmightyContainer<Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jlib/container/operation/Count.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jlib/container/operation/EqualCount.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -28,8 +28,8 @@
import org.jlib.container.operation.containsadapter.IterativeContainsAdapter;

import org.jlib.basefunctions.ApplicationObject;
import org.jlib.operator.observer.ValueObserver;
import org.jlib.operator.observer.ValueObserverException;
import org.jlib.operator.observer.Observer;
import org.jlib.operator.observer.ObserverException;

/**
* Skeletal implementation of a container. A concrete IterableContainer implementation needs only to extend this class
Expand Down Expand Up @@ -73,14 +73,14 @@ public Iterator<Item> iterator() {
@SafeVarargs
@Override
public final <ContainsIterable extends Iterable<Item> & ContainsSingle<Item>> /*
*/ void remove(final ContainsIterable items, final ValueObserver<Item>... observers)
throws InvalidContainerArgumentException, InvalidContainerStateException, ValueObserverException {
*/ void remove(final ContainsIterable items, final Observer<Item>... observers)
throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
throw new ForbiddenCastException(this);
}

@SafeVarargs
@Override
public final void removeAll(final ValueObserver<Item>... observers)
public final void removeAll(final Observer<Item>... observers)
throws InvalidContainerStateException {
throw new ForbiddenCastException(this);
}
Expand Down Expand Up @@ -142,8 +142,8 @@ public void retain(final IterativeContainsAdapter<Item> items)

@SafeVarargs
@Override
public final void retain(final Iterable<Item> items, final ValueObserver<Item>... observers)
throws InvalidContainerArgumentException, InvalidContainerStateException, ValueObserverException {
public final void retain(final Iterable<Item> items, final Observer<Item>... observers)
throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
throw new ForbiddenCastException(this);
}
};
Expand Down Expand Up @@ -188,7 +188,7 @@ public void removeAll()

@Override
@SuppressWarnings("unchecked")
public void removeAll(final ValueObserver<Item>... observers)
public void removeAll(final Observer<Item>... observers)
throws InvalidContainerStateException {
delegateObservedRemoveAll.removeAll(observers);
}
Expand Down Expand Up @@ -239,9 +239,9 @@ public List<Item> toRandomAccessList()
@Override
@SuppressWarnings({ "unchecked", "DuplicateThrows" })
public <ContainsIterable extends Iterable<Item> & ContainsSingle<Item>> /*
*/ void remove(final ContainsIterable items, final ValueObserver<Item>... observers)
*/ void remove(final ContainsIterable items, final Observer<Item>... observers)
throws ItemToRemoveNotContainedException, InvalidContainerArgumentException, InvalidContainerStateException,
ValueObserverException {
ObserverException {
delegateObservedRemoveMultiple.remove(items, observers);
}

Expand Down Expand Up @@ -341,8 +341,8 @@ public void retain(final IterativeContainsAdapter<Item> items)

@SafeVarargs
@Override
public final void retain(final Iterable<Item> items, final ValueObserver<Item>... observers)
throws InvalidContainerArgumentException, InvalidContainerStateException, ValueObserverException {
public final void retain(final Iterable<Item> items, final Observer<Item>... observers)
throws InvalidContainerArgumentException, InvalidContainerStateException, ObserverException {
delegateObservedRetain.retain(items, observers);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jlib/container/operation/IsEmpty.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* www.jlib.org
*
*
* Copyright 2005-2013 Igor Akkerman
* Copyright 2005-2015 Igor Akkerman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 9d49ae6

Please sign in to comment.