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
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
clear()
Resetsthis
to an initial value.final int
elapsed()
Returnsthis.time
in milliseconds.final boolean
final int
hashCode()
final boolean
Returnsthis.running
.final Stopwatch
Returns a new object with the same dynamic type asthis
, having an initial value.final void
start()
Startsthis
.final void
stop()
Stopsthis
.final String
toString()
final void
transferFrom
(Stopwatch source) Setsthis
to the incoming value ofsource
, and resetssource
to an initial value; the declaration notwithstanding, the dynamic type ofsource
must be the same as the dynamic type ofthis
.
-
Constructor Details
-
Stopwatch1
public Stopwatch1()No-argument constructor.
-
-
Method Details
-
newInstance
Description copied from interface:Standard
Returns a new object with the same dynamic type asthis
, having an initial value. If the typeT
has a no-argument constructor, then the value of the new returned object satisfies the contract of the no-argument constructor forT
. IfT
does 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:
newInstance
in interfaceStandard<Stopwatch>
- Returns:
- new object "like"
this
with an initial value
-
clear
Description copied from interface:Standard
Resetsthis
to an initial value. If the typeT
has a no-argument constructor, thenthis
satisfies the contract of the no-argument constructor forT
. IfT
does not have a no-argument constructor, thenthis
satisfies the contract of the constructor call that was used to initialize#this
. -
transferFrom
Description copied from interface:Standard
Setsthis
to the incoming value ofsource
, and resetssource
to an initial value; the declaration notwithstanding, the dynamic type ofsource
must be the same as the dynamic type ofthis
. If the typeT
has a no-argument constructor, thensource
satisfies the contract of the no-argument constructor forT
. IfT
does not have a no-argument constructor, thensource
satisfies the contract of the constructor call that was used to initialize#source
.- Specified by:
transferFrom
in interfaceStandard<Stopwatch>
- Parameters:
source
- object whose value is to be transferred
-
start
Description copied from interface:Stopwatch
Startsthis
. -
stop
Description copied from interface:Stopwatch
Stopsthis
. -
elapsed
Description copied from interface:Stopwatch
Returnsthis.time
in milliseconds. -
isRunning
Description copied from interface:Stopwatch
Returnsthis.running
. -
equals
-
hashCode
-
toString
-