aa
com.cliffc.aa.type.Type< T extends Type< T >.Key Class Reference
Collaboration diagram for com.cliffc.aa.type.Type< T extends Type< T >.Key:
[legend]

Public Member Functions

boolean equals (Object o)
 
int hashCode ()
 

Package Functions

 Key (Type a, Type b)
 

Static Package Functions

static Type get (Type a, Type b)
 
static void intern_meet_quality_check ()
 
static void put (Type a, Type b, Type mt)
 

Package Attributes

Type _a
 
Type _b
 

Static Package Attributes

static NonBlockingHashMap< Key, TypeINTERN_MEET = new NonBlockingHashMap<>()
 
static Key K = new Key(null,null)
 

Detailed Description

Definition at line 370 of file Type.java.

Constructor & Destructor Documentation

◆ Key()

com.cliffc.aa.type.Type< T extends Type< T >.Key.Key ( Type  a,
Type  b 
)
package

Definition at line 373 of file Type.java.

373 { _a=a; _b=b; }

References com.cliffc.aa.type.Type< T extends Type< T >.Key._a, and com.cliffc.aa.type.Type< T extends Type< T >.Key._b.

Referenced by com.cliffc.aa.type.Type< T extends Type< T >.Key.equals(), and com.cliffc.aa.type.Type< T extends Type< T >.Key.put().

Here is the caller graph for this function:

Member Function Documentation

◆ equals()

boolean com.cliffc.aa.type.Type< T extends Type< T >.Key.equals ( Object  o)

Definition at line 376 of file Type.java.

376 { return _a==((Key)o)._a && _b==((Key)o)._b; }

References com.cliffc.aa.type.Type< T extends Type< T >.Key._a, com.cliffc.aa.type.Type< T extends Type< T >.Key._b, and com.cliffc.aa.type.Type< T extends Type< T >.Key.Key().

Here is the call graph for this function:

◆ get()

◆ hashCode()

◆ intern_meet_quality_check()

static void com.cliffc.aa.type.Type< T extends Type< T >.Key.intern_meet_quality_check ( )
staticpackage

Definition at line 387 of file Type.java.

387  {
389  for( Key k : INTERN_MEET.keySet() ) {
390  int hash = k.hashCode();
391  Integer ii = hashs.get(hash);
392  hashs.put(hash,ii==null ? 1 : ii+1);
393  }
394  int[] hist = new int[16];
395  int maxval=0;
396  long maxkey=-1;
397  for( long l : hashs.keySet() ) {
398  int reps = hashs.get(l);
399  if( reps > maxval ) { maxval=reps; maxkey=l; }
400  if( reps < hist.length ) hist[reps]++;
401  else System.out.println("hash "+l+" repeats "+reps);
402  }
403  for( int i=0; i<hist.length; i++ )
404  if( hist[i] > 0 )
405  System.out.println("Number of hashes with "+i+" repeats: "+hist[i]);
406  System.out.println("Max repeat key "+maxkey+" repeats: "+maxval);
407  }

References com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.get(), com.cliffc.aa.type.Type< T extends Type< T >.Key.INTERN_MEET, com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.keySet(), and com.cliffc.aa.util.NonBlockingHashMapLong< TypeV >.put().

Here is the call graph for this function:

◆ put()

static void com.cliffc.aa.type.Type< T extends Type< T >.Key.put ( Type  a,
Type  b,
Type  mt 
)
staticpackage

Definition at line 382 of file Type.java.

382  {
383  INTERN_MEET.put(new Key(a,b),mt);
384  // Uncomment to check hash quality.
385  //Util.hash_quality_check_per(INTERN_MEET);
386  }

References com.cliffc.aa.type.Type< T extends Type< T >.Key.INTERN_MEET, and com.cliffc.aa.type.Type< T extends Type< T >.Key.Key().

Here is the call graph for this function:

Member Data Documentation

◆ _a

◆ _b

◆ INTERN_MEET

◆ K

Key com.cliffc.aa.type.Type< T extends Type< T >.Key.K = new Key(null,null)
staticpackage

Definition at line 371 of file Type.java.

Referenced by com.cliffc.aa.type.Type< T extends Type< T >.Key.get().


The documentation for this class was generated from the following file:
com.cliffc.aa.type.Type.Key._a
Type _a
Definition: Type.java:374
com.cliffc.aa.type.Type._hash
int _hash
Definition: Type.java:97
com.cliffc.aa.type.Type.Key.INTERN_MEET
static NonBlockingHashMap< Key, Type > INTERN_MEET
Definition: Type.java:372
com.cliffc.aa.type.Type.Key._b
Type _b
Definition: Type.java:374
com.cliffc.aa.util.NonBlockingHashMapLong.keySet
Set< Long > keySet()
Returns a Set view of the keys contained in this map; with care the keys may be iterated over without...
Definition: NonBlockingHashMapLong.java:1168
com.cliffc.aa.util.NonBlockingHashMapLong.get
final TypeV get(long key)
Returns the value to which the specified key is mapped, or.
Definition: NonBlockingHashMapLong.java:368
com.cliffc.aa.type.Type.Key.K
static Key K
Definition: Type.java:371
com.cliffc.aa.type.Type.Key.Key
Key(Type a, Type b)
Definition: Type.java:373
com.cliffc.aa.util.NonBlockingHashMapLong
A lock-free alternate implementation of java.util.concurrent.ConcurrentHashMap with primitive long ke...
Definition: NonBlockingHashMapLong.java:91
com.cliffc.aa.util.NonBlockingHashMapLong.put
TypeV put(long key, TypeV val)
Maps the specified key to the specified value in the table.
Definition: NonBlockingHashMapLong.java:278