Skip to content

Commit

Permalink
add a message.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ppzy123 committed Mar 27, 2021
1 parent 1b0790e commit 68c3b3e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/Message.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
class Message {
int user_id;
int sub_id;
String users;
Message(int user_id,int sub_id,String users) {
this.sub_id=sub_id;
this.user_id=user_id;
this.users=users;
}

public int getSub_id() {
return sub_id;
}

public int getUser_id() {
return user_id;
}

public void setSub_id(int sub_id) {
this.sub_id = sub_id;
}

public void setUser_id(int user_id) {
this.user_id = user_id;
}

public String getUsers() {
return users;
}

public void setUsers(String users) {
this.users = users;
}

public void handleMsg(int id) {
String temp="";
String[]ss = users.split(",");
for(int i=0;i<ss.length;i++)
{
if(!Integer.valueOf(id).toString().equals(ss[i])) {
temp += ss[i];
temp+=",";
}
}
temp=temp.substring(0,temp.length()-1);
users=temp;
}
}

0 comments on commit 68c3b3e

Please sign in to comment.