public abstract class ArraySortBase<T> extends Object implements ArraySort<T>
Created with IntelliJ IDEA. User: luog Date: 12/11/13 Time: 11:09 PM To change this template use File | Settings | File Templates.
ArrayAlgorithm.Util
Constructor and Description |
---|
ArraySortBase() |
Modifier and Type | Method and Description |
---|---|
T[] |
apply(T[] ts,
Integer from,
Integer to,
Comparator<T> comp)
Run the function with parameters specified.
|
T[] |
sort(T[] ts,
int from,
int to,
Comparator<T> comp) |
protected abstract T[] |
sort0(T[] ts,
int from,
int to,
Comparator<T> comp,
T[] newTs) |
public final T[] apply(T[] ts, Integer from, Integer to, Comparator<T> comp) throws NotAppliedException, Lang.Break
Lang.Func4
Run the function with parameters specified.
In case implementing a partial function, it can throw out an NotAppliedException
if the function is not defined for the given parameter(s)
apply
in interface Lang.Func4<T[],Integer,Integer,Comparator<T>,T[]>
ts
- the first argumentfrom
- the second argumentto
- the third argumentcomp
- the fourth argumentR
NotAppliedException
- if the function doesn’t apply to the parameter(s)Lang.Break
- to short cut collecting operations (fold/reduce) on an container
protected abstract T[] sort0(T[] ts, int from, int to, Comparator<T> comp, T[] newTs)
Copyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.