Docsity

Classe Time3: Documentação do Construtor e Métodos, Exercícios de Engenharia Química

Toggle sidebar
bg1
Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
com.deitel.jhtp4.appenF
Class Time3
java.lang.Object
|
+--com.deitel.jhtp4.appenF.Time3
public class Time3
extends java.lang.Object
This class maintains the time in 24-hour format.
Author:
Deitel & Associates, Inc.
See Also:
Object
Constructor Summary
Time3()
Time3 constructor initializes each instance variable to zero.
Time3(int h)
Time3 constructor: hour supplied, minute and second defaulted to 0
Time3(int h, int m)
Time3 constructor: hour and minute supplied, second defaulted to 0
Time3(int h, int m, int s)
Time3 constructor: hour, minute and second supplied
Time3(Time3 time)
Time3 constructor: another Time3 object supplied
Method Summary
int getHour()
Gets the hour
pf3
pf4
pf5

Pré-visualização parcial do texto

Baixe Classe Time3: Documentação do Construtor e Métodos e outras Exercícios em PDF para Engenharia Química, somente na Docsity!

Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES^ NO FRAMES SUMMARY: INNER | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD com.deitel.jhtp4.appenF

Class Time

java.lang.Object | +-- com.deitel.jhtp4.appenF.Time public class Time extends java.lang.Object This class maintains the time in 24-hour format. Author: Deitel & Associates, Inc. See Also: Object

Constructor Summary

Time3 () Time3 constructor initializes each instance variable to zero. Time3 (int h) Time3 constructor: hour supplied, minute and second defaulted to 0 Time3 (int h, int m) Time3 constructor: hour and minute supplied, second defaulted to 0 Time3 (int h, int m, int s) Time3 constructor: hour, minute and second supplied Time3 (Time3 time) Time3 constructor: another Time3 object supplied

Method Summary

int (^) getHour () Gets the hour

int (^) getMinute () Gets the minute int (^) getSecond () Gets the second void (^) setHour (int h) Sets the hour void (^) setMinute (int m) Sets the minute void (^) setSecond (int s) Sets the second void (^) setTime (int h, int m, int s) Set a new time value using universal time. java.lang.String (^) toString () Convert to String in standard-time format java.lang.String (^) toUniversalString () Convert to String in universal-time format Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

Time

public Time3 () throws java.lang.Exception Time3 constructor initializes each instance variable to zero. Ensures that Time object starts in a consistent state. Throws: Exception - in the case of an invalid time

Time

public Time3 (inth) throws java.lang.Exception Time3 constructor: hour supplied, minute and second defaulted to 0

throws java.lang.Exception Set a new time value using universal time. Perform validity checks on data. Set invalid values to zero. Parameters: h - the hour m - the minute s - the second Throws: Exception - in the case of an invalid time See Also: setHour(int), setMinute(int), setSecond(int)

setHour

public void setHour (inth) throws java.lang.Exception Sets the hour Parameters: h - the hour Throws: java.lang.Exception - in the case of an invalid time

setMinute

public void setMinute (intm) throws java.lang.Exception Sets the minute Parameters: m - the minute Throws: java.lang.Exception - in the case of an invalid time

setSecond

public void setSecond (ints) throws java.lang.Exception Sets the second Parameters: m - the minute Throws: java.lang.Exception - in the case of an invalid time

getHour

public int getHour ()

Gets the hour Returns: an int specifying the hour.

getMinute

public int getMinute () Gets the minute Returns: an int specifying the minute.

getSecond

public int getSecond () Gets the second Returns: an int specifying the second.

toUniversalString

public java.lang.String toUniversalString () Convert to String in universal-time format Returns: a String representation of the time in universal-time format

toString

public java.lang.String toString () Convert to String in standard-time format Overrides: toString in class java.lang.Object Returns: a String representation of the time in standard-time format Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES^ NO FRAMES SUMMARY: INNER | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD