-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.java
More file actions
51 lines (29 loc) · 1.06 KB
/
Person.java
File metadata and controls
51 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.io.*;
import java.net.*;
public class Person{
private String name;
private Socket socket;
private Boolean isConnected;
private PrintStream outStream;
public Person(Socket socket, PrintStream stream ){
this.isConnected = true;
this.socket = socket;
this.outStream = stream;
}
public PrintStream getOutStream() {
return outStream;
}
public void setOutStream(PrintStream outStream) {
this.outStream = outStream;
}
public void printOut(String input){
outStream.println(input);
}
public void setSocket(Socket socket){ this.socket = socket;}
public Socket getSocket(){ return this.socket;}
public void setName(String name){ this.name = name;}
public String getName(){ return this.name;}
public boolean getIsConnected(){return this.isConnected;}
public void setIsConnected(Boolean bool){ this.isConnected = bool;}
public void closeOutstream(){ this.outStream.close();}
}