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

How to use
HollowSet
in
com.netflix.hollow.api.objects

Best Java code snippets using com.netflix.hollow.api.objects.HollowSet (Showing top 4 results out of 315)

origin: Netflix/hollow

@Override
public T findElement(HollowSet<T> set, int ordinal, Object... keys) {
  int elementOrdinal = dataAccess.findElement(ordinal, keys);
  if(elementOrdinal != -1)
    return set.instantiateElement(elementOrdinal);
  return null;
}
origin: Netflix/hollow

@Override
public boolean contains(HollowSet<T> set, int ordinal, Object o) {
  if(getSchema().getHashKey() != null) {
    for(int i=0;i<ordinals.length;i++) {
      if(ordinals[i] != -1 && set.equalsElement(ordinals[i], o))
        return true;
    }
  } else {
    int hashCode = dataAccess.getDataAccess().getHashCodeFinder().hashCode(o);

    int bucket = HashCodes.hashInt(hashCode) & hashMask;

    while(ordinals[bucket] != -1) {
      if(set.equalsElement(ordinals[bucket], o))
        return true;
      bucket ++;
      bucket &= hashMask;
    }
  }
  return false;
}

origin: Netflix/hollow

@Override
public boolean contains(HollowSet<T> set, int ordinal, Object o) {
  HollowOrdinalIterator iter;
  
  if(getSchema().getHashKey() != null) {
    iter = dataAccess.ordinalIterator(ordinal);
  } else {
    int hashCode = dataAccess.getDataAccess().getHashCodeFinder().hashCode(o);
    iter = dataAccess.potentialMatchOrdinalIterator(ordinal, hashCode);
  }
  int potentialOrdinal = iter.next();
  while(potentialOrdinal != HollowOrdinalIterator.NO_MORE_ORDINALS) {
    if(set.equalsElement(potentialOrdinal, o))
      return true;
    potentialOrdinal = iter.next();
  }
  return false;
}

origin: Netflix/hollow

@Override
public T findElement(HollowSet<T> set, int ordinal, Object... keys) {
  int elementOrdinal = dataAccess.findElement(ordinal, keys);
  if(elementOrdinal != -1)
    return set.instantiateElement(elementOrdinal);
  return null;
}
com.netflix.hollow.api.objectsHollowSet

Javadoc

A HollowSet provides an implementation of the java.util.Set interface over a SET record in a Hollow dataset. Also provides the findElement() method, which allows for searching the set for elements with matching hash keys.

Most used methods

  • equalsElement
  • instantiateElement

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Top Vim 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