value

package
v0.0.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Index

Constants

View Source
const (
	VALUE_NULL         = 0
	VALUE_BOOLEAN      = 10
	VALUE_DECIMAL      = 20
	VALUE_DECIMAL_INT  = 21
	VALUE_DECIMAL_LONG = 22
	VALUE_FLOAT        = 30
	VALUE_DOUBLE       = 40

	VALUE_DOUBLE_SUMMARY = 45
	VALUE_LONG_SUMMARY   = 46
	FLOAT_SUMMARY        = 47

	VALUE_TEXT      = 50
	VALUE_TEXT_HASH = 51
	VALUE_BLOB      = 60
	VALUE_IP4ADDR   = 61

	VALUE_LIST  = 70
	ARRAY_INT   = 71
	ARRAY_FLOAT = 72
	ARRAY_TEXT  = 73
	ARRAY_LONG  = 74

	VALUE_MAP     = 80
	INT_VALUE_MAP = 81
)
View Source
const (
	BYTE_LEN = 29
)

Variables

This section is empty.

Functions

func WriteMapValue

func WriteMapValue(out *io.DataOutputX, val *MapValue) *io.DataOutputX

func WriteValue

func WriteValue(out *io.DataOutputX, val Value) *io.DataOutputX

Types

type BlobValue

type BlobValue struct {
	Val []byte
}

func NewBlobValue

func NewBlobValue(v []byte) *BlobValue

func (*BlobValue) CompareTo

func (this *BlobValue) CompareTo(o Value) int

func (*BlobValue) Equals

func (this *BlobValue) Equals(o Value) bool

func (*BlobValue) GetValueType

func (this *BlobValue) GetValueType() byte

func (*BlobValue) Read

func (this *BlobValue) Read(in *io.DataInputX)

func (*BlobValue) Write

func (this *BlobValue) Write(out *io.DataOutputX)

type BoolValue

type BoolValue struct {
	Val bool
}

func NewBoolValue

func NewBoolValue(v bool) *BoolValue

func (*BoolValue) CompareTo

func (this *BoolValue) CompareTo(o Value) int

func (*BoolValue) Equals

func (this *BoolValue) Equals(o Value) bool

func (*BoolValue) GetValueType

func (this *BoolValue) GetValueType() byte

func (*BoolValue) Read

func (this *BoolValue) Read(in *io.DataInputX)

func (*BoolValue) Write

func (this *BoolValue) Write(out *io.DataOutputX)

type DecimalValue

type DecimalValue struct {
	Val int64
}

func NewDecimalValue

func NewDecimalValue(v int64) *DecimalValue

func (*DecimalValue) CompareTo

func (this *DecimalValue) CompareTo(o Value) int

func (*DecimalValue) Equals

func (this *DecimalValue) Equals(o Value) bool

func (*DecimalValue) GetValueType

func (this *DecimalValue) GetValueType() byte

func (*DecimalValue) Read

func (this *DecimalValue) Read(in *io.DataInputX)

func (*DecimalValue) Write

func (this *DecimalValue) Write(out *io.DataOutputX)

type DoubleSummary

type DoubleSummary struct {
	Sum   float64
	Count int32
	Min   float64
	Max   float64
}

func NewDoubleSummary

func NewDoubleSummary() *DoubleSummary

func (*DoubleSummary) Add

func (this *DoubleSummary) Add(other SummaryValue) SummaryValue

func (*DoubleSummary) AddCount

func (this *DoubleSummary) AddCount()

func (*DoubleSummary) CompareTo

func (this *DoubleSummary) CompareTo(o Value) int

func (*DoubleSummary) DoubleAvg

func (this *DoubleSummary) DoubleAvg() float64

func (*DoubleSummary) DoubleMax

func (this *DoubleSummary) DoubleMax() float64

func (*DoubleSummary) DoubleMin

func (this *DoubleSummary) DoubleMin() float64

func (*DoubleSummary) DoubleSum

func (this *DoubleSummary) DoubleSum() float64

func (*DoubleSummary) Equals

func (this *DoubleSummary) Equals(o Value) bool

func (*DoubleSummary) GetCount

func (this *DoubleSummary) GetCount() int32

func (*DoubleSummary) GetValueType

func (this *DoubleSummary) GetValueType() byte

func (*DoubleSummary) LongAvg

func (this *DoubleSummary) LongAvg() int64

func (*DoubleSummary) LongMax

func (this *DoubleSummary) LongMax() int64

func (*DoubleSummary) LongMin

func (this *DoubleSummary) LongMin() int64

func (*DoubleSummary) LongSum

func (this *DoubleSummary) LongSum() int64

func (*DoubleSummary) Read

func (this *DoubleSummary) Read(in *io.DataInputX)

func (*DoubleSummary) ToString

