RetentionKey.java 861 Bytes
Newer Older
zhangxiaoyan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
package com.cy.report.action.model;

public class RetentionKey {
	// installType: 0 normal install, 1 ad install
	// gameType: 0  休息游戏, 1 中度沉迷, 2 重度沉迷
	// maxmin: 0 max, 1 min
	
	private final int numInstallType = 2;
	private final int numGameType = 3;
	private final int numMaxMin = 2;
	private final int size = numInstallType * numGameType * numMaxMin; 
	
	private int offset0 = size;
	private int offset1 = offset0 / numInstallType;
	private int offset2 = offset1 / numGameType;
	private int offset3 = 1;
	
	private int installType;
	private int gameType;
	private int maxmin;
	
	public RetentionKey(int installType, int gameType, int maxmin){
		this.installType = installType;
		this.gameType = gameType;
		this.maxmin = maxmin;
	}
	
	public int index(){
		return offset1 * installType + offset2 * gameType + offset3 * maxmin;
	}

}