Codota Logo
Object2ShortOpenHashMap.<init>
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
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

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • getSystemService (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now