|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectInputData
public class InputData
A general helper class that reads data form keyboard or files...
| Field Summary | |
|---|---|
private static java.lang.String |
checkDigits
|
static int |
numberOfLines
The maximum number of lines in a text file that is read into an array when reading the file. |
| Constructor Summary | |
|---|---|
InputData()
|
|
| Method Summary | |
|---|---|
static double[] |
convertStrToDble(java.lang.String[] s)
Converts a String[] with double or int values to a double[]. |
static double[] |
dataStats(java.lang.String s)
Takes filename s with file that has int or doubles and returns sum, mean, SD, min, max in a double[] of size 5 in this order. |
static void |
deleteDoubleFiles(java.lang.String extracted,
java.lang.String rar,
java.lang.String resultTxtFile)
If a RAR was extracted, this prepares the WIndows DOS cmd command to delete the original RAR files. |
static java.lang.String[] |
getData(java.lang.String ss)
Requests to get input data from a file or keyboard, than returns it in a String[], where everything was split by spaces. |
static java.lang.String |
ISBN10to13(java.lang.String ISBN)
Convert ISBN-10 to ISBN-13 |
static java.lang.String |
ISBN13to10(java.lang.String ISBN)
Convert ISBN-13 to ISBN-10 |
static java.lang.String[] |
keyboardEntry()
Reads data from keyboard. |
static java.lang.String[] |
readFile(java.lang.String fileName)
Reads data from file. |
static java.lang.String |
removeSpace(java.lang.String s)
|
private static java.lang.String[] |
split(java.lang.String[] st,
int i)
Splits an array of strings into smaller strings by spaces. |
static double[] |
stat(double[] db)
Calculates sum, mean, SD, min, max. |
static void |
writeFile(java.lang.String[] s,
java.lang.String filenme,
boolean append)
Writes a String[] to file, each index is a new line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.lang.String checkDigits
public static final int numberOfLines
| Constructor Detail |
|---|
public InputData()
| Method Detail |
|---|
public static double[] dataStats(java.lang.String s)
public static java.lang.String[] getData(java.lang.String ss)
public static java.lang.String[] keyboardEntry()
throws java.io.IOException
java.io.IOException
public static java.lang.String[] readFile(java.lang.String fileName)
throws java.io.IOException,
java.io.FileNotFoundException
java.io.IOException
java.io.FileNotFoundException
public static void writeFile(java.lang.String[] s,
java.lang.String filenme,
boolean append)
s - The String[] to write to the filefilenme - The name and full path of the output text file.append - true if you wish to append the array to the end of the text file, false to replace and create a new text file.
private static java.lang.String[] split(java.lang.String[] st,
int i)
st - The original String[]i - - number of indexes filled, should be the min if unknown. It doesn't remove extra empty lines
public static java.lang.String removeSpace(java.lang.String s)
public static double[] convertStrToDble(java.lang.String[] s)
public static double[] stat(double[] db)
db - a double array with double values
public static java.lang.String ISBN13to10(java.lang.String ISBN)
throws java.lang.NumberFormatException
ISBN - an ISBN-13
java.lang.NumberFormatException
public static java.lang.String ISBN10to13(java.lang.String ISBN)
throws java.lang.NumberFormatException
ISBN - an ISBN-10
java.lang.NumberFormatException
public static void deleteDoubleFiles(java.lang.String extracted,
java.lang.String rar,
java.lang.String resultTxtFile)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||