All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.almworks.jira.structure.api.effectbatch.RowsToReplace Maven / Gradle / Ivy

There is a newer version: 17.25.3
Show newest version
package com.almworks.jira.structure.api.effectbatch;

import com.almworks.integers.LongObjMap;
import com.almworks.integers.func.LongToLong;
import com.almworks.integers.wrappers.LongLongHppcOpenHashMap;
import com.almworks.integers.wrappers.LongObjHppcOpenHashMap;
import com.almworks.jira.structure.api.forest.raw.Forest;
import com.atlassian.annotations.Internal;

@Internal
public class RowsToReplace implements LongToLong {
  public LongObjMap forests; // under => forest
  public LongLongHppcOpenHashMap replacements;
  public long replacingGenerator;
  public LongLongHppcOpenHashMap replacingGenerators;

  public RowsToReplace(Forest forest, long under, LongLongHppcOpenHashMap replacements, long replacingGenerator, LongLongHppcOpenHashMap replacingGenerators) {
    LongObjHppcOpenHashMap forests = new LongObjHppcOpenHashMap<>();
    forests.put(under, forest);
    this.forests = forests;
    this.replacements = replacements;
    this.replacingGenerator = replacingGenerator;
    this.replacingGenerators = replacingGenerators;
  }

  public RowsToReplace(LongObjMap forests, LongLongHppcOpenHashMap replacements, long replacingGenerator, LongLongHppcOpenHashMap replacingGenerators) {
    this.forests = forests;
    this.replacements = replacements;
    this.replacingGenerator = replacingGenerator;
    this.replacingGenerators = replacingGenerators;
  }

  @Override
  public long invoke(long l) {
    return replacingGenerators == null ? replacingGenerator : replacingGenerators.get(l);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy