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

Public Member Functions

boolean equals (Object o)
 
int hashCode ()
 

Package Attributes

int _hash
 
TypeFld[] _ts
 

Private Member Functions

 Key (TypeFld[] ts, int hash)
 

Static Private Member Functions

static int hash (Type[] ts)
 

Detailed Description

Definition at line 21 of file TypeFlds.java.

Constructor & Destructor Documentation

◆ Key()

com.cliffc.aa.type.TypeFlds.Key.Key ( TypeFld[]  ts,
int  hash 
)
private

Definition at line 24 of file TypeFlds.java.

24 { _ts=ts; _hash = hash; }

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

Referenced by com.cliffc.aa.type.TypeFlds.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.TypeFlds.Key.equals ( Object  o)

Definition at line 31 of file TypeFlds.java.

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

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

Here is the call graph for this function:

◆ hash()

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

Definition at line 25 of file TypeFlds.java.

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

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

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

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

◆ hashCode()

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

Definition at line 30 of file TypeFlds.java.

30 { return _hash; }

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

Member Data Documentation

◆ _hash

◆ _ts


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