MCPcopy Create free account
hub / github.com/careercup/ctci / Conversation

Class Conversation

java/Chapter 8/Question8_7/Conversation.java:5–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import java.util.ArrayList;
4
5public abstract class Conversation {
6 protected ArrayList<User> participants = new ArrayList<User>();
7 protected int id;
8 protected ArrayList<Message> messages = new ArrayList<Message>();
9
10 public ArrayList<Message> getMessages() {
11 return messages;
12 }
13
14 public boolean addMessage(Message m) {
15 messages.add(m);
16 return true;
17 }
18
19 public int getId() {
20 return id;
21 }
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected