net.thestump.ghronos.timing.ot
Class JapaneseBY

java.lang.Object
  extended bynet.thestump.ghronos.timing.TimingStyle
      extended bynet.thestump.ghronos.timing.ot.OvertimeStyle
          extended bynet.thestump.ghronos.timing.ot.JapaneseBY
All Implemented Interfaces:
superwaba.ext.xplat.io.Storable

public class JapaneseBY
extends OvertimeStyle

Provides a Japanese Byo-Yomi timing style.

Author:
Christopher C. Stump

Field Summary
static byte ID
          Timing style/Storable ID
static java.lang.String NAME
          Name of timing style
 
Fields inherited from class net.thestump.ghronos.timing.ot.OvertimeStyle
bottomClockInOt, clockIsInOvertime, isAppliedTo, overtime, topClockInOt, topClockIsTicking
 
Fields inherited from class net.thestump.ghronos.timing.TimingStyle
appliedToBottomClock, appliedToTopClock, toStart, toStop
 
Constructor Summary
JapaneseBY()
           
 
Method Summary
protected  void evaluate(Clock topClock, Clock bottomClock)
          Helper method used to set members describing current state
 void execute(Clock tickingClock)
          Runs an overtime check on tickingClock when it runs out of time to see if it should go into overtime or not
 void execute(Clock topClock, Clock bottomClock)
          Applies the timing style to the appropriate clocks on a clock switch
 java.lang.String getDescription()
          Gets a description of this timing style which is used to display information about the timing style in a help dialog
 byte getID()
           
 superwaba.ext.xplat.io.Storable getInstance()
           
 int getPeriods()
          Gets the number of periods set for the overtime sessions
 int getPeriodsLeft(char clock)
          Gets the number of periods left for the current overtime session
 void loadState(superwaba.ext.xplat.io.DataStream ds)
           
 void onRegister(Clock topClock, Clock bottomClock)
          Called when this TimingStyle is registered with the Mediator.
 void onUnRegister(Clock topClock, Clock bottomClock)
          Called when this TimingStyle is unregistered with the Mediator (when another TimingStyle is registered).
 void reset()
          Perform any resetting the timing style may need in between usages.
 void saveState(superwaba.ext.xplat.io.DataStream ds)
           
 void setPeriods(int per)
          Sets the number of periods for the overtime sessions
 java.lang.String toString()
           
 
Methods inherited from class net.thestump.ghronos.timing.ot.OvertimeStyle
getOvertime, isInOvertime, setOvertime, setOvertime
 
Methods inherited from class net.thestump.ghronos.timing.TimingStyle
applyTo, isAppliedTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final byte ID
Timing style/Storable ID

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Name of timing style

See Also:
Constant Field Values
Constructor Detail

JapaneseBY

public JapaneseBY()
Method Detail

getPeriods

public int getPeriods()
Gets the number of periods set for the overtime sessions

Returns:
The set number of periods, as provided by the user

setPeriods

public void setPeriods(int per)
Sets the number of periods for the overtime sessions

Parameters:
per - The number of periods

onRegister

public void onRegister(Clock topClock,
                       Clock bottomClock)
Description copied from class: TimingStyle
Called when this TimingStyle is registered with the Mediator. Is a place holder to do work before just before the timing style is actually used. Does nothing by default. Note that this method IS NOT called when a timing style is recalled from the database

Overrides:
onRegister in class TimingStyle
Parameters:
topClock -
bottomClock -

onUnRegister

public void onUnRegister(Clock topClock,
                         Clock bottomClock)
Description copied from class: TimingStyle
Called when this TimingStyle is unregistered with the Mediator (when another TimingStyle is registered). Is a place holder to do work before just before the timing style is trashed. Does nothing by default.

Overrides:
onUnRegister in class TimingStyle
Parameters:
topClock -
bottomClock -

reset

public void reset()
Description copied from class: OvertimeStyle
Perform any resetting the timing style may need in between usages.

Overrides:
reset in class OvertimeStyle

getPeriodsLeft

public int getPeriodsLeft(char clock)
Gets the number of periods left for the current overtime session

Parameters:
clock - 't' if we want the periods of the top clock, 'b' if we want the periods of the bottom clock
Returns:
The number of periods left in this overtime session, or -1 if clock is not 't' or 'b'

execute

public void execute(Clock topClock,
                    Clock bottomClock)
Description copied from class: TimingStyle
Applies the timing style to the appropriate clocks on a clock switch

Specified by:
execute in class OvertimeStyle

execute

public void execute(Clock tickingClock)
Description copied from class: OvertimeStyle
Runs an overtime check on tickingClock when it runs out of time to see if it should go into overtime or not

Specified by:
execute in class OvertimeStyle
Parameters:
tickingClock - The currently ticking clock which should be checked for overtime

toString

public java.lang.String toString()

getID

public byte getID()
Specified by:
getID in interface superwaba.ext.xplat.io.Storable
Specified by:
getID in class OvertimeStyle

getInstance

public superwaba.ext.xplat.io.Storable getInstance()
Specified by:
getInstance in interface superwaba.ext.xplat.io.Storable
Specified by:
getInstance in class OvertimeStyle

saveState

public void saveState(superwaba.ext.xplat.io.DataStream ds)
Specified by:
saveState in interface superwaba.ext.xplat.io.Storable
Overrides:
saveState in class OvertimeStyle

loadState

public void loadState(superwaba.ext.xplat.io.DataStream ds)
Specified by:
loadState in interface superwaba.ext.xplat.io.Storable
Overrides:
loadState in class OvertimeStyle

getDescription

public java.lang.String getDescription()
Description copied from class: TimingStyle
Gets a description of this timing style which is used to display information about the timing style in a help dialog

Specified by:
getDescription in class TimingStyle
Returns:
A brief description of how the timing style operates.

evaluate

protected void evaluate(Clock topClock,
                        Clock bottomClock)
Description copied from class: TimingStyle
Helper method used to set members describing current state

Overrides:
evaluate in class OvertimeStyle


Copyright © 2004 Christopher C. Stump. All Rights Reserved.