Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Wrapping* classes non-final. Fixes #6 #10

Merged
merged 2 commits into from
Jul 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @author Georgy Vlasov ([email protected])
* @version $Id$
*/
final class WrappingReadOnlyCollection<T> implements ReadOnlyCollection<T> {
class WrappingReadOnlyCollection<T> implements ReadOnlyCollection<T> {
/**
* Wrapped collection.
*/
Expand All @@ -49,22 +49,22 @@ public WrappingReadOnlyCollection(final Collection<T> wrp) {
}

@Override
public boolean contains(final T element) {
public final boolean contains(final T element) {
return this.wrapped.contains(element);
}

@Override
public int size() {
public final int size() {
return this.wrapped.size();
}

@Override
public Iterator<T> iterator() {
public final Iterator<T> iterator() {
return this.wrapped.iterator();
}

@Override
public Stream<T> stream() {
public final Stream<T> stream() {
return this.wrapped.stream();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @author Georgy Vlasov ([email protected])
* @version $Id$
*/
public final class WrappingReadOnlyList<T> implements ReadOnlyList<T> {
public class WrappingReadOnlyList<T> implements ReadOnlyList<T> {
/**
* Wrapped list.
*/
Expand All @@ -49,27 +49,27 @@ public WrappingReadOnlyList(final List<T> wrp) {
}

@Override
public T get(final int index) {
public final T get(final int index) {
return this.wrapped.get(index);
}

@Override
public boolean contains(final T element) {
public final boolean contains(final T element) {
return this.wrapped.contains(element);
}

@Override
public int size() {
public final int size() {
return this.wrapped.size();
}

@Override
public Iterator<T> iterator() {
public final Iterator<T> iterator() {
return this.wrapped.iterator();
}

@Override
public Stream<T> stream() {
public final Stream<T> stream() {
return this.wrapped.stream();
}
}
12 changes: 6 additions & 6 deletions src/main/java/org/tendiwa/rocollections/WrappingReadOnlySet.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
* @version $Id$
*/
@SuppressWarnings("unused")
public final class WrappingReadOnlySet<T> implements ReadOnlySet<T> {
public class WrappingReadOnlySet<T> implements ReadOnlySet<T> {
/**
* The wrapped Set instance.
*/
private final transient Set<T> set;
private final Set<T> set;

/**
* Wraps a {@link java.util.Set}.
Expand All @@ -51,7 +51,7 @@ public final class WrappingReadOnlySet<T> implements ReadOnlySet<T> {
}

@Override
public boolean contains(final T element) {
public final boolean contains(final T element) {
return this.set.contains(element);
}

Expand All @@ -61,7 +61,7 @@ public boolean contains(final T element) {
* @return Size of this set.
*/
@Override
public int size() {
public final int size() {
return this.set.size();
}

Expand All @@ -71,7 +71,7 @@ public int size() {
* @return Iterator over elements of this set.
*/
@Override
public Iterator<T> iterator() {
public final Iterator<T> iterator() {
return this.set.iterator();
}

Expand All @@ -81,7 +81,7 @@ public Iterator<T> iterator() {
* @return Stream over elements of this set.
*/
@Override
public Stream<T> stream() {
public final Stream<T> stream() {
return this.set.stream();
}
}