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

#677 removed ctors for list package #694

Closed
wants to merge 3 commits into from
Closed
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
9 changes: 0 additions & 9 deletions src/main/java/org/cactoos/list/ListOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ public ListOf(final T... array) {
this(new IterableOf<>(array));
}

/**
* Ctor.
* @param src An {@link Iterator}
* @since 0.21
*/
public ListOf(final Iterator<T> src) {
this(() -> src);
}

/**
* Ctor.
* @param src An {@link Iterable}
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/org/cactoos/list/Shuffled.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ public Shuffled(final T... src) {
this(new ListOf<>(src));
}

/**
* Ctor.
* @param src The underlying collection
*/
public Shuffled(final Iterator<T> src) {
this(() -> src);
}

/**
* Ctor.
* @param src The underlying collection
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/cactoos/list/SolidList.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ public SolidList(final X... items) {
this(new IterableOf<>(items));
}

/**
* Ctor.
* @param items The array
* @since 0.21
*/
public SolidList(final Iterator<X> items) {
this(new IterableOf<>(items));
}

/**
* Ctor.
* @param items The array
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/org/cactoos/list/Sorted.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@ public Sorted(final T... src) {
this(new ListOf<>(src));
}

/**
* Ctor.
*
* <p>If you're using this ctor you must be sure that type {@code T}
* implements {@link Comparable} interface. Otherwise, there will be
* a type casting exception in runtime.</p>
*
* @param src The underlying collection
* @since 0.21
*/
public Sorted(final Iterator<T> src) {
this(() -> src);
}

/**
* Ctor.
*
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/cactoos/list/StickyList.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ public StickyList(final Iterable<X> items) {
this(new ListOf<>(items));
}

/**
* Ctor.
* @param items The array
* @since 0.21
*/
public StickyList(final Iterator<X> items) {
this(new ListOf<>(items));
}

/**
* Ctor.
* @param list The iterable
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/cactoos/list/SyncList.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ public SyncList(final Iterable<X> items) {
this(new ListOf<>(items));
}

/**
* Ctor.
* @param items The array
* @since 0.21
*/
public SyncList(final Iterator<X> items) {
this(new ListOf<>(items));
}

/**
* Ctor.
* @param list The iterable
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/org/cactoos/map/MapOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ public MapOf(final Map<X, Y> src,
);
}

/**
* Ctor.
* @param entries List of the entries
*/
public MapOf(final Iterator<Map.Entry<X, Y>> entries) {
this(() -> entries);
}

/**
* Ctor.
* @param entries List of the entries
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/org/cactoos/map/SolidMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ public SolidMap(final Iterable<Map.Entry<X, Y>> list) {
this(new MapOf<>(list));
}

/**
* Ctor.
* @param list Entries for the entries
*/
public SolidMap(final Iterator<Map.Entry<X, Y>> list) {
this(() -> list);
}

/**
* Ctor.
* @param map Pre-existing map we want to extend
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/cactoos/map/StickyMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@ public StickyMap(final Iterable<Map.Entry<X, Y>> list) {
this(new MapOf<>(list));
}

/**
* Ctor.
* @param list Entries for the entries
* @since 0.21
*/
public StickyMap(final Iterator<Map.Entry<X, Y>> list) {
this(() -> list);
}

/**
* Ctor.
* @param map Pre-existing map we want to extend
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/org/cactoos/map/SyncMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ public SyncMap(final Iterable<Map.Entry<X, Y>> list) {
this(new MapOf<>(list));
}

/**
* Ctor.
* @param list Entries for the entries
*/
public SyncMap(final Iterator<Map.Entry<X, Y>> list) {
this(() -> list);
}

/**
* Ctor.
* @param map Pre-existing map we want to extend
Expand Down
84 changes: 0 additions & 84 deletions src/main/java/org/cactoos/scalar/ItemAt.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ public ItemAt(final int position, final Iterable<T> source) {
);
}

/**
* Ctor.
*
* @param position Position
* @param source Iterable
* @since 0.21
*/
public ItemAt(final int position, final Iterator<T> source) {
this(position, () -> source);
}

/**
* Ctor.
*
Expand All @@ -132,79 +121,6 @@ public ItemAt(
this(new StickyScalar<>(source::iterator), position, fallback);
}

/**
* Ctor.
*
* @param iterator Iterator
*/
public ItemAt(final Iterator<T> iterator) {
this(
iterator,
itr -> {
throw new IOException("Iterator is empty");
}
);
}

/**
* Ctor.
*
* @param iterator Iterator
* @param fallback Fallback value
*/
public ItemAt(final Iterator<T> iterator, final T fallback) {
this(iterator, itr -> fallback);
}

/**
* Ctor.
*
* @param iterator Iterator
* @param fallback Fallback value
*/
public ItemAt(
final Iterator<T> iterator,
final Func<Iterable<T>, T> fallback
) {
this(iterator, 0, fallback);
}

/**
* Ctor.
*
* @param iterator Iterator
* @param position Position
*/
public ItemAt(final Iterator<T> iterator, final int position) {
this(
iterator,
position,
itr -> {
throw new IOException(
new FormattedText(
"Iterator doesn't have an element at #%d position",
position
).asString()
);
}
);
}

/**
* Ctor.
*
* @param iterator Iterator
* @param position Position
* @param fallback Fallback value
*/
public ItemAt(
final Iterator<T> iterator,
final int position,
final Func<Iterable<T>, T> fallback
) {
this(new StickyScalar<>(() -> iterator), position, fallback);
}

/**
* Ctor.
*
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/org/cactoos/scalar/Or.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package org.cactoos.scalar;

import java.util.Iterator;
import org.cactoos.Func;
import org.cactoos.Proc;
import org.cactoos.Scalar;
Expand Down Expand Up @@ -74,17 +73,6 @@ public <X> Or(final Func<X, Boolean> func, final X... src) {
this(func, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
* @param proc Proc to use
* @param <X> Type of items in the iterable
* @since 0.24
*/
public <X> Or(final Proc<X> proc, final Iterator<X> src) {
this(proc, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
Expand All @@ -96,17 +84,6 @@ public <X> Or(final Proc<X> proc, final Iterable<X> src) {
this(new FuncOf<>(proc, false), src);
}

/**
* Ctor.
* @param src The iterable
* @param func Func to map
* @param <X> Type of items in the iterable
* @since 0.24
*/
public <X> Or(final Func<X, Boolean> func, final Iterator<X> src) {
this(func, new IterableOf<>(src));
}

/**
* Ctor.
* @param src The iterable
Expand All @@ -130,15 +107,6 @@ public Or(final Scalar<Boolean>... scalar) {
this(new IterableOf<>(scalar));
}

/**
* Ctor.
* @param iterable The iterable.
* @since 0.24
*/
public Or(final Iterator<Scalar<Boolean>> iterable) {
this(new IterableOf<>(iterable));
}

/**
* Ctor.
* @param iterable The iterable.
Expand Down