congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ObjectIntHashMap.put
Code IndexAdd Tabnine to your IDE (free)

How to use
put
method
in
com.carrotsearch.hppcrt.maps.ObjectIntHashMap

Best Java code snippets using com.carrotsearch.hppcrt.maps.ObjectIntHashMap.put (Showing top 11 results out of 315)

origin: com.github.vsonnier/hppcrt

/**
 * Creates a hash map from two index-aligned arrays of key-value pairs. Default load factor is used.
 */
public static <KType> ObjectIntHashMap<KType> from(final KType[] keys, final int[] values) {
  if (keys.length != values.length) {
    throw new IllegalArgumentException("Arrays of keys and values must have an identical length.");
  }
  final ObjectIntHashMap<KType> map = new ObjectIntHashMap<KType>(keys.length);
  for (int i = 0; i < keys.length; i++) {
    map.put(keys[i], values[i]);
  }
  return map;
}
origin: net.sourceforge.owlapi/owlapi-osgidistribution

static ObjectIntHashMap<IRI> initMap() {
  ObjectIntHashMap<IRI> predicates = new ObjectIntHashMap<>();
  AtomicInteger nextId = new AtomicInteger(1);
  List<OWLRDFVocabulary> ORDERED_URIS = Arrays.asList(RDF_TYPE, RDFS_LABEL, OWL_DEPRECATED,
    RDFS_COMMENT, RDFS_IS_DEFINED_BY, RDF_FIRST, RDF_REST, OWL_EQUIVALENT_CLASS,
    OWL_EQUIVALENT_PROPERTY, RDFS_SUBCLASS_OF, RDFS_SUB_PROPERTY_OF, RDFS_DOMAIN,
    RDFS_RANGE, OWL_DISJOINT_WITH, OWL_ON_PROPERTY, OWL_DATA_RANGE, OWL_ON_CLASS,
    OWL_ANNOTATED_SOURCE, OWL_ANNOTATED_PROPERTY, OWL_ANNOTATED_TARGET);
  ORDERED_URIS.forEach(iri -> predicates.put(iri.getIRI(), nextId.getAndIncrement()));
  Stream.of(OWLRDFVocabulary.values())
    .forEach(iri -> predicates.putIfAbsent(iri.getIRI(), nextId.getAndIncrement()));
  return predicates;
}
origin: com.github.vsonnier/hppcrt

/**
 * {@inheritDoc}
 */
@Override
public boolean putIfAbsent(final KType key, final int value) {
  if (!containsKey(key)) {
    put(key, value);
    return true;
  }
  return false;
}
origin: owlcs/owlapi

static ObjectIntHashMap<IRI> initMap() {
  ObjectIntHashMap<IRI> predicates = new ObjectIntHashMap<>();
  AtomicInteger nextId = new AtomicInteger(1);
  List<OWLRDFVocabulary> ORDERED_URIS = Arrays.asList(RDF_TYPE, RDFS_LABEL, OWL_DEPRECATED,
    RDFS_COMMENT, RDFS_IS_DEFINED_BY, RDF_FIRST, RDF_REST, OWL_EQUIVALENT_CLASS,
    OWL_EQUIVALENT_PROPERTY, RDFS_SUBCLASS_OF, RDFS_SUB_PROPERTY_OF, RDFS_DOMAIN,
    RDFS_RANGE, OWL_DISJOINT_WITH, OWL_ON_PROPERTY, OWL_DATA_RANGE, OWL_ON_CLASS,
    OWL_ANNOTATED_SOURCE, OWL_ANNOTATED_PROPERTY, OWL_ANNOTATED_TARGET);
  ORDERED_URIS.forEach(iri -> predicates.put(iri.getIRI(), nextId.getAndIncrement()));
  Stream.of(OWLRDFVocabulary.values())
    .forEach(iri -> predicates.putIfAbsent(iri.getIRI(), nextId.getAndIncrement()));
  return predicates;
}
origin: com.github.vsonnier/hppcrt

/**
 * {@inheritDoc}
 */
@Override
public int putAll(final Iterable<? extends ObjectIntCursor<? extends KType>> iterable) {
  final int count = this.size();
  for (final ObjectIntCursor<? extends KType> c : iterable) {
    put(c.key, c.value);
  }
  return this.size() - count;
}
origin: net.sourceforge.owlapi/owlapi-distribution

static ObjectIntHashMap<IRI> initMap() {
  ObjectIntHashMap<IRI> predicates = new ObjectIntHashMap<>();
  AtomicInteger nextId = new AtomicInteger(1);
  List<OWLRDFVocabulary> ORDERED_URIS = Arrays.asList(RDF_TYPE, RDFS_LABEL, OWL_DEPRECATED,
    RDFS_COMMENT, RDFS_IS_DEFINED_BY, RDF_FIRST, RDF_REST, OWL_EQUIVALENT_CLASS,
    OWL_EQUIVALENT_PROPERTY, RDFS_SUBCLASS_OF, RDFS_SUB_PROPERTY_OF, RDFS_DOMAIN,
    RDFS_RANGE, OWL_DISJOINT_WITH, OWL_ON_PROPERTY, OWL_DATA_RANGE, OWL_ON_CLASS,
    OWL_ANNOTATED_SOURCE, OWL_ANNOTATED_PROPERTY, OWL_ANNOTATED_TARGET);
  ORDERED_URIS.forEach(iri -> predicates.put(iri.getIRI(), nextId.getAndIncrement()));
  Stream.of(OWLRDFVocabulary.values())
    .forEach(iri -> predicates.putIfAbsent(iri.getIRI(), nextId.getAndIncrement()));
  return predicates;
}
origin: com.github.vsonnier/hppcrt

