@@ -36,22 +36,15 @@ class BowlerFile {
36
36
*
37
37
*/
38
38
39
- public static Bowler getBowlerInfo (String nickName )
40
- throws IOException , FileNotFoundException {
39
+ public static Bowler getBowlerInfo (String nickName ) throws IOException , FileNotFoundException {
41
40
42
41
BufferedReader in = new BufferedReader (new FileReader (BOWLER_DAT ));
43
42
String data ;
44
43
while ((data = in .readLine ()) != null ) {
45
44
// File format is nick\tfname\te-mail
46
45
String [] bowler = data .split ("\t " );
47
46
if (nickName .equals (bowler [0 ])) {
48
- System .out .println (
49
- "Nick: "
50
- + bowler [0 ]
51
- + " Full: "
52
- + bowler [1 ]
53
- + " email: "
54
- + bowler [2 ]);
47
+ System .out .println ("Nick: " + bowler [0 ] + " Full: " + bowler [1 ] + " email: " + bowler [2 ]);
55
48
return (new Bowler (bowler [0 ], bowler [1 ], bowler [2 ]));
56
49
}
57
50
}
@@ -68,14 +61,9 @@ public static Bowler getBowlerInfo(String nickName)
68
61
*
69
62
*/
70
63
71
- public static void putBowlerInfo (
72
- String nickName ,
73
- String fullName ,
74
- String email )
64
+ public static void putBowlerInfo (String nickName ,String fullName ,String email )
75
65
throws IOException , FileNotFoundException {
76
-
77
66
String data = nickName + "\t " + fullName + "\t " + email + "\n " ;
78
-
79
67
RandomAccessFile out = new RandomAccessFile (BOWLER_DAT , "rw" );
80
68
out .skipBytes ((int ) out .length ());
81
69
out .writeBytes (data );
@@ -89,11 +77,8 @@ public static void putBowlerInfo(
89
77
*
90
78
*/
91
79
92
- public static Vector getBowlers ()
93
- throws IOException , FileNotFoundException {
94
-
80
+ public static Vector getBowlers ()throws IOException , FileNotFoundException {
95
81
Vector allBowlers = new Vector ();
96
-
97
82
BufferedReader in = new BufferedReader (new FileReader (BOWLER_DAT ));
98
83
String data ;
99
84
while ((data = in .readLine ()) != null ) {
@@ -105,4 +90,4 @@ public static Vector getBowlers()
105
90
return allBowlers ;
106
91
}
107
92
108
- }
93
+ }
0 commit comments