public final class Utilities
extends java.lang.Object
修飾子とタイプ | メソッドと説明 |
---|---|
static java.util.Set<SPCFile> |
collectSpcFileName(java.nio.file.Path path) |
static double |
computeAIC(double variance,
int n,
int k)
独立データn, 自由度kに対してAICを計算する
|
static java.util.Set<EventFolder> |
eventFolderSet(java.nio.file.Path path)
引数ディレクトリ内のGlobalCMTIDに準ずるイベントフォルダ群
|
static java.lang.String |
fixDecimalPlaces(int n,
double value) |
static java.lang.String |
getClipBoard() |
static java.lang.String |
getTemporaryString()
Create a string for temporary files or w/e
|
static java.util.Set<GlobalCMTID> |
globalCMTIDSet(java.nio.file.Path path) |
static void |
moveSacfile(java.nio.file.Path path,
java.util.function.Predicate<SACFileName> predicate)
Move SAC files that satisfies sacPredicate in event folders under the
path
|
static void |
moveToDirectory(java.nio.file.Path srcPath,
java.nio.file.Path destDirectory,
boolean createDestDir,
java.nio.file.CopyOption... options) |
static void |
println(java.lang.Object... objs)
print all input objects using
PrintStream.println() |
static java.lang.String |
readInputLine() |
static <T> java.util.concurrent.Future<T> |
run(java.util.concurrent.Callable<T> task) |
static long |
runEventProcess(java.nio.file.Path workPath,
java.util.function.Consumer<EventFolder> process,
long timeout,
java.util.concurrent.TimeUnit unit)
Runs process for all event folders under the workPath
|
static java.util.Set<SACFileName> |
sacFileNameSet(java.nio.file.Path path)
Errors in reading each event folder is just noticed.
|
static void |
sendMail(java.lang.String address,
java.lang.String title,
java.lang.String... bodies) |
static double |
toSignificantFigure(int n,
double d) |
static java.lang.String |
toStringWithD(int n,
double d)
Changes an input double value to a string.
|
static java.lang.String |
toTimeString(long nanoSeconds)
Change the input to an intelligible expression.
|
public static java.lang.String toTimeString(long nanoSeconds)
nanoSeconds
- timepublic static java.lang.String getClipBoard() throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
java.awt.datatransfer.UnsupportedFlavorException
- if the clipboard has any that can not be string.java.io.IOException
- if an I/O error occurs.public static java.lang.String readInputLine() throws java.io.IOException
java.io.IOException
- if anypublic static double computeAIC(double variance, int n, int k)
variance
- variancen
- 独立データ数k
- 自由度public static <T> java.util.concurrent.Future<T> run(java.util.concurrent.Callable<T> task)
T
- The result type.task
- to put in another threadpublic static java.util.Set<GlobalCMTID> globalCMTIDSet(java.nio.file.Path path) throws java.io.IOException
path
- Path
for search of GlobalCMTID
java.io.IOException
- if an I/O error occurspublic static java.util.Set<EventFolder> eventFolderSet(java.nio.file.Path path) throws java.io.IOException
path
- Path of a folder containing event folders.EventFolder
in the workPathjava.io.IOException
- if an I/O error occurspublic static java.util.Set<SACFileName> sacFileNameSet(java.nio.file.Path path) throws java.io.IOException
path
- of a folder containing event folders which have SAC files.java.io.IOException
- if an I/O error occurs.public static long runEventProcess(java.nio.file.Path workPath, java.util.function.Consumer<EventFolder> process, long timeout, java.util.concurrent.TimeUnit unit) throws java.io.IOException, java.lang.InterruptedException
workPath
- where this looks for event foldersprocess
- Consumer
for each eventtimeout
- timeout for the processunit
- unit of the timeoutjava.lang.InterruptedException
- if the process takes over 30 minutesjava.io.IOException
- if an I/O error occurspublic static void moveSacfile(java.nio.file.Path path, java.util.function.Predicate<SACFileName> predicate) throws java.io.IOException, java.lang.InterruptedException
path
- working pathpredicate
- if true with a sacfile in event folders, the file is moved to
the directory.java.lang.InterruptedException
- if the process takes over 30 minutesjava.io.IOException
- if an I/O error occurspublic static java.lang.String getTemporaryString()
public static double toSignificantFigure(int n, double d)
n
- the effective digitd
- value to changepublic static java.lang.String fixDecimalPlaces(int n, double value)
n
- number of decimal placesvalue
- to fixpublic static java.util.Set<SPCFile> collectSpcFileName(java.nio.file.Path path) throws java.io.IOException
path
- Path
to look for FormattedSPCFile
inSPCFile
in the dirjava.io.IOException
- if an I/O error occurspublic static void println(java.lang.Object... objs)
PrintStream.println()
objs
- to be printedpublic static void moveToDirectory(java.nio.file.Path srcPath, java.nio.file.Path destDirectory, boolean createDestDir, java.nio.file.CopyOption... options) throws java.io.IOException
srcPath
- Path
of the file to be moveddestDirectory
- Path
of the destination directorycreateDestDir
- If true
create the destination directory, otherwise if
false
throw an IOExceptionoptions
- for copyingjava.io.IOException
- if an I/O error occurspublic static java.lang.String toStringWithD(int n, double d)
n
- the number of decimal places (Note that if decimal is 0, this
value will be ignored)d
- to be changedpublic static void sendMail(java.lang.String address, java.lang.String title, java.lang.String... bodies) throws java.net.URISyntaxException, java.io.IOException
java.net.URISyntaxException
java.io.IOException