|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--support.Flight.StandardOps
Some operations the support code likes to do. You may also want to use them for debugging output, or for allowing the user to input a time.
Note that all functions are static, so you call them as:
StandardOps.printInt(1, 5, '0');And so on.
| Field Summary | |
static int |
NOON
|
| Method Summary | |
static int |
parseInt(java.lang.String str)
Parses the string as an integer. |
static int |
parseTime(java.lang.String str)
Parses a String in the format of printTime(.) as a time. |
static java.lang.String |
printInt(int toprint,
int width,
char fill)
Creates a string corresponding to the integer with the specified width and left-fill. |
static java.lang.String |
printInt(int toprint,
int width,
java.lang.String fill)
Similar to above, but fills with a String. |
static java.lang.String |
printTime(int time)
Creates a string corresponding to the time. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static int NOON
| Method Detail |
public static java.lang.String printInt(int toprint,
int width,
char fill)
Example:
StandardOps.printInt(1, 5, '0');will print
00001
toprint - The integer to printwidth - The minimum width of the integerfill - The character with which to left-fill the string
public static java.lang.String printInt(int toprint,
int width,
java.lang.String fill)
Example:
StandardOps.printInt(1, 5, "abcde");will print
abcd1
toprint - The integer to printwidth - The minimum width of the integerfill - The filler string; uses the substring corresponding to
the first i characters of the filler, where
i is the amount of room free.public static int parseInt(java.lang.String str)
Example:
StandardOps.parseInt(" -09a");
will return -9.str - The string to parse.Integer.parseInt(java.lang.String)public static java.lang.String printTime(int time)
Example:
StandardOps.printTime(60);will print
0100A
time - The time to print, in minutes since midnight.
public static int parseTime(java.lang.String str)
throws java.lang.IllegalArgumentException
Example:
StandardOps.parseTime("0100A");
will return 60.str - The string to parse.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||