Skip to content

Commit

Permalink
Replace wildcard type parameter where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
jacek-lewandowski committed Apr 5, 2023
1 parent cc63a09 commit 4a7bd95
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

@SuppressWarnings("rawtypes")
// TODO (desired, efficiency): check that foldl call-sites are inlined and optimised by HotSpot
public abstract class AbstractKeys<K extends RoutableKey, KS extends Routables<K, ?>> implements Iterable<K>, Routables<K, KS>
public abstract class AbstractKeys<K extends RoutableKey, KS extends Routables<K, KS>> implements Iterable<K>, Routables<K, KS>
{
final K[] keys;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static accord.utils.SortedArrays.Search.FAST;
import static accord.utils.SortedArrays.swapHighLow32b;

public abstract class AbstractRanges<RS extends Routables<Range, ?>> implements Iterable<Range>, Routables<Range, RS>
public abstract class AbstractRanges<RS extends Routables<Range, RS>> implements Iterable<Range>, Routables<Range, RS>
{
static final Range[] NO_RANGES = new Range[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Arrays;

// TODO: do we need this class?
public abstract class AbstractUnseekableKeys<KS extends Unseekables<RoutingKey, ?>> extends AbstractKeys<RoutingKey, KS> implements Iterable<RoutingKey>, Unseekables<RoutingKey, KS>
public abstract class AbstractUnseekableKeys<KS extends Unseekables<RoutingKey, KS>> extends AbstractKeys<RoutingKey, KS> implements Iterable<RoutingKey>, Unseekables<RoutingKey, KS>
{
AbstractUnseekableKeys(RoutingKey[] keys)
{
Expand Down
7 changes: 2 additions & 5 deletions accord-core/src/main/java/accord/primitives/Routables.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,15 @@
import accord.utils.IndexedFoldToLong;
import accord.utils.IndexedRangeFoldToLong;
import accord.utils.SortedArrays;
import net.nicoulaj.compilecommand.annotations.Inline;

import java.util.function.BiFunction;
import java.util.function.Function;
import net.nicoulaj.compilecommand.annotations.Inline;

import static accord.primitives.Routables.Slice.Overlapping;
import static accord.utils.SortedArrays.Search.FLOOR;

/**
* A collection of either Seekable or Unseekable
*/
public interface Routables<K extends Routable, U extends Routables<K, ?>> extends Iterable<K>
public interface Routables<K extends Routable, U extends Routables<K, U>> extends Iterable<K>
{
enum Slice
{
Expand Down
2 changes: 1 addition & 1 deletion accord-core/src/main/java/accord/primitives/Seekables.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Either a Route or a collection of Routable
*/
public interface Seekables<K extends Seekable, U extends Seekables<K, ?>> extends Routables<K, U>
public interface Seekables<K extends Seekable, U extends Seekables<K, U>> extends Routables<K, U>
{
@Override
default U slice(Ranges ranges) { return slice(ranges, Overlapping); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Either a Route or a simple collection of keys or ranges
*/
public interface Unseekables<K extends Unseekable, U extends Unseekables<K, ?>> extends Iterable<K>, Routables<K, U>
public interface Unseekables<K extends Unseekable, U extends Unseekables<K, U>> extends Iterable<K>, Routables<K, U>
{
enum UnseekablesKind
{
Expand Down

0 comments on commit 4a7bd95

Please sign in to comment.