github.com/whatap/golib@v0.0.22/util/hmap/LongFloatLinkedEntry.go (about)

     1  package hmap
     2  
     3  import (
     4  	"fmt"
     5  	"math"
     6  )
     7  
     8  type LongFloatLinkedEntry struct {
     9  	key       int64
    10  	value     float32
    11  	hash_next *LongFloatLinkedEntry
    12  	link_next *LongFloatLinkedEntry
    13  	link_prev *LongFloatLinkedEntry
    14  }
    15  
    16  func (this *LongFloatLinkedEntry) GetKey() int64 {
    17  	return this.key
    18  }
    19  func (this *LongFloatLinkedEntry) GetValue() float32 {
    20  	return this.value
    21  }
    22  func (this *LongFloatLinkedEntry) SetValue(v float32) float32 {
    23  	old := this.value
    24  	this.value = v
    25  	return old
    26  }
    27  func (this *LongFloatLinkedEntry) Equals(o *LongFloatLinkedEntry) bool {
    28  	return this.key == o.key && this.value == o.value
    29  }
    30  func (this *LongFloatLinkedEntry) HashCode() uint {
    31  	return uint(this.key) ^ uint(math.Float32bits(this.value))
    32  }
    33  func (this *LongFloatLinkedEntry) ToString() string {
    34  	return fmt.Sprintf("%d=%f", this.key, this.value)
    35  }