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

How to use
ObjectIdentityOrdinalMap$Entry
in
com.netflix.hollow.zenoadapter.util

Best Java code snippets using com.netflix.hollow.zenoadapter.util.ObjectIdentityOrdinalMap$Entry (Showing top 5 results out of 315)

origin: Netflix/hollow

@Test
public void test() {
  for(int i=0;i<obj.length;i++) {
    obj[i] = new Object();
  }
  ObjectIdentityOrdinalMap ordinalMap = new ObjectIdentityOrdinalMap();
  for(int i=0;i<obj.length;i++) {
    ordinalMap.put(obj[i], i);
  }
  for(int i=0;i<obj.length;i++) {
    Assert.assertEquals(ordinalMap.getEntry(obj[i]).getOrdinal(), i);
  }
}
origin: Netflix/hollow

public synchronized void put(Object object, int hashCode, int ordinal) {
  int index = index(hashCode, entries.length);
  Entry current = entries[index];
  Entry prev = null;
  while (current != null) {
    if (current.hash() == hashCode) {
      Object currentObject = current.getKey();
      if( currentObject == null){
        deleteEntry(index, current, prev);
        current = current.next;
        continue;
      } else if (currentObject == object) {
        return;
      }
    }
    prev = current;
    current = current.next;
  }
  count++;
  Entry first = entries[index];
  Entry entry = new Entry(object, hashCode, ordinal, first);
  entries[index] = entry;
  entry.next = first;
  checkSize();
  return;
}
origin: Netflix/hollow

public synchronized Entry get(Object object, int hashCode) {
  int index = index(hashCode, entries.length);
  Entry current = entries[index];
  Entry prev = null;
  while (current != null) {
    if (current.hash() == hashCode) {
      Object currentObject = current.getKey();
      if( currentObject == null){
        deleteEntry(index, current, prev);
        current = current.next;
        continue;
      } else if (currentObject == object) {
        return current;
      }
    }
    prev = current;
    current = current.next;
  }
  return null;
}
origin: Netflix/hollow

private void resize(int newCapacity) {
  Entry[] newEntries = new Entry[newCapacity];
  if( entries != null){
    for(Entry entry : entries){
      Entry current = entry;
      while(current != null){
        Entry newEntry = current;
        current = current.next;
        int index = index(newEntry.hash(), newEntries.length);
        newEntry.next = newEntries[index];
        newEntries[index] = newEntry;
      }
    }
  }
  minThreshold = (newEntries.length == MINIMUM_CAPACITY) ? 0 : (newEntries.length * LOAD_FACTOR_PERCENT / 200);
  maxThreshold = (newEntries.length == MAXIMUM_CAPACITY) ? Integer.MAX_VALUE : newEntries.length * LOAD_FACTOR_PERCENT / 100;
  entries = newEntries;
}
origin: Netflix/hollow

public int add(String type, Object o) {
  ObjectIdentityOrdinalMap identityOrdinalMap = getIdentityOrdinalMap(type);
  Entry entry = identityOrdinalMap.getEntry(o);
  if(entry != null) {
    return entry.getOrdinal();
  }
  NFTypeSerializer<Object> serializer = getSerializer(type);
  int ordinal = add(type, o, serializer);
  identityOrdinalMap.put(o, ordinal);
  return ordinal;
}
com.netflix.hollow.zenoadapter.utilObjectIdentityOrdinalMap$Entry

Most used methods

  • getOrdinal
  • <init>
    Creates new entry.
  • getKey
  • hash

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • Menu (java.awt)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for WebStorm
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