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 2761e178da
commit ea42bcc63b

View File

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