func (this *DoubleSummary) ToString() string

func (*DoubleSummary) Write

func (this *DoubleSummary) Write(out *io.DataOutputX)

type DoubleValue

type DoubleValue struct {
	Val float64
}

func NewDoubleValue

func NewDoubleValue(v float64) *DoubleValue

func (*DoubleValue) CompareTo

func (this *DoubleValue) CompareTo(o Value) int

func (*DoubleValue) Equals

func (this *DoubleValue) Equals(o Value) bool

func (*DoubleValue) GetValueType

func (this *DoubleValue) GetValueType() byte

func (*DoubleValue) Read

func (this *DoubleValue) Read(in *io.DataInputX)

func (*DoubleValue) Write

func (this *DoubleValue) Write(out *io.DataOutputX)

type FloatArray

type FloatArray struct {
	Val []float32
}

func NewFloatArray

func NewFloatArray(v []float32) *FloatArray

func (*FloatArray) CompareTo

func (this *FloatArray) CompareTo(o Value) int

func (*FloatArray) Equals

func (this *FloatArray) Equals(o Value) bool

func (*FloatArray) GetValueType

func (this *FloatArray) GetValueType() byte

func (*FloatArray) Read

func (this *FloatArray) Read(in *io.DataInputX)

func (*FloatArray) Write

func (this *FloatArray) Write(out *io.DataOutputX)

type FloatValue

type FloatValue struct {
	Val float32
}

func NewFloatValue

func NewFloatValue(v float32) *FloatValue

func (*FloatValue) CompareTo

func (this *FloatValue) CompareTo(o Value) int

func (*FloatValue) Equals

func (this *FloatValue) Equals(o Value) bool

func (*FloatValue) GetValueType

func (this *FloatValue) GetValueType() byte

func (*FloatValue) Read

func (this *FloatValue) Read(in *io.DataInputX)

func (*FloatValue) Write

func (this *FloatValue) Write(out *io.DataOutputX)

type IP4Value

type IP4Value struct {
	Val []byte
}

func NewIP4Value

func NewIP4Value(v []byte) *IP4Value

func NewIP4ValueString

func NewIP4ValueString(v string) *IP4Value

func (*IP4Value) CompareTo

func (this *IP4Value) CompareTo(o Value) int

func (*IP4Value) Equals

func (this *IP4Value) Equals(o Value) bool

func (*IP4Value) GetValueType

func (this *IP4Value) GetValueType() byte

func (*IP4Value) Read

func (this *IP4Value) Read(in *io.DataInputX)

func (*IP4Value) Write

func (this *IP4Value) Write(out *io.DataOutputX)

type IntArray

type IntArray struct {
	Val []int32
}

func NewIntArray

func NewIntArray(v []int32) *IntArray

func (*IntArray) CompareTo

func (this *IntArray) CompareTo(o Value) int

func (*IntArray) Equals

func (this *IntArray) Equals(o Value) bool

func (*IntArray) GetValueType

func (this *IntArray) GetValueType() byte

func (*IntArray) Read

func (this *IntArray) Read(in *io.DataInputX)

func (*IntArray) Write

func (this *IntArray) Write(out *io.DataOutputX)

type IntMapValue

type IntMapValue struct {
	// contains filtered or unexported fields
}

func NewIntMapValue

func NewIntMapValue() *IntMapValue

func (*IntMapValue) Clear

func (this *IntMapValue) Clear()

func (*IntMapValue) CompareTo

func (this *IntMapValue) CompareTo(o Value) int

func (*IntMapValue) Equals

func (this *IntMapValue) Equals(o Value) bool

func (*IntMapValue) Get

func (this *IntMapValue) Get(key int32) Value

func (*IntMapValue) GetBool

func (this *IntMapValue) GetBool(key int32) bool

func (*IntMapValue) GetString

func (this *IntMapValue) GetString(key int32) string

func (*IntMapValue) GetValueType

func (this *IntMapValue) GetValueType() byte

func (*IntMapValue) Keys

func (this *IntMapValue) Keys() hmap.IntEnumer

func (*IntMapValue) NewList

func (this *IntMapValue) NewList(key int32) *ListValue

func (*IntMapValue) Put

func (this *IntMapValue) Put(key int32, value Value)

func (*IntMapValue) PutLong

func (this *IntMapValue) PutLong(key int32, value int64)

func (*IntMapValue) PutString

func (this *IntMapValue) PutString(key int32, value string)

func (*IntMapValue) Read

func (this *IntMapValue) Read(din *io.DataInputX)

func (*IntMapValue) Size

func (this *IntMapValue) Size() int

func (*IntMapValue) Write

func (this *IntMapValue) Write(dout *io.DataOutputX)

func (*IntMapValue) WriteValue

func (this *IntMapValue) WriteValue(out *io.DataOutputX) *io.DataOutputX

