1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-08-13 16:53:50 -04:00

Conversation: Added abstract method getType() and added constants TYPE_*

This commit is contained in:
Sebastian Kaspari 2010-03-10 09:37:31 +01:00
parent 1c128cc682
commit 38564ad644
2 changed files with 19 additions and 0 deletions

View File

@ -40,6 +40,14 @@ public class Channel extends Conversation
this.topic = "";
}
/**
* Get the type of this conversation
*/
public int getType()
{
return Conversation.TYPE_CHANNEL;
}
/**
* Set the channel's topic
*

View File

@ -31,12 +31,23 @@ import java.util.LinkedList;
*/
public abstract class Conversation
{
public static final int TYPE_CHANNEL = 1;
public static final int TYPE_QUERY = 2;
public static final int TYPE_SERVER = 3;
private static final int HISTORY_SIZE = 30;
private LinkedList<Message> buffer = new LinkedList<Message>();
private LinkedList<Message> history = new LinkedList<Message>();
private String name;
/**
* Get the type of conversation (channel, query, ..)
*
* @return See the constants: Conversation.TYPE_*
*/
public abstract int getType();
/**
* Create a new conversation with the given name
*