Commit 624d9819 authored by Christian MOMON's avatar Christian MOMON
Browse files

Performed Javadoc review.

parent 69bf363d
......@@ -192,8 +192,8 @@ public class FlatDB4GeoNamesFactory
Downloader.download(sourceUrl + GeoNamesFlatDatabase.GEONAMES_ADMINISTRATIVE_CODE2_FILE, localTargetRepository);
//
FileUtils.copyURLToFile(FlatDB4GeoNamesFactory.class.getResource("/org/tip/flatdb4geonames/model/README"), new File(localTargetRepository, "README"));
FileUtils.copyURLToFile(FlatDB4GeoNamesFactory.class.getResource("/org/tip/flatdb4geonames/model/LICENSE"), new File(localTargetRepository, "LICENSE"));
FileUtils.copyURLToFile(FlatDB4GeoNamesFactory.class.getResource("/org/tip/flatdb4geonames/model/ressources/README"), new File(localTargetRepository, "README"));
FileUtils.copyURLToFile(FlatDB4GeoNamesFactory.class.getResource("/org/tip/flatdb4geonames/model/ressources/LICENSE"), new File(localTargetRepository, "LICENSE"));
}
}
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -27,6 +27,9 @@ import org.tip.flatdb4geonames.util.StringLongPairs;
import fr.devinsy.util.StringList;
/**
* The Class StatisticsReporter.
*/
public class StatisticsReporter
{
private static Logger logger = LoggerFactory.getLogger(StatisticsReporter.class);
......@@ -34,9 +37,13 @@ public class StatisticsReporter
public static final String DEFAULT_CHARSET_NAME = "UTF-8";
/**
* Report longest words.
*
* @return
* @param maxLineCount
* the max line count
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList reportLongestWords(final int maxLineCount) throws IOException
{
......@@ -78,9 +85,13 @@ public class StatisticsReporter
}
/**
* Report word matching.
*
* @return
* @param maxLineCount
* the max line count
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList reportWordMatching(final int maxLineCount) throws IOException
{
......@@ -118,5 +129,4 @@ public class StatisticsReporter
//
return result;
}
}
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -36,6 +36,9 @@ import org.tip.flatdb4geonames.util.StringLongPairs;
import fr.devinsy.util.StringSet;
/**
* The Class StatisticsWorker.
*/
public class StatisticsWorker
{
private static Logger logger = LoggerFactory.getLogger(StatisticsWorker.class);
......@@ -43,9 +46,13 @@ public class StatisticsWorker
public static final String DEFAULT_CHARSET_NAME = "UTF-8";
/**
* Census longest words.
*
* @return
* @param maxLineCount
* the max line count
* @return the string long pairs
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringLongPairs censusLongestWords(final int maxLineCount) throws IOException
{
......@@ -127,9 +134,13 @@ public class StatisticsWorker
}
/**
* Census longest words 2.
*
* @return
* @param maxLineCount
* the max line count
* @return the string long pairs
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringLongPairs censusLongestWords2(final int maxLineCount) throws IOException
{
......@@ -202,9 +213,13 @@ public class StatisticsWorker
}
/**
* Census word matching.
*
* @return
* @param maxLineCount
* the max line count
* @return the string long pairs
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringLongPairs censusWordMatching(final int maxLineCount) throws IOException
{
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -35,6 +35,7 @@ import fr.devinsy.util.FileTools;
import fr.devinsy.util.StringList;
/**
* The Class FlatDB4GeoNamesGeneralPanel.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
......@@ -44,9 +45,7 @@ public class FlatDB4GeoNamesGeneralPanel extends JPanel
private JEditorPane editorPane;
/**
* Create the panel.
*
* @throws IOException
* Instantiates a new FlatDB4GeoNames general panel.
*/
public FlatDB4GeoNamesGeneralPanel()
{
......@@ -62,8 +61,10 @@ public class FlatDB4GeoNamesGeneralPanel extends JPanel
}
/**
* Refresh.
*
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public void refresh() throws IOException
{
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -60,6 +60,9 @@ import com.jgoodies.forms.layout.RowSpec;
import fr.devinsy.util.FileTools;
import fr.devinsy.util.StringList;
/**
* The Class FlatDB4GeoNamesRequestPanel.
*/
public class FlatDB4GeoNamesRequestPanel extends JPanel
{
private static final long serialVersionUID = -6719667140204170550L;
......@@ -80,7 +83,7 @@ public class FlatDB4GeoNamesRequestPanel extends JPanel
private JLabel lblTips;
/**
* Create the panel.
* Instantiates a new FlatDB4GeoNames request panel.
*/
public FlatDB4GeoNamesRequestPanel()
{
......@@ -226,8 +229,9 @@ public class FlatDB4GeoNamesRequestPanel extends JPanel
}
/**
* Gets the criteria.
*
* @return
* @return the criteria
*/
public GeoNamesSearchCriteria getCriteria()
{
......@@ -283,7 +287,7 @@ public class FlatDB4GeoNamesRequestPanel extends JPanel
}
/**
*
* Refresh.
*/
public void refresh()
{
......@@ -298,10 +302,14 @@ public class FlatDB4GeoNamesRequestPanel extends JPanel
}
/**
* Refresh result.
*
* @param source
* @param result
* the result
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws FlatDB4GeoNamesException
* the flat DB 4 geo names exception
*/
public void refreshResult(final GeoNamesSearchResult result) throws IOException, FlatDB4GeoNamesException
{
......@@ -327,9 +335,13 @@ public class FlatDB4GeoNamesRequestPanel extends JPanel
}
/**
* To raw.
*
* @param source
* @return
* the source
* @param maxLineCount
* the max line count
* @return the string list
*/
public static StringList toRaw(final GeoNamesSearchResult source, final int maxLineCount)
{
......@@ -428,9 +440,11 @@ public class FlatDB4GeoNamesRequestPanel extends JPanel
}
/**
* To tiny.
*
* @param source
* @return
* the source
* @return the string list
*/
public static StringList toTiny(final GeoNamesLines source)
{
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -32,13 +32,19 @@ import org.tip.flatdb4geonames.model.GeoNamesFlatDatabase;
import fr.devinsy.util.FileTools;
import fr.devinsy.util.StringList;
/**
* The Class FlatDB4GeoNamesStatisticsPanel.
*/
public class FlatDB4GeoNamesStatisticsPanel extends JPanel
{
private static final long serialVersionUID = -3689363226086057052L;
private JEditorPane editorPane;
/**
* Create the panel.
* Instantiates a new flat DB 4 geo names statistics panel.
*
* @param report
* the report
*/
public FlatDB4GeoNamesStatisticsPanel(final StringList report)
{
......@@ -65,8 +71,12 @@ public class FlatDB4GeoNamesStatisticsPanel extends JPanel
}
/**
* Refresh report.
*
* @param report
* the report
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public void refreshReport(final StringList report) throws IOException
{
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -19,6 +19,7 @@
package org.tip.flatdb4geonames.swing.downloaddatabase;
/**
* The Class DownloadDatabaseCriteria.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
......@@ -28,7 +29,7 @@ public class DownloadDatabaseCriteria
private String targetDirectory;
/**
*
* Instantiates a new download database criteria.
*/
public DownloadDatabaseCriteria()
{
......@@ -36,28 +37,50 @@ public class DownloadDatabaseCriteria
this.targetDirectory = null;
}
/**
* Gets the source repository.
*
* @return the source repository
*/
public String getSourceRepository()
{
return this.sourceRepository;
}
/**
* Gets the target directory.
*
* @return the target directory
*/
public String getTargetDirectory()
{
return this.targetDirectory;
}
/**
* Sets the source repository.
*
* @param sourceRepository
* the new source repository
*/
public void setSourceRepository(final String sourceRepository)
{
this.sourceRepository = sourceRepository;
}
/**
* Sets the target directory.
*
* @param targetDirectory
* the new target directory
*/
public void setTargetDirectory(final String targetDirectory)
{
this.targetDirectory = targetDirectory;
}
/**
*
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString()
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -56,6 +56,7 @@ import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
/**
* The Class DownloadDatabaseDialog.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
......@@ -83,7 +84,7 @@ public class DownloadDatabaseDialog extends JDialog
private JButton btnSelector;
/**
* Create the dialog.
* Instantiates a new download database dialog.
*/
public DownloadDatabaseDialog()
{
......@@ -437,8 +438,10 @@ public class DownloadDatabaseDialog extends JDialog
}
/**
* Clear target.
*
* @param path
* the path
*/
public void clearTarget(final String path)
{
......@@ -454,8 +457,9 @@ public class DownloadDatabaseDialog extends JDialog
}
/**
* Gets the criteria.
*
* @return
* @return the criteria
*/
private DownloadDatabaseCriteria getCriteria()
{
......@@ -471,7 +475,10 @@ public class DownloadDatabaseDialog extends JDialog
}
/**
* Sets the target directory.
*
* @param target
* the new target directory
*/
public void setTargetDirectory(final File target)
{
......@@ -496,7 +503,7 @@ public class DownloadDatabaseDialog extends JDialog
}
/**
*
* Update free disk space.
*/
public void updateFreeDiskSpace()
{
......@@ -506,6 +513,9 @@ public class DownloadDatabaseDialog extends JDialog
/**
* Launch the application.
*
* @param args
* the arguments
*/
public static void main(final String[] args)
{
......@@ -529,6 +539,9 @@ public class DownloadDatabaseDialog extends JDialog
/**
* This method shows dialog.
*
* @param parent
* the parent
*/
public static void showDialog(final Component parent)
{
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -28,6 +28,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class DownloadTargetSelector.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/
......@@ -38,7 +39,10 @@ public class DownloadTargetSelector extends JFileChooser
private static Logger logger = LoggerFactory.getLogger(DownloadTargetSelector.class);
/**
* Instantiates a new download target selector.
*
* @param targetFile
* the target file
*/
public DownloadTargetSelector(final File targetFile)
{
......@@ -68,13 +72,12 @@ public class DownloadTargetSelector extends JFileChooser
setDialogType(CUSTOM_DIALOG);
}
/**
*
/* (non-Javadoc)
* @see javax.swing.JFileChooser#approveSelection()
*/
@Override
public void approveSelection()
{
//
File targetFile = getSelectedFile();
logger.debug("getCurrentDirectory(): {}", getCurrentDirectory());
......@@ -83,31 +86,29 @@ public class DownloadTargetSelector extends JFileChooser
super.approveSelection();
}
/**
*
/* (non-Javadoc)
* @see javax.swing.JFileChooser#cancelSelection()
*/
@Override
public void cancelSelection()
{
//
logger.debug("Cancel selection.");
super.cancelSelection();
}
/**
*
/* (non-Javadoc)
* @see javax.swing.JFileChooser#setSelectedFile(java.io.File)
*/
@Override
public void setSelectedFile(final File file)
{
//
super.setSelectedFile(file);
logger.info("SELECED FILE {}", file);
}
/**
*
/* (non-Javadoc)
* @see javax.swing.JComponent#setVisible(boolean)
*/
@Override
public void setVisible(final boolean visible)
......@@ -126,7 +127,10 @@ public class DownloadTargetSelector extends JFileChooser
* This method is the main one of the selector.
*
* @param parent
* @return
* the parent
* @param targetFile
* the target file
* @return the file
*/
public static File showSelectorDialog(final Component parent, final File targetFile)
{
......@@ -138,15 +142,12 @@ public class DownloadTargetSelector extends JFileChooser
//
if (selector.showDialog(parent, null) == JFileChooser.APPROVE_OPTION)
{
//
logger.debug("getCurrentDirectory(): {}", selector.getCurrentDirectory());
logger.debug("getSelectedFile() : {}", selector.getSelectedFile());
result = selector.getSelectedFile();
}
else
{
//
result = null;
}
......
/*
* Copyright (C) 2015-2016 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2015-2017 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of FlatDB4GeoNames.
*
......@@ -34,6 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class AutomaticFileSplitter.
*
* @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*
......@@ -51,9 +52,14 @@ public class AutomaticFileSplitter
private PrintWriter out;
/**
* Instantiates a new automatic file splitter.
*
* @param files
* @param referentFile
* the referent file
* @param limit
* the limit
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public AutomaticFileSplitter(final File referentFile, final int limit) throws IOException
{
......@@ -65,37 +71,60 @@ public class AutomaticFileSplitter
}
/**
*
* Close.
*/
public void close()
{
IOUtils.closeQuietly(this.out);
}
/**
* Gets the limit.
*
* @return the limit
*/
public int getLimit()
{
return this.limit;
}
/**
* Gets the line count.
*
* @return the line count
*/
public int getLineCount()
{
return this.lineCount;
}
/**
* Gets the output files.
*
* @return the output files
*/
public Files getOutputFiles()