view rep/EditorPlus.java @ 356:b18c24dcc5d2

Before chaning put/join scheme for ditributed select.
author kono
date Sat, 18 Oct 2008 19:01:40 +0900
parents ef4afcae0c92
children fa041bae35f1
line wrap: on
line source

package rep;

import rep.channel.REPSocketChannel;

public class EditorPlus {

	public int eid; // globally unique
	public int sid=-1; // globally unique
	public String host;
	public String file;
	public REPSocketChannel<REPCommand> channel;
	
	public EditorPlus() {
		
	}
	
	public EditorPlus(int eid, REPSocketChannel<REPCommand> channel) {
		this.eid = eid;
		this.channel = channel;
	}

	public String getName() {
		return file;
	}

	public void setName(String string) {
		file = string;
	}


	public void setSID(int sid) {
		this.sid = sid;
	}
	
	public int getSID() {
		return sid;
	}

	public boolean hasSession() {
		return sid != -1;
	}
	
	public String toString(){
		return ("Editor:" + eid);
	}

	public void setEID(int eid) {
		this.eid = eid;
	}
	
	public int getEID(){
		return eid;
	}

	public void setHost(String host){
		if (channel!=null)
			this.host = host;
	}

	
	public String getHost(){
		return host;
	}
	public REPSocketChannel<REPCommand> getChannel(){
		return channel;
		
	}
	public void setChannel(REPSocketChannel<REPCommand> channel) {
		this.channel = channel;		
	}
}