Package components.stopwatch
Class Stopwatch1
java.lang.Object
components.stopwatch.Stopwatch1
Stopwatch represented with two integers and a boolean, with
implementations of all methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclear()Resetsthisto an initial value.final intelapsed()Returnsthis.timein milliseconds.final booleanfinal inthashCode()final booleanReturnsthis.running.final StopwatchReturns a new object with the same dynamic type asthis, having an initial value.final voidstart()Startsthis.final voidstop()Stopsthis.final StringtoString()final voidtransferFrom(Stopwatch source) Setsthisto the incoming value ofsource, and resetssourceto an initial value; the declaration notwithstanding, the dynamic type ofsourcemust be the same as the dynamic type ofthis.
-
Constructor Details
-
Stopwatch1
public Stopwatch1()No-argument constructor.
-
-
Method Details
-
newInstance
Description copied from interface:StandardReturns a new object with the same dynamic type asthis, having an initial value. If the typeThas a no-argument constructor, then the value of the new returned object satisfies the contract of the no-argument constructor forT. IfTdoes not have a no-argument constructor, then the value of the new returned object satisfies the contract of the constructor call that was used to initializethis.- Specified by:
newInstancein interfaceStandard<Stopwatch>- Returns:
- new object "like"
thiswith an initial value
-
clear
Description copied from interface:StandardResetsthisto an initial value. If the typeThas a no-argument constructor, thenthissatisfies the contract of the no-argument constructor forT. IfTdoes not have a no-argument constructor, thenthissatisfies the contract of the constructor call that was used to initialize#this. -
transferFrom
Description copied from interface:StandardSetsthisto the incoming value ofsource, and resetssourceto an initial value; the declaration notwithstanding, the dynamic type ofsourcemust be the same as the dynamic type ofthis. If the typeThas a no-argument constructor, thensourcesatisfies the contract of the no-argument constructor forT. IfTdoes not have a no-argument constructor, thensourcesatisfies the contract of the constructor call that was used to initialize#source.- Specified by:
transferFromin interfaceStandard<Stopwatch>- Parameters:
source- object whose value is to be transferred
-
start
Description copied from interface:StopwatchStartsthis. -
stop
Description copied from interface:StopwatchStopsthis. -
elapsed
Description copied from interface:StopwatchReturnsthis.timein milliseconds. -
isRunning
Description copied from interface:StopwatchReturnsthis.running. -
equals
-
hashCode
-
toString
-