/**
 * If <code>key</code> exists, <code>putValue</code> is inserted into the map,
 * otherwise any existing value is incremented by <code>additionValue</code>.
 *
 * @param key
 *          The key of the value to adjust.
 * @param putValue
 *          The value to put if <code>key</code> does not exist.
 * @param incrementValue
 *          The value to add to the existing value if <code>key</code> exists.
 * @return Returns the current value associated with <code>key</code> (after
 *         changes).
 */
@SuppressWarnings("cast")
@Override
public int putOrAdd(final KType key, int putValue, final int incrementValue) {
  if (containsKey(key)) {
    putValue = get(key);
    putValue = (int) (((putValue) + (incrementValue)));
  }
  put(key, putValue);
  return putValue;
}
origin: net.sourceforge.owlapi/owlapi-distribution

/**
 * @param axioms axioms
 * @param type type
 */
public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) {
  this.type = type;
  decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker());
  int size = decomposer.getAOS(this.type).size();
  atoms = new ArrayList<>();
  for (int i = 0; i < size; i++) {
    final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms()));
    atoms.add(atom);
    atomIndex.put(atom, i);
    for (OWLEntity e : atom.getSignature()) {
      termBasedIndex.put(e, atom);
    }
  }
  for (int i = 0; i < size; i++) {
    Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies();
    for (OntologyAtom j : dependentIndexes) {
      dependencies.put(atoms.get(i), atoms.get(j.getId()));
      dependents.put(atoms.get(j.getId()), atoms.get(i));
    }
  }
}
origin: owlcs/owlapi

/**
 * @param axioms axioms
 * @param type type
 */
public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) {
  this.type = type;
  decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker());
  int size = decomposer.getAOS(this.type).size();
  atoms = new ArrayList<>();
  for (int i = 0; i < size; i++) {
    final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms()));
    atoms.add(atom);
    atomIndex.put(atom, i);
    for (OWLEntity e : atom.getSignature()) {
      termBasedIndex.put(e, atom);
    }
  }
  for (int i = 0; i < size; i++) {
    Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies();
    for (OntologyAtom j : dependentIndexes) {
      dependencies.put(atoms.get(i), atoms.get(j.getId()));
      dependents.put(atoms.get(j.getId()), atoms.get(i));
    }
  }
}
origin: net.sourceforge.owlapi/owlapi-osgidistribution

/**
 * @param axioms axioms
 * @param type type
 */
public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) {
  this.type = type;
  decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker());
  int size = decomposer.getAOS(this.type).size();
  atoms = new ArrayList<>();
  for (int i = 0; i < size; i++) {
    final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms()));
    atoms.add(atom);
    atomIndex.put(atom, i);
    for (OWLEntity e : atom.getSignature()) {
      termBasedIndex.put(e, atom);
    }
  }
  for (int i = 0; i < size; i++) {
    Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies();
    for (OntologyAtom j : dependentIndexes) {
      dependencies.put(atoms.get(i), atoms.get(j.getId()));
      dependents.put(atoms.get(j.getId()), atoms.get(i));
    }
  }
}
origin: net.sourceforge.owlapi/owlapi-tools

/**
 * @param axioms axioms
 * @param type type
 */
public AtomicDecompositionImpl(List<OWLAxiom> axioms, ModuleType type) {
  this.type = type;
  decomposer = new Decomposer(AxiomSelector.wrap(axioms), new SyntacticLocalityChecker());
  int size = decomposer.getAOS(this.type).size();
  atoms = new ArrayList<>();
  for (int i = 0; i < size; i++) {
    final Atom atom = new Atom(asSet(decomposer.getAOS().get(i).getAtomAxioms()));
    atoms.add(atom);
    atomIndex.put(atom, i);
    for (OWLEntity e : atom.getSignature()) {
      termBasedIndex.put(e, atom);
    }
  }
  for (int i = 0; i < size; i++) {
    Set<OntologyAtom> dependentIndexes = decomposer.getAOS().get(i).getDependencies();
    for (OntologyAtom j : dependentIndexes) {
      dependencies.put(atoms.get(i), atoms.get(j.getId()));
      dependents.put(atoms.get(j.getId()), atoms.get(i));
    }
  }
}
com.carrotsearch.hppcrt.mapsObjectIntHashMapput

Popular methods of ObjectIntHashMap

  • get
  • <init>
    Create a hash map from all key-value pairs of another container.
  • getDefaultValue
    Returns the "default value" value used in containers methods returning "default value"
  • putIfAbsent
  • allocateBuffers
    Allocate internal buffers for a given capacity.
  • containsKey
  • equalKeys
    Override this method together with #hashKey(Object)to customize the hashing strategy. Note that this
  • expandAndPut
    Expand the internal storage buffers (capacity) and rehash.
  • hashKey
    Override this method, together with #equalKeys(Object,Object)to customize the hashing strategy. Note
  • iterator
  • probe_distance
  • putAll
  • probe_distance,
  • putAll,
  • putOrAdd,
  • remove,
  • shiftConflictingKeys,
  • size

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JOptionPane (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for Android Studio
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