type IntValue

type IntValue struct {
	Val int32
}

func NewIntValue

func NewIntValue(v int32) *IntValue

func (*IntValue) CompareTo

func (this *IntValue) CompareTo(o Value) int

func (*IntValue) Equals

func (this *IntValue) Equals(o Value) bool

func (*IntValue) GetValueType

func (this *IntValue) GetValueType() byte

func (*IntValue) Read

func (this *IntValue) Read(in *io.DataInputX)

func (*IntValue) Write

func (this *IntValue) Write(out *io.DataOutputX)

type ListValue

type ListValue struct {
	// contains filtered or unexported fields
}

func NewListValue

func NewListValue(value []interface{}) *ListValue

func (*ListValue) Add

func (this *ListValue) Add(value Value)

func (*ListValue) AddLong

func (this *ListValue) AddLong(value int64)

func (*ListValue) AddString

func (this *ListValue) AddString(value string)

func (*ListValue) Clear

func (this *ListValue) Clear()

func (*ListValue) CompareTo

func (this *ListValue) CompareTo(o Value) int

func (*ListValue) Equals

func (this *ListValue) Equals(o Value) bool

func (*ListValue) Get

func (this *ListValue) Get(i int) Value

func (*ListValue) GetBool

func (this *ListValue) GetBool(i int) bool

func (*ListValue) GetString

func (this *ListValue) GetString(i int) string

func (*ListValue) GetValueType

func (this *ListValue) GetValueType() byte

func (*ListValue) Read

func (this *ListValue) Read(din *io.DataInputX)

func (*ListValue) Set

func (this *ListValue) Set(idx int, value Value)

func (*ListValue) Size

func (this *ListValue) Size() int

func (*ListValue) Write

func (this *ListValue) Write(dout *io.DataOutputX)

type LongArray

type LongArray struct {
	Val []int64
}

func NewLongArray

func NewLongArray(v []int64) *LongArray

func (*LongArray) CompareTo

func (this *LongArray) CompareTo(o Value) int

func (*LongArray) Equals

func (this *LongArray) Equals(o Value) bool

func (*LongArray) GetValueType

func (this *LongArray) GetValueType() byte

func (*LongArray) Read

func (this *LongArray) Read(in *io.DataInputX)

func (*LongArray) Write

func (this *LongArray) Write(out *io.DataOutputX)

type LongSummary

type LongSummary struct {
	Sum   int64
	Count int32
	Min   int64
	Max   int64
}

func NewLongSummary

func NewLongSummary() *LongSummary

func (*LongSummary) Add

func (this *LongSummary) Add(other SummaryValue) SummaryValue

func (*LongSummary) AddCount

func (this *LongSummary) AddCount()

func (*LongSummary) CompareTo

func (this *LongSummary) CompareTo(o Value) int

func (*LongSummary) DoubleAvg

func (this *LongSummary) DoubleAvg() float64

func (*LongSummary) DoubleMax

func (this *LongSummary) DoubleMax() float64

func (*LongSummary) DoubleMin

func (this *LongSummary) DoubleMin() float64

func (*LongSummary) DoubleSum

func (this *LongSummary) DoubleSum() float64

func (*LongSummary) Equals

func (this *LongSummary) Equals(o Value) bool

func (*LongSummary) GetCount

func (this *LongSummary) GetCount() int32

func (*LongSummary) GetValueType

func (this *LongSummary) GetValueType() byte

func (*LongSummary) LongAvg

func (this *LongSummary) LongAvg() int64

func (*LongSummary) LongMax

func (this *LongSummary) LongMax() int64

func (*LongSummary) LongMin

func (this *LongSummary) LongMin() int64

func (*LongSummary) LongSum

func (this *LongSummary) LongSum() int64

func (*LongSummary) Read

func (this *LongSummary) Read(in *io.DataInputX)

func (*LongSummary) ToString

func (this *LongSummary) ToString() string

func (*LongSummary) Write

func (this *LongSummary) Write(out *io.DataOutputX)

type LongValue

type LongValue struct {
	Val int64
}

func NewLongValue

func NewLongValue(v int64) *LongValue

func (*LongValue) CompareTo

func (this *LongValue) CompareTo(o Value) int

func (*LongValue) Equals

func (this *LongValue) Equals(o Value) bool

func (*LongValue) GetValueType

func (this *LongValue) GetValueType() byte

func (*LongValue) Read

func (this *LongValue) Read(in *io.DataInputX)

func (*LongValue) Write

func (this *LongValue) Write(out *io.DataOutputX)

type MapValue

type MapValue struct {
	// contains filtered or unexported fields
}

func NewMapValue

func NewMapValue() *MapValue

func ReadMapValue

func ReadMapValue(in *io.DataInputX) (ret *MapValue)

