X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2Ftools%2FProcessRunning.java;h=be2a9ecb373100dae5e165c10400b47196078721;hb=3087ea10ac51cf1a8b2eb8d8abe010513ce9998f;hp=4630f28fde19588106065ba3d157ad13f1d867cf;hpb=48d8b16f44043d4bfe721af7be48e15b31fb3f18;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/tools/ProcessRunning.java b/forester/java/src/org/forester/archaeopteryx/tools/ProcessRunning.java index 4630f28..be2a9ec 100644 --- a/forester/java/src/org/forester/archaeopteryx/tools/ProcessRunning.java +++ b/forester/java/src/org/forester/archaeopteryx/tools/ProcessRunning.java @@ -21,46 +21,49 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.archaeopteryx.tools; import java.text.SimpleDateFormat; import java.util.Calendar; -final class ProcessRunning { +final public class ProcessRunning { - private static int count = 0; - final private int _id; + private static long count = 0; + final private long _id; final private String _name; final private String _start; - int getId() { + public long getId() { return _id; } - - String getName() { + + public String getName() { return _name; } - - String getStart() { + + public String getStart() { return _start; } - + + @Override public String toString() { return getName() + " [id=" + getId() + "] [start=" + getStart() + "]"; } - + synchronized static ProcessRunning createInstance( final String name ) { final Calendar cal = Calendar.getInstance(); final SimpleDateFormat sdf = new SimpleDateFormat( "HH:mm:ss" ); return new ProcessRunning( count++, name, sdf.format( cal.getTime() ) ); } - - private ProcessRunning( final int id, final String name, final String start ) { + + private ProcessRunning( final long id, final String name, final String start ) { + if ( id < 0 ) { + throw new IllegalArgumentException( "process id cannot be negative" ); + } _id = id; _name = name; - _start = start; + _start = start; } - }