Mercurial > hg > RemoteEditor > REPSessionManager
view rep/REP.java @ 343:21ad256c25c2
*** empty log message ***
author | kono |
---|---|
date | Mon, 13 Oct 2008 13:16:31 +0900 |
parents | a9a740e685fa |
children | f0bd158dace6 |
line wrap: on
line source
package rep; public enum REP { REPCMD_OPEN ( 1), REPCMD_OPEN_ACK ( 2), REPCMD_READ ( 3), REPCMD_READ_ACK ( 4), REPCMD_INSERT ( 6), REPCMD_INSERT_ACK ( 7), REPCMD_DELETE ( 9), REPCMD_DELETE_ACK ( 10), REPCMD_CLOSE ( 11), REPCMD_CLOSE_2 ( 12), REPCMD_REPLACE ( 13), REPCMD_REPLACE_ACK ( 14), REPCMD_NOP ( 15), SMCMD_JOIN ( 41), SMCMD_JOIN_ACK ( 42), SMCMD_GET ( 43), SMCMD_GET_ACK ( 44), SMCMD_PUT ( 45), SMCMD_PUT_ACK ( 46), SMCMD_SELECT ( 47), SMCMD_SELECT_ACK ( 48), SMCMD_REGISTER ( 49), SMCMD_REGISTER_ACK ( 50), SMCMD_DEREGISTER ( 51), SMCMD_DEREGISTER_ACK( 52), SMCMD_QUIT ( 53), SMCMD_QUIT_ACK ( 54), SMCMD_SESSION ( 60), SMCMD_SESSION_ACK ( 61), SMCMD_SM_JOIN ( 62), SMCMD_SM_JOIN_ACK ( 63), SMCMD_UPDATE ( 65), SMCMD_UPDATE_ACK ( 66), SMCMD_GET_UNDO ( 71), SMCMD_GET_UNDO_ACK ( 72), SMCMD_UNDO_REPLACE ( 73), SMCMD_START_MERGE ( 75), SMCMD_START_MERGE_ACK ( 76), SMCMD_END_MERGE ( 77), SMCMD_QUIT_2 ( 67), SMCMD_QUIT_2_ACK ( 68), SM_EID ( -1), MERGE_EID ( -2), SMCMD_CH_MASTER ( 80), SMCMD_UPDATE_UP ( 81), SMCMD_UPDATE_DOWN ( 82), SMCMD_SYNC ( 83), SMCMD_SYNC_ACK ( 84); public final int id; REP(int id) { this.id = id; } static int max = 0; static int min = 100; static REP rep[] ; static { // Certainly this is ridiculous... for (REP r : REP.values()) { if (max<r.id) max = r.id; if (min>r.id) min = r.id; } rep = new REP[max-min+1]; for (REP r : REP.values()) { rep[r.id-min] = r; } } public static REP newREP(int id) { // return new REP(id); this does not work... return rep[id-min]; } }