Skip to content

Commit

Permalink
Adaptions for Java 9 and minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
T-F-S committed Jan 11, 2018
1 parent 096adea commit a6c33aa
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 77 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Prof. Dr. Dr. Thomas F. Sturm
Copyright (c) 2014-2018, Prof. Dr. Dr. Thomas F. Sturm
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions build.number
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Mon Jul 14 09:38:37 CEST 2014
build.number=59
#Thu Jan 11 17:02:28 CET 2018
build.number=75
8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
CSV-Sorter ANT build
</description>

<property name="version.number" value="0.94 beta"/>
<property name="version.date" value="2014/07/14"/>
<property name="version.number" value="0.95 beta"/>
<property name="version.date" value="2018/01/11"/>

<property name="root" location="."/>
<property name="src" location="${root}/src"/>
Expand Down Expand Up @@ -88,8 +88,8 @@
includes="${package}/**"
deprecation="on"
includeAntRuntime="false"
source="1.6"
target="1.6"
source="1.7"
target="1.7"
>
</javac>
</target>
Expand Down
34 changes: 20 additions & 14 deletions doc/csvsorter.tex
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
% \LaTeX-Main\
%% The csvsorter program - version 0.94 beta (2014/07/14)
%% The csvsorter program - version 0.95 beta (2018/01/11)
%% csvsorter.tex: Manual
%%
%% Copyright (c) 2014, Prof. Dr. Dr. Thomas F. Sturm
%% Copyright (c) 2014-2018, Prof. Dr. Dr. Thomas F. Sturm
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -37,7 +37,7 @@
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern,parskip,array,ifthen,calc}
\usepackage{lmodern,parskip,array}
\usepackage{amsmath,amssymb}
\usepackage[svgnames,table,hyperref]{xcolor}
\usepackage{tikz}
Expand Down Expand Up @@ -71,9 +71,9 @@
\usepackage[many,listings,minted]{tcolorbox}
\usetikzlibrary{arrows.meta}

\def\version{0.94 beta}%
\def\datum{2014/07/14}%
\def\docdatum{2014/07/19}
\def\version{0.95 beta}%
\def\datum{2018/01/11}%
\def\docdatum{2018/01/11}

