aboutsummaryrefslogtreecommitdiffstats
path: root/src/comparable
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-01-21 16:35:39 +0100
committerMattias Andrée <maandree@operamail.com>2014-01-21 16:35:39 +0100
commit1d9332538db3c759b591f2bd0db43261dac03634 (patch)
tree564d137cbc1f4963975b55df6950020f5e0b6706 /src/comparable
parentcompile with -Xlint:all,-cast (diff)
downloadalgorithms-and-data-structures-1d9332538db3c759b591f2bd0db43261dac03634.tar.gz
algorithms-and-data-structures-1d9332538db3c759b591f2bd0db43261dac03634.tar.bz2
algorithms-and-data-structures-1d9332538db3c759b591f2bd0db43261dac03634.tar.xz
partial array support in binary search + add multibinary search
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/comparable')
-rw-r--r--src/comparable4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/comparable b/src/comparable
index 26feb1f..70cfb7b 100644
--- a/src/comparable
+++ b/src/comparable
@@ -4,6 +4,7 @@ Telement="${T}"
Tarray="${Telement}[]"
Tparam=""
Targ=""
+Targ_name=""
function T-array
{
elems=""
@@ -42,6 +43,7 @@ elif [[ "${T}" = @(T|T+|T++) ]]; then
if [ "${T}" = T ]; then
Tparam="<T> "
Targ=", Comparator<T> comparator"
+ Targ_name=", comparator"
function cmp
{ echo "comparator.compare($1, $2)"
}
@@ -66,12 +68,10 @@ elif [[ "${T}" = @(T|T+|T++) ]]; then
else
if [ "${T}" = T++ ]; then
Tparam="<T> "
- Targ=""
Telement="Comparable<T>"
Tarray="${Telement}[]"
else
Tparam="<T extends Comparable<? super T>> "
- Targ=""
fi
function cmp
{ echo "($1).compareTo($2)"