github.com/whatap/golib@v0.0.22/util/hmap/LongKeyLinkedEntry.go (about) 1 package hmap 2 3 import ( 4 "fmt" 5 ) 6 7 type LongKeyLinkedEntry struct { 8 key int64 9 keyHash uint 10 value interface{} 11 hash_next *LongKeyLinkedEntry 12 link_next *LongKeyLinkedEntry 13 link_prev *LongKeyLinkedEntry 14 } 15 16 func (this *LongKeyLinkedEntry) GetKey() int64 { 17 return this.key 18 } 19 func (this *LongKeyLinkedEntry) GetValue() interface{} { 20 return this.value 21 } 22 func (this *LongKeyLinkedEntry) SetValue(v interface{}) interface{} { 23 old := this.value 24 this.value = v 25 return old 26 } 27 func (this *LongKeyLinkedEntry) Equals(o *LongKeyLinkedEntry) bool { 28 return this.key == o.key 29 } 30 31 func (this *LongKeyLinkedEntry) HashCode() uint { 32 return uint(this.key ^ this.key>>32) 33 } 34 35 func (this *LongKeyLinkedEntry) ToString() string { 36 return fmt.Sprintf("%d=%v", this.key, this.value) 37 }