Tabnine Logo
Object2ShortOpenHashMap.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
it.unimi.dsi.fastutil.objects.Object2ShortOpenHashMap
constructor

Best Java code snippets using it.unimi.dsi.fastutil.objects.Object2ShortOpenHashMap.<init> (Showing top 8 results out of 315)

origin: padreati/rapaio

private VarNominal() {
  this.reverse = new Object2ShortOpenHashMap<>();
  this.reverse.put("?", (short) 0);
  this.dict = new ArrayList<>();
  this.dict.add("?");
  data = new short[0];
  rows = 0;
}
origin: padreati/rapaio

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
  rows = in.readInt();
  dict = new ArrayList<>();
  reverse = new Object2ShortOpenHashMap<>();
  int len = in.readInt();
  for (int i = 0; i < len; i++) {
    dict.add(in.readUTF());
    reverse.put(dict.get(i), (short) i);
  }
  data = new short[rows];
  for (int i = 0; i < rows; i++) {
    data[i] = in.readShort();
  }
}
origin: padreati/rapaio

@Override
public void setLevels(String... dict) {
  List<String> oldDict = this.dict;
  if (dict.length > 0 && !dict[0].equals("?")) {
    String[] newDict = new String[dict.length + 1];
    newDict[0] = "?";
    System.arraycopy(dict, 0, newDict, 1, dict.length);
    dict = newDict;
  }
  if (this.dict.size() > dict.length) {
    throw new IllegalArgumentException("new levels does not contains all old labels");
  }
  this.dict = new ArrayList<>();
  this.reverse = new Object2ShortOpenHashMap<>(dict.length);
  this.dict.add("?");
  this.reverse.put("?", (short) 0);
  short[] pos = new short[oldDict.size()];
  for (int i = 0; i < dict.length; i++) {
    String term = dict[i];
    if (!reverse.containsKey(term)) {
      this.dict.add(term);
      this.reverse.put(term, (short) this.reverse.size());
    }
    if (i < oldDict.size())
      pos[i] = this.reverse.getShort(term);
  }
  for (int i = 0; i < rows; i++) {
    data[i] = pos[data[i]];
  }
}
origin: org.gephi/graphstore

public ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed) {
  if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) {
    throw new RuntimeException("Column Store size can't exceed 65534");
  }
  this.graphStore = graphStore;
  this.configuration = graphStore != null ? graphStore.configuration : new Configuration();
  this.lock = GraphStoreConfiguration.ENABLE_AUTO_LOCKING ? new TableLock() : null;
  this.garbageQueue = new ShortRBTreeSet();
  this.idMap = new Object2ShortOpenHashMap<String>(MAX_SIZE);
  this.columns = new ColumnImpl[MAX_SIZE];
  this.elementType = elementType;
  this.indexStore = indexed ? new IndexStore<T>(this) : null;
  idMap.defaultReturnValue(NULL_SHORT);
  this.observers = GraphStoreConfiguration.ENABLE_OBSERVERS ? new ArrayList<TableObserverImpl>() : null;
}
origin: gephi/graphstore

public ColumnStore(GraphStore graphStore, Class<T> elementType, boolean indexed) {
  if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) {
    throw new RuntimeException("Column Store size can't exceed 65534");
  }
  this.graphStore = graphStore;
  this.configuration = graphStore != null ? graphStore.configuration : new Configuration();
  this.lock = GraphStoreConfiguration.ENABLE_AUTO_LOCKING ? new TableLock() : null;
  this.garbageQueue = new ShortRBTreeSet();
  this.idMap = new Object2ShortOpenHashMap<String>(MAX_SIZE);
  this.columns = new ColumnImpl[MAX_SIZE];
  this.elementType = elementType;
  this.indexStore = indexed ? new IndexStore<T>(this) : null;
  idMap.defaultReturnValue(NULL_SHORT);
  this.observers = GraphStoreConfiguration.ENABLE_OBSERVERS ? new ArrayList<TableObserverImpl>() : null;
}
origin: org.gephi/graphstore

public EdgeTypeStore(Configuration config) {
  if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) {
    throw new RuntimeException("Edge Type Store size can't exceed 65534");
  }
  this.configuration = config;
  this.garbageQueue = new ShortRBTreeSet();
  this.labelMap = new Object2ShortOpenHashMap(MAX_SIZE);
  this.idMap = new Short2ObjectOpenHashMap(MAX_SIZE);
  labelMap.defaultReturnValue(NULL_SHORT);
  // Add null type
  short id = intToShort(NULL_LABEL);
  length++;
  labelMap.put(null, id);
  idMap.put(id, null);
}
origin: gephi/graphstore

public EdgeTypeStore(Configuration config) {
  if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) {
    throw new RuntimeException("Edge Type Store size can't exceed 65534");
  }
  this.configuration = config;
  this.garbageQueue = new ShortRBTreeSet();
  this.labelMap = new Object2ShortOpenHashMap(MAX_SIZE);
  this.idMap = new Short2ObjectOpenHashMap(MAX_SIZE);
  labelMap.defaultReturnValue(NULL_SHORT);
  // Add null type
  short id = intToShort(NULL_LABEL);
  length++;
  labelMap.put(null, id);
  idMap.put(id, null);
}
origin: gegy1000/Terrarium

protected Object2ShortMap<FloodFill.Point> createFloodSources(DataView view, ShortRasterTile resultTile) {
  Object2ShortMap<FloodFill.Point> floodSources = new Object2ShortOpenHashMap<>();
  for (int localY = 0; localY < view.getHeight(); localY++) {
    for (int localX = 0; localX < view.getWidth(); localX++) {
      int sampled = resultTile.getShort(localX, localY);
      if (this.isFillingBankType(sampled)) {
        if (localX > 0) {
          short left = (sampled & BANK_UP_FLAG) != 0 ? LAND : OCEAN;
          floodSources.put(new FloodFill.Point(localX - 1, localY), left);
        }
        if (localX < view.getWidth() - 1) {
          short right = (sampled & BANK_UP_FLAG) != 0 ? OCEAN : LAND;
          floodSources.put(new FloodFill.Point(localX + 1, localY), right);
        }
      }
    }
  }
  return floodSources;
}
it.unimi.dsi.fastutil.objectsObject2ShortOpenHashMap<init>

Javadoc

Creates a new hash map with initial expected Hash#DEFAULT_INITIAL_SIZE entries and Hash#DEFAULT_LOAD_FACTOR as load factor.

Popular methods of Object2ShortOpenHashMap

  • clear
  • put
  • addToValue
  • containsKey
  • containsValue
  • defaultReturnValue
  • ensureCapacity
  • find
  • getShort
  • insert
  • keySet
  • putAll
  • keySet,
  • putAll,
  • realSize,
  • rehash,
  • removeEntry,
  • removeNullEntry,
  • shiftKeys,
  • size,
  • tryCapacity

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JLabel (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now