Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.SystemClock
Source: src/com/multiversesocial/hyperview/SystemClock.java

SystemClock

HyperView V3.2 — class
version V3.2 class

Summary

/////////////////////////////////////////////////////// By Tony Swain... - A system clock with a 1 second resolution.

Source file: SystemClock.java

Hierarchy

Extends: none

Implements: Runnable

Referenced HyperView classes

Media files used

Declaration & members

public class SystemClock implements Runnable

Declared in src/com/multiversesocial/hyperview/SystemClock.java, lines 19–409. 28 field(s), 2 constructor(s), 17 method(s). Every member has an anchor you can link to (e.g. SystemClock.html#<id>).

Fields (28)

DeclarationValue / initializerDescriptionSource
static Calendar calendar= Calendar.getInstance()No comment in source; used in run().line 33
static String clock= ""No comment in source; assigned in start(), run(); used in getClockString().line 30
static volatile SystemClock clockBase= nullNo comment in source; assigned in SystemClock(), start(), stop(), getSystemClock(), getClockString().line 29
volatile Thread clockTaskNo comment in source; assigned in start(), stop(); used in run(), join().line 34
static Date date= new Date(System.currentTimeMillis())No comment in source; used in start(), run().line 31
SimpleDateFormat dateFormatNo comment in source; assigned in SystemClock(); used in start(), run().line 48
volatile int dayNo comment in source; assigned in SystemClock(), run().line 45
static final int HOUR= 10 (constant)
source: Calendar.HOUR
No comment in source; used in run().line 26
volatile int hourNo comment in source; assigned in SystemClock(), run().line 44
volatile int idleCountNo comment in source; assigned in SystemClock().line 39
int iterationNo comment in source; assigned in SystemClock().line 37
static final int MINUTE= 12 (constant)
source: Calendar.MINUTE
No comment in source; used in run().line 27
volatile int minuteNo comment in source; assigned in SystemClock(), run().line 43
static final int MONTH= 2 (constant)
source: Calendar.MONTH
No comment in source; used in run().line 24
volatile int monthNo comment in source; assigned in SystemClock(), run().line 46
static final int MONTH_DAY= 5 (constant)
source: Calendar.DAY_OF_MONTH
No comment in source; used in run().line 25
volatile long nowNo comment in source; assigned in SystemClock(), start(), run().line 41
static final int SC_RUNNING= 1 (constant)No comment in source; used in run(), isRunning(); name appears in 1 other source file(s): HyperConnectionHandler.line 21
int scFlagsNo comment in source; assigned in SystemClock(), run(); used in isRunning().line 35
static final int SECOND= 13 (constant)
source: Calendar.SECOND
No comment in source; used in run().line 28
volatile int secondNo comment in source; assigned in SystemClock(), run().line 42
long startTimeNo comment in source; assigned in SystemClock().line 40
int timeoutNo comment in source; assigned in SystemClock().line 38
volatile HyperLinkedList timerListNo comment in source; assigned in SystemClock(); used in run(), getTimer(), addTimer(), remove().line 49
static final String version= "1.3" (constant)No comment in source; used in start().line 22
static int waitTime= 1000No comment in source; assigned in setWaitTime(); used in run(); name appears in 14 other source file(s): CollisionManager, Dispatch, HyperChannel, HyperConnectionHandler ….line 32
static final int YEAR= 1 (constant)
source: Calendar.YEAR
No comment in source; not referenced by name in this type’s methods.line 23
volatile int yearNo comment in source; assigned in SystemClock().line 47

Constructors (2)

SignatureDescriptionSource
SystemClock()17 statement(s); calls super(), System.currentTimeMillis(), Locale.getDefault(), dateFormat.applyPattern(), System.exit(); creates SimpleDateFormat, HyperLinkedList.line 51
SystemClock(HyperConnectionHandler tHandler)17 statement(s); calls super(), System.currentTimeMillis(), Locale.getDefault(), dateFormat.applyPattern(), System.exit(); creates SimpleDateFormat, HyperLinkedList.line 82

Methods (17)

SignatureDescriptionSource
static { … }Implicit default constructor generated by the compiler (not written in the source).implicit
public void addTimer(SystemTimer tTimer)1 statement(s); calls timerList.dlStore(), notifyAll().line 328
public void addTimer(HyperLinkedList tList)1 statement(s); calls timerList.dlStore(), notifyAll().line 363
public void addTimer(SystemTimer[] tTimer, boolean tRepeat)3 statement(s); calls timerList.dlStore(), notifyAll().line 339
static String getClockString()2 statement(s); creates SystemClock.line 266
static SystemClock getSystemClock()2 statement(s); calls clockBase.start(); creates SystemClock.line 256
SystemTimer getTimer()3 statement(s); calls timerList.dlStore(), notifyAll(); creates SystemTimer.line 317
SystemTimer getTimer(int tSeconds)4 statement(s); calls timerList.dlStore(), notifyAll(); creates SystemTimer.line 290
SystemTimer getTimer(int tSeconds, boolean tRepeat)4 statement(s); calls timerList.dlStore(), notifyAll(); creates SystemTimer.line 302
public boolean isRunning()Returns ((scFlags & SC_RUNNING) != 0).line 391
public void join() throws InterruptedException1 statement(s); calls clockTask.join().line 396
public synchronized void remove(Linkable tTimer)1 statement(s); calls timerList.dlDelete().line 372
public synchronized void remove(SystemTimer[] tTimer)3 statement(s); calls timerList.dlDelete().line 377
public void run()5 statement(s); calls Thread.currentThread(), wait(), notifyAll(), System.currentTimeMillis(), date.setTime() ….
Implements Runnable.run()
line 145
void setWaitTime(int tMillis)Sets waitTime = tMillis.line 251
public void start()9 statement(s); calls tTask.interrupt(), clockTask.setName(), System.currentTimeMillis(), date.setTime(), dateFormat.format() …; creates Thread.line 111
public void stop()4 statement(s); calls tThread.interrupt().line 128

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

instantiation — HyperConnectionHandler.java, line 156

  156  clock                      = new SystemClock(this);

static call — SystemTimer.java, line 24

   24  static SystemClock systemClock    = SystemClock.getSystemClock();
Hits--