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; } }