All files / output zcl_abapgit_zlib_huffman.clas.mjs

97.56% Statements 240/246
84.44% Branches 38/45
20.68% Functions 6/29
97.56% Lines 240/246

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 2461x 1x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 1x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 195x 195x 195x 13x 13x 1498x 1498x 719x 719x 779x 779x 779x 779x 779x 13x 13x 13x 13x 182x 182x 182x 182x 182x 182x 182x 13x 13x 13x 13x 1498x 1498x 1498x 13x 13x 13x 13x 1498x 1498x 1498x 1498x 1498x 1498x 719x 719x 779x 779x 779x 779x 779x 779x 779x 779x 779x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 13x 6833x 6833x 6833x 6833x 6833x 6833x 1400x 6833x 1397x 5433x 1343x 4036x 1080x 2693x 751x 1613x 465x 862x 258x 397x 99x 139x 27x 40x 12x 13x   1x   1x   1x   1x 1x 1x     6833x 6833x 13x 1403x 1403x 1403x 1403x 1403x 1403x 1403x 1403x 13x 1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_zlib_huffman.clas.abap
class zcl_abapgit_zlib_huffman {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_ZLIB_HUFFMAN';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"MT_COUNT": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MT_SYMBOL": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT01": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT02": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT03": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT04": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT05": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT06": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT07": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT08": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT09": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT10": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT11": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT12": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT13": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT14": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MV_BIT15": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "C_MAXBITS": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"CONSTRUCTOR": {"visibility": "U", "parameters": {"IT_LENGTHS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_zlib_huffman=>ty_lengths");}, "is_optional": " ", "parm_kind": "I", "type_name": "TableType"}}},
  "GET_COUNT": {"visibility": "U", "parameters": {"RV_VALUE": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "R", "type_name": "IntegerType"}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "I", "type_name": "IntegerType"}}},
  "GET_SYMBOL": {"visibility": "U", "parameters": {"RV_VALUE": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "R", "type_name": "IntegerType"}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " ", "parm_kind": "I", "type_name": "IntegerType"}}}};
  #mt_count;
  #mt_symbol;
  #mv_bit01;
  #mv_bit02;
  #mv_bit03;
  #mv_bit04;
  #mv_bit05;
  #mv_bit06;
  #mv_bit07;
  #mv_bit08;
  #mv_bit09;
  #mv_bit10;
  #mv_bit11;
  #mv_bit12;
  #mv_bit13;
  #mv_bit14;
  #mv_bit15;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "get_count": this.get_count.bind(this),
      "get_symbol": this.get_symbol.bind(this),
    };
    this.#mt_count = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.FRIENDS_ACCESS_INSTANCE["mt_count"] = this.#mt_count;
    this.#mt_symbol = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.FRIENDS_ACCESS_INSTANCE["mt_symbol"] = this.#mt_symbol;
    this.#mv_bit01 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit01"] = this.#mv_bit01;
    this.#mv_bit02 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit02"] = this.#mv_bit02;
    this.#mv_bit03 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit03"] = this.#mv_bit03;
    this.#mv_bit04 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit04"] = this.#mv_bit04;
    this.#mv_bit05 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit05"] = this.#mv_bit05;
    this.#mv_bit06 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit06"] = this.#mv_bit06;
    this.#mv_bit07 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit07"] = this.#mv_bit07;
    this.#mv_bit08 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit08"] = this.#mv_bit08;
    this.#mv_bit09 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit09"] = this.#mv_bit09;
    this.#mv_bit10 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit10"] = this.#mv_bit10;
    this.#mv_bit11 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit11"] = this.#mv_bit11;
    this.#mv_bit12 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit12"] = this.#mv_bit12;
    this.#mv_bit13 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit13"] = this.#mv_bit13;
    this.#mv_bit14 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit14"] = this.#mv_bit14;
    this.#mv_bit15 = new abap.types.Integer({qualifiedName: "I"});
    this.FRIENDS_ACCESS_INSTANCE["mv_bit15"] = this.#mv_bit15;
    this.c_maxbits = zcl_abapgit_zlib_huffman.c_maxbits;
  }
  async constructor_(INPUT) {
    let it_lengths = INPUT?.it_lengths;
    if (it_lengths?.getQualifiedName === undefined || it_lengths.getQualifiedName() !== "ZCL_ABAPGIT_ZLIB_HUFFMAN=>TY_LENGTHS") { it_lengths = undefined; }
    if (it_lengths === undefined) { it_lengths = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_zlib_huffman=>ty_lengths").set(INPUT.it_lengths); }
    let lv_index = new abap.types.Integer({qualifiedName: "I"});
    let lt_offset = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    let lv_prev = new abap.types.Integer({qualifiedName: "I"});
    let lv_count = new abap.types.Integer({qualifiedName: "I"});
    let fs_lv_offset_ = new abap.types.FieldSymbol(new abap.types.Integer({qualifiedName: "I"}));
    let fs_lv_symbol_ = new abap.types.FieldSymbol(new abap.types.Integer({qualifiedName: "I"}));
    let fs_lv_i_ = new abap.types.FieldSymbol(new abap.types.Integer({qualifiedName: "I"}));
    const indexBackup1 = abap.builtin.sy.get().index.get();
    const unique469 = zcl_abapgit_zlib_huffman.c_maxbits.get();
    for (let unique470 = 0; unique470 < unique469; unique470++) {
      abap.builtin.sy.get().index.set(unique470 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(0), target: this.#mt_count});
    }
    abap.builtin.sy.get().index.set(indexBackup1);
    for await (const unique471 of abap.statements.loop(it_lengths)) {
      lv_index.set(unique471);
      if (abap.compare.eq(lv_index, abap.IntegerFactory.get(0))) {
        continue;
      }
      abap.statements.readTable(this.#mt_count,{index: lv_index,
        assigning: fs_lv_i_});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      fs_lv_i_.set(abap.operators.add(fs_lv_i_,abap.IntegerFactory.get(1)));
    }
    abap.statements.append({source: abap.IntegerFactory.get(0), target: lt_offset});
    const indexBackup2 = abap.builtin.sy.get().index.get();
    const unique472 = abap.operators.minus(zcl_abapgit_zlib_huffman.c_maxbits.get(),abap.IntegerFactory.get(1).get()).get();
    for (let unique473 = 0; unique473 < unique472; unique473++) {
      abap.builtin.sy.get().index.set(unique473 + 1);
      abap.statements.readTable(this.#mt_count,{index: abap.builtin.sy.get().index,
        into: lv_count});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      lv_prev.set(abap.operators.add(lv_prev,lv_count));
      abap.statements.append({source: lv_prev, target: lt_offset});
    }
    abap.builtin.sy.get().index.set(indexBackup2);
    const indexBackup3 = abap.builtin.sy.get().index.get();
    const unique474 = abap.builtin.lines({val: it_lengths}).get();
    for (let unique475 = 0; unique475 < unique474; unique475++) {
      abap.builtin.sy.get().index.set(unique475 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(0), target: this.#mt_symbol});
    }
    abap.builtin.sy.get().index.set(indexBackup3);
    const indexBackup4 = abap.builtin.sy.get().index.get();
    const unique476 = abap.builtin.lines({val: it_lengths}).get();
    for (let unique477 = 0; unique477 < unique476; unique477++) {
      abap.builtin.sy.get().index.set(unique477 + 1);
      lv_index.set(abap.builtin.sy.get().index);
      abap.statements.readTable(it_lengths,{index: lv_index,
        into: lv_length});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      if (abap.compare.eq(lv_length, abap.IntegerFactory.get(0))) {
        continue;
      }
      abap.statements.readTable(lt_offset,{index: lv_length,
        assigning: fs_lv_offset_});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      abap.statements.readTable(this.#mt_symbol,{index: abap.operators.add(fs_lv_offset_,abap.IntegerFactory.get(1)),
        assigning: fs_lv_symbol_});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      fs_lv_symbol_.set(abap.operators.minus(lv_index,abap.IntegerFactory.get(1)));
      fs_lv_offset_.set(abap.operators.add(fs_lv_offset_,abap.IntegerFactory.get(1)));
    }
    abap.builtin.sy.get().index.set(indexBackup4);
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(1),
      into: this.#mv_bit01});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(2),
      into: this.#mv_bit02});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(3),
      into: this.#mv_bit03});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(4),
      into: this.#mv_bit04});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(5),
      into: this.#mv_bit05});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(6),
      into: this.#mv_bit06});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(7),
      into: this.#mv_bit07});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(8),
      into: this.#mv_bit08});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(9),
      into: this.#mv_bit09});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(10),
      into: this.#mv_bit10});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(11),
      into: this.#mv_bit11});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(12),
      into: this.#mv_bit12});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(13),
      into: this.#mv_bit13});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(14),
      into: this.#mv_bit14});
    abap.statements.readTable(this.#mt_count,{index: abap.IntegerFactory.get(15),
      into: this.#mv_bit15});
    return this;
  }
  async get_count(INPUT) {
    let rv_value = new abap.types.Integer({qualifiedName: "I"});
    let iv_index = INPUT?.iv_index;
    if (iv_index?.getQualifiedName === undefined || iv_index.getQualifiedName() !== "I") { iv_index = undefined; }
    if (iv_index === undefined) { iv_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_index); }
    let unique478 = iv_index;
    if (abap.compare.eq(unique478, abap.IntegerFactory.get(1))) {
      rv_value.set(this.#mv_bit01);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(2))) {
      rv_value.set(this.#mv_bit02);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(3))) {
      rv_value.set(this.#mv_bit03);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(4))) {
      rv_value.set(this.#mv_bit04);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(5))) {
      rv_value.set(this.#mv_bit05);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(6))) {
      rv_value.set(this.#mv_bit06);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(7))) {
      rv_value.set(this.#mv_bit07);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(8))) {
      rv_value.set(this.#mv_bit08);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(9))) {
      rv_value.set(this.#mv_bit09);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(10))) {
      rv_value.set(this.#mv_bit10);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(11))) {
      rv_value.set(this.#mv_bit11);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(12))) {
      rv_value.set(this.#mv_bit12);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(13))) {
      rv_value.set(this.#mv_bit13);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(14))) {
      rv_value.set(this.#mv_bit14);
    } else if (abap.compare.eq(unique478, abap.IntegerFactory.get(15))) {
      rv_value.set(this.#mv_bit15);
    } else {
      rv_value.set(abap.IntegerFactory.get(0));
    }
    return rv_value;
  }
  async get_symbol(INPUT) {
    let rv_value = new abap.types.Integer({qualifiedName: "I"});
    let iv_index = INPUT?.iv_index;
    if (iv_index?.getQualifiedName === undefined || iv_index.getQualifiedName() !== "I") { iv_index = undefined; }
    if (iv_index === undefined) { iv_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_index); }
    abap.statements.readTable(this.#mt_symbol,{index: iv_index,
      into: rv_value});
    return rv_value;
  }
}
abap.Classes['ZCL_ABAPGIT_ZLIB_HUFFMAN'] = zcl_abapgit_zlib_huffman;
zcl_abapgit_zlib_huffman.c_maxbits = new abap.types.Integer({qualifiedName: "I"});
zcl_abapgit_zlib_huffman.c_maxbits.set(15);
zcl_abapgit_zlib_huffman.ty_lengths = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_zlib_huffman=>ty_lengths");
export {zcl_abapgit_zlib_huffman};