func (*MapValue) Clear

func (this *MapValue) Clear()

func (*MapValue) CompareTo

func (this *MapValue) CompareTo(o Value) int

func (*MapValue) ContainsKey

func (this *MapValue) ContainsKey(key string) bool

func (*MapValue) Equals

func (this *MapValue) Equals(o Value) bool

func (*MapValue) Get

func (this *MapValue) Get(key string) Value

func (*MapValue) GetBool

func (this *MapValue) GetBool(key string) bool

func (*MapValue) GetFloat

func (this *MapValue) GetFloat(key string) float32

func (*MapValue) GetLong

func (this *MapValue) GetLong(key string) int64

func (*MapValue) GetString

func (this *MapValue) GetString(key string) string

func (*MapValue) GetValueType

func (this *MapValue) GetValueType() byte

func (*MapValue) IsEmpty

func (this *MapValue) IsEmpty() bool

func (*MapValue) Keys

func (this *MapValue) Keys() hmap.StringEnumer

func (*MapValue) NewList

func (this *MapValue) NewList(name string) *ListValue

func (*MapValue) Put

func (this *MapValue) Put(key string, v Value)

func (*MapValue) PutAll added in v0.0.27

func (this *MapValue) PutAll(m *MapValue)

func (*MapValue) PutLong

func (this *MapValue) PutLong(key string, v int64)

func (*MapValue) PutString

func (this *MapValue) PutString(key string, v string)

func (*MapValue) Read

func (this *MapValue) Read(din *io.DataInputX)

func (*MapValue) Size

func (this *MapValue) Size() int

func (*MapValue) String

func (this *MapValue) String() string

func (*MapValue) ToString

func (this *MapValue) ToString() string

func (*MapValue) Write

func (this *MapValue) Write(dout *io.DataOutputX)

type NullValue

type NullValue struct {
}
var NULL_VALUE *NullValue = new(NullValue)

func NewNullValue

func NewNullValue() *NullValue

func (*NullValue) CompareTo

func (this *NullValue) CompareTo(o Value) int

func (*NullValue) Equals

func (this *NullValue) Equals(o Value) bool

func (*NullValue) GetValueType

func (this *NullValue) GetValueType() byte

func (*NullValue) Read

func (this *NullValue) Read(in *io.DataInputX)

func (*NullValue) Write

func (this *NullValue) Write(out *io.DataOutputX)

type SummaryValue

type SummaryValue interface {
	Value
	AddCount()

	//Add(Number value) *SummaryValue
	Add(num SummaryValue) SummaryValue
	LongSum() int64
	LongMin() int64
	LongMax() int64
	LongAvg() int64
	DoubleSum() float64
	DoubleMin() float64
	DoubleMax() float64
	DoubleAvg() float64
	GetCount() int32
}

type TextArray

type TextArray struct {
	Val []string
}

func NewTextArray

func NewTextArray(v []string) *TextArray

func (*TextArray) CompareTo

func (this *TextArray) CompareTo(o Value) int

func (*TextArray) Equals

func (this *TextArray) Equals(o Value) bool

func (*TextArray) GetValueType

func (this *TextArray) GetValueType() byte

func (*TextArray) Read

func (this *TextArray) Read(in *io.DataInputX)

func (*TextArray) Write

func (this *TextArray) Write(out *io.DataOutputX)

type TextHashValue

type TextHashValue struct {
	Val int32
}

func NewTextHashValue

func NewTextHashValue(v int32) *TextHashValue

func (*TextHashValue) CompareTo

func (this *TextHashValue) CompareTo(o Value) int

func (*TextHashValue) Equals

func (this *TextHashValue) Equals(o Value) bool

func (*TextHashValue) GetValueType

func (this *TextHashValue) GetValueType() byte

func (*TextHashValue) Read

func (this *TextHashValue) Read(in *io.DataInputX)

func (*TextHashValue) Write

func (this *TextHashValue) Write(out *io.DataOutputX)

type TextValue

type TextValue struct {
	Val string
}

func NewTextValue

func NewTextValue(v string) *TextValue

func (*TextValue) CompareTo

func (this *TextValue) CompareTo(o Value) int

func (*TextValue) Equals

func (this *TextValue) Equals(o Value) bool

func (*TextValue) GetValueType

func (this *TextValue) GetValueType() byte

func (*TextValue) Read

func (this *TextValue) Read(in *io.DataInputX)

func (*TextValue) Write

func (this *TextValue) Write(out *io.DataOutputX)

type Value

type Value interface {
	GetValueType() byte
	Equals(o Value) bool
	CompareTo(o Value) int
	Write(out *io.DataOutputX)
	Read(in *io.DataInputX)
}

func CreateValue

func CreateValue(code byte) Value

func ReadValue

func ReadValue(in *io.DataInputX) Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL