Formatted Chat file

Formatted Getters and Setters
This commit is contained in:
delvh 2019-10-19 10:14:46 +02:00 committed by GitHub
parent ce3d69c6b0
commit 4022e227ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,41 +18,23 @@ public class Chat {
messageList = new ArrayList<Message>();
}
public void setUserID(long givenUserID) {
chatPartnerID = givenUserID;
}
public void setUserID(long givenUserID) { chatPartnerID = givenUserID;}
public long getUserID() {
return chatPartnerID;
}
public long getUserID() { return chatPartnerID;}
public int getSize() {
return chatModel.getSize();
}
public int getSize() { return chatModel.getSize();}
public void addMessage(String message) {
chatModel.addElement(message);
}
public void addMessage(String message) { chatModel.addElement(message);}
public String getMessageAt(int index) {
return (String) chatModel.getElementAt(index);
}
public String getMessageAt(int index) { return (String) chatModel.getElementAt(index);}
@SuppressWarnings("unchecked")
public DefaultListModel<String> getModel() {
return chatModel;
}
public DefaultListModel<String> getModel() { return chatModel;}
public int getListSize() {
return messageList.size();
}
public int getListSize() { return messageList.size();}
public void addMessageElement(Message message) {
messageList.add(message);
}
public void addMessageElement(Message message) { messageList.add(message);}
public Message getMessageElement(int index) {
return messageList.get(index);
}
public Message getMessageElement(int index) { return messageList.get(index);}
}