aa
com.cliffc.aa.type.Types.Key Class Reference
Collaboration diagram for com.cliffc.aa.type.Types.Key:
[legend]

Public Member Functions

boolean equals (Object o)
 
int hashCode ()
 

Package Attributes

int _hash
 
Type[] _ts
 

Private Member Functions

 Key (Type[] ts, int hash)
 

Static Private Member Functions

static int hash (Type[] ts)
 

Detailed Description

Definition at line 22 of file Types.java.

Constructor & Destructor Documentation

◆ Key()

com.cliffc.aa.type.Types.Key.Key ( Type[]  ts,
int  hash 
)
private

Definition at line 25 of file Types.java.

25 { _ts=ts; _hash = hash; }

References com.cliffc.aa.type.Types.Key._hash, com.cliffc.aa.type.Types.Key._ts, com.cliffc.aa.type.Types.Key.hash(), and com.cliffc.aa.type.Types.ts().

Referenced by com.cliffc.aa.type.Types.Key.equals().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ equals()

boolean com.cliffc.aa.type.Types.Key.equals ( Object  o)

Definition at line 32 of file Types.java.

32  {
33  if( !(o instanceof Key) ) return false;
34  Type[] ts = ((Key)o)._ts;
35  // This series of tests is NOT the same as Arrays.equals(), since it
36  // bottoms out in a pointer-equality test instead of 'equals'.
37  if( _ts==ts ) return true;
38  if( _ts.length != ts.length ) return false;
39  for( int i=0; i<ts.length; i++ )
40  if( _ts[i]!=ts[i] )
41  return false;
42  return true;
43  }

References com.cliffc.aa.type.Types.Key._ts, com.cliffc.aa.type.Types.Key.Key(), and com.cliffc.aa.type.Types.ts().

Here is the call graph for this function:

◆ hash()

static int com.cliffc.aa.type.Types.Key.hash ( Type[]  ts)
staticprivate

Definition at line 26 of file Types.java.

26  {
27  int hash = 0;
28  for( Type t : ts ) hash += t._hash;
29  return hash;
30  }

References com.cliffc.aa.type.Types.ts().

Referenced by com.cliffc.aa.type.Types.check_(), com.cliffc.aa.type.Types.hash_cons_(), and com.cliffc.aa.type.Types.Key.Key().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hashCode()

int com.cliffc.aa.type.Types.Key.hashCode ( )

Definition at line 31 of file Types.java.

31 { return _hash; }

References com.cliffc.aa.type.Types.Key._hash.

Member Data Documentation

◆ _hash

int com.cliffc.aa.type.Types.Key._hash
package

◆ _ts


The documentation for this class was generated from the following file:
com.cliffc.aa.type.Types.Key._ts
Type[] _ts
Definition: Types.java:23
com.cliffc.aa.type.Types.ts
static Type[] ts(Type t0)
Definition: Types.java:90
com.cliffc.aa.type.Types.Key._hash
int _hash
Definition: Types.java:24
com.cliffc.aa.type.Types.Key.Key
Key(Type[] ts, int hash)
Definition: Types.java:25
com.cliffc.aa.type.Types.Key.hash
static int hash(Type[] ts)
Definition: Types.java:26