\hypersetup{
pdftitle={Manual for the csvsorter program},
Expand Down Expand Up @@ -162,7 +162,7 @@
title={\thetcbcounter: #2},label={#3},center title,colframe=blue!25!red!50!black,
colbacktitle=blue!25!red!75!black,
fonttitle=\bfseries,toptitle=1mm,bottomtitle=1mm,
colback=red!5!white,drop lifted shadow,enlarge left by=(\linewidth-\tcb@width)/2,
colback=red!5!white,drop lifted shadow,center,
before upper=\arrayrulecolor{blue!25!red!50!black},
float=tb,#1}
\makeatother
Expand All @@ -187,10 +187,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\begin{center}
\begin{tcolorbox}[enhanced,hbox,tikznode,left=8mm,right=8mm,boxrule=0.4pt,
\begin{tcolorbox}[enhanced,center,hbox,tikznode,left=8mm,right=8mm,boxrule=0.4pt,
colback=white,colframe=black!50!yellow,
%drop fuzzy midday shadow=black!50!yellow,
drop lifted shadow=black!50!yellow,
before=\par\vspace*{5mm},after=\par\bigskip]
{\bfseries\LARGE The \csvsorter\ program}\\[3mm]
Expand All @@ -212,6 +210,7 @@
{\footnotesize Documentation \docdatum}\\[3mm]
\url{http://T-F-S.github.io/csvsorter/}
\end{tcolorbox}
\begin{center}
{\large Thomas F.~Sturm%
\footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik,
Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany;
Expand Down Expand Up @@ -247,7 +246,7 @@ \section{Introduction}

The \csvsorter\ program was developed as external sorting program
for the \texttt{csvsimple} \LaTeX\ package,
see \url{www.ctan.org/tex-archive/macros/latex/contrib/csvsimple}.
see \url{http://www.ctan.org/tex-archive/macros/latex/contrib/csvsimple}.
But it can be used for any CSV sorting task.

\clearpage
Expand All @@ -263,7 +262,7 @@ \section{License}
\bigskip

\begin{tcolorbox}[parbox=false,colframe=red!50!black,colback=yellow!10!white]
Copyright \copyright~2014, Prof.~Dr.~Dr.~Thomas~F.~Sturm\\
Copyright \copyright~2014-2018, Prof.~Dr.~Dr.~Thomas~F.~Sturm\\
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -634,7 +633,7 @@ \section{Configuration}\label{sec:config}
The document element
\element{csv} is mandatory.
\subsection{\element{noheader}}
\subsection{\element{noHeader}}
If this element is present, the CSV file(s) do not have a header line.
Note that in this case the columns can be addressed by number only.
If this element is not present, the first line of the CSV file is
Expand Down Expand Up @@ -940,8 +939,15 @@ \subsection{Hierarchical brackets}
\section{Version History}
%\versionbox[before=\par]{Version \version\ (\datum)}
\versionbox[before=\par]{Version 0.95 beta (2018/01/11)}
\begin{changelist}
\item[changed] Windows launcher |csvsorter.exe| can be used for Java 9 now.
\item[changed] Java 7 or newer is required now.
\item[fixed] Deprecated constructors replaced.
\item[fixed] Documentation corrected for \element{noHeader}.
\end{changelist}
\versionbox[before=\par]{Version 0.94 beta (2014/07/14)}
\versionbox{Version 0.94 beta (2014/07/14)}
\begin{changelist}
\item[new] Token file for interaction with |csvsimple| with new command-line option 't'.
\item[new] New command-line option 'q' to set quiet state.
Expand Down
2 changes: 1 addition & 1 deletion launcher/launch4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<minVersion>1.6.0</minVersion>
<minVersion>1.7.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
Expand Down
14 changes: 5 additions & 9 deletions src/tfs/csvsorter/CSVSorter.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public class CSVSorter

static
{
VERSION = "0.94 beta";
DATE = "2014/07/14";
BUILD = 58;
VERSION = "0.95 beta";
DATE = "2018/01/11";
BUILD = 74;
PROGNAME = "CSV-Sorter";
}

Expand All @@ -44,7 +44,7 @@ public static String getFullVersion()

public static String getCopyright()
{
return "Copyright (c) 2014, Prof. Dr. Dr. Thomas F. Sturm";
return "Copyright (c) 2014-2018, Prof. Dr. Dr. Thomas F. Sturm";
}

private enum OPTCODE { c, l, i, o, x, t, q };
Expand Down Expand Up @@ -102,6 +102,7 @@ private void printLogHeader(PrintWriter log)
{
log.println(getFullVersion());
log.println(getCopyright());
log.println("Java Version: "+System.getProperty("java.version"));
log.println("Start time: "+startDate);
}

Expand Down Expand Up @@ -445,11 +446,6 @@ public static void main(String s[])
{
startTime = System.nanoTime();
Date date = new Date();
/*
System.out.println("This is "+getFullVersion());
System.out.println(getCopyright());
System.out.println("");
*/
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
startDate = sdf.format(date);

Expand Down
36 changes: 18 additions & 18 deletions src/tfs/csvsorter/MultiColumnComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void config(HashMap<String,Integer> nameToColumn, int maxNumber) throws E
}


int getIntegerValue(String[] parts) throws Exception
Integer getIntegerValue(String[] parts) throws Exception
{
int s = 0;
for (NumberName nn : getNumberNames())
Expand All @@ -80,7 +80,7 @@ int getIntegerValue(String[] parts) throws Exception
}


long getLongValue(String[] parts) throws Exception
Long getLongValue(String[] parts) throws Exception
{
long s = 0;
for (NumberName nn : getNumberNames())
Expand All @@ -92,7 +92,7 @@ long getLongValue(String[] parts) throws Exception



double getDoubleValue(String[] parts) throws Exception
Double getDoubleValue(String[] parts) throws Exception
{
double s = 0;
for (NumberName nn : getNumberNames())
Expand All @@ -116,7 +116,7 @@ public static MultiColumnComparator createIntegerComparator(NumberName[] numberN
{
public Comparable generateKey(String[] parts) throws Exception
{
return new Integer(getIntegerValue(parts));
return getIntegerValue(parts);
}
};
}
Expand All @@ -129,7 +129,7 @@ public Comparable generateKey(String[] parts) throws Exception
{
try
{
return new Integer(getIntegerValue(parts));
return getIntegerValue(parts);
}
catch (Exception e)
{
Expand All @@ -147,20 +147,20 @@ public Comparable generateKey(String[] parts) throws Exception
{
public Comparable generateKey(String[] parts) throws Exception
{
return new Integer(-getIntegerValue(parts));
return Integer.valueOf(-getIntegerValue(parts));
}
};
}
else
{
final Integer defaultKey = new Integer(-Integer.parseInt(defaultString));
final Integer defaultKey = Integer.valueOf(-Integer.parseInt(defaultString));
return new MultiColumnComparator(numberNames,ascending,type,defaultString)
{
public Comparable generateKey(String[] parts) throws Exception
{
try
{
return new Integer(-getIntegerValue(parts));
return Integer.valueOf(-getIntegerValue(parts));
}
catch (Exception e)
{
Expand All @@ -186,7 +186,7 @@ public static MultiColumnComparator createLongComparator(NumberName[] numberName
{
public Comparable generateKey(String[] parts) throws Exception
{
return new Long(getLongValue(parts));
return getLongValue(parts);
}
};
}
Expand All @@ -199,7 +199,7 @@ public Comparable generateKey(String[] parts) throws Exception
{
try
{
return new Long(getLongValue(parts));
return getLongValue(parts);
}
catch (Exception e)
{
Expand All @@ -217,20 +217,20 @@ public Comparable generateKey(String[] parts) throws Exception
{
public Comparable generateKey(String[] parts) throws Exception
{
return new Long(-getLongValue(parts));
return Long.valueOf(-getLongValue(parts));
}
};
}
else
{
final Long defaultKey = new Long(-Long.parseLong(defaultString));
final Long defaultKey = Long.valueOf(-Long.parseLong(defaultString));
return new MultiColumnComparator(numberNames,ascending,type,defaultString)
{
public Comparable generateKey(String[] parts) throws Exception
{
try
{
return new Long(-getLongValue(parts));
return Long.valueOf(-getLongValue(parts));
}
catch (Exception e)
{
Expand All @@ -256,7 +256,7 @@ public static MultiColumnComparator createDoubleComparator(NumberName[] numberNa
{
public Comparable generateKey(String[] parts) throws Exception
{
return new Double(getDoubleValue(parts));
return getDoubleValue(parts);
}
};
}
Expand All @@ -269,7 +269,7 @@ public Comparable generateKey(String[] parts) throws Exception
{
try
{
return new Double(getDoubleValue(parts));
return getDoubleValue(parts);
}
catch (Exception e)
{
Expand All @@ -287,20 +287,20 @@ public Comparable generateKey(String[] parts) throws Exception
{
public Comparable generateKey(String[] parts) throws Exception
{
return new Double(-getDoubleValue(parts));
return Double.valueOf(-getDoubleValue(parts));
}
};
}
else
{
final Double defaultKey = new Double(-Double.parseDouble(defaultString));
final Double defaultKey = Double.valueOf(-Double.parseDouble(defaultString));
return new MultiColumnComparator(numberNames,ascending,type,defaultString)
{
public Comparable generateKey(String[] parts) throws Exception
{
try
{
return new Double(-getDoubleValue(parts));
return Double.valueOf(-getDoubleValue(parts));
}
catch (Exception e)
{
Expand Down
Loading

0 comments on commit a6c33aa

Please sign in to comment.