private bool needsEmptyVersion(ContextPair contextPair) { UnitContext leftContext = contextPair.getLeftContext(); Unit[] units = leftContext.getUnits(); return(units.Length > 0 && this.getRightContextSize(units[0]) < this.getRightContextSize()); }
internal virtual UnitContext generateNextLeftContext(UnitContext unitContext, Unit unit) { Unit[] units = unitContext.getUnits(); int num = Math.min(units.Length, this.getLeftContextSize()); if (num == 0) { return(UnitContext.EMPTY); } Unit[] array = (Unit[])Arrays.copyOfRange(units, 1, num + 1); array[num - 1] = unit; return(UnitContext.get(array)); }
private Unit[] getRC(Unit[] array, int num, UnitContext unitContext) { Unit[] units = unitContext.getUnits(); int num2 = num + 1; int num3 = array.Length - num2 + units.Length; int num4 = Math.min(num3, this.getRightContextSize(array[num])); Unit[] array2 = new Unit[num4]; for (int i = 0; i < array2.Length; i++) { int num5 = num2 + i; if (num5 < array.Length) { array2[i] = array[num5]; } else { array2[i] = units[num5 - array.Length]; } } return(array2); }
private Unit[] getLC(UnitContext unitContext, Unit[] array, int num) { Unit[] units = unitContext.getUnits(); int num2 = units.Length + num; int num3 = Math.min(num2, this.getLeftContextSize(array[num])); int num4 = num - num3; Unit[] array2 = new Unit[num3]; for (int i = 0; i < array2.Length; i++) { int num5 = num4 + i; if (num5 < 0) { array2[i] = units[units.Length + num5]; } else { array2[i] = array[num5]; } } return(array2); }