saving development state...

This commit is contained in:
Jae Kwon
2014-08-10 16:35:08 -07:00
parent 50544c50af
commit d300a67bb1
46 changed files with 2458 additions and 1058 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import "bytes"
type ByteSlice []byte
func (self ByteSlice) Equals(other Binary) bool {
func (self ByteSlice) Equals(other interface{}) bool {
if o, ok := other.(ByteSlice); ok {
return bytes.Equal(self, o)
} else {
@@ -13,7 +13,7 @@ func (self ByteSlice) Equals(other Binary) bool {
}
}
func (self ByteSlice) Less(other Binary) bool {
func (self ByteSlice) Less(other interface{}) bool {
if o, ok := other.(ByteSlice); ok {
return bytes.Compare(self, o) < 0 // -1 if a < b
} else {
+18 -18
View File
@@ -19,11 +19,11 @@ type UInt uint
// Byte
func (self Byte) Equals(other Binary) bool {
func (self Byte) Equals(other interface{}) bool {
return self == other
}
func (self Byte) Less(other Binary) bool {
func (self Byte) Less(other interface{}) bool {
if o, ok := other.(Byte); ok {
return self < o
} else {
@@ -67,11 +67,11 @@ func ReadByte(r io.Reader) Byte {
// Int8
func (self Int8) Equals(other Binary) bool {
func (self Int8) Equals(other interface{}) bool {
return self == other
}
func (self Int8) Less(other Binary) bool {
func (self Int8) Less(other interface{}) bool {
if o, ok := other.(Int8); ok {
return self < o
} else {
@@ -115,11 +115,11 @@ func ReadInt8(r io.Reader) Int8 {
// UInt8
func (self UInt8) Equals(other Binary) bool {
func (self UInt8) Equals(other interface{}) bool {
return self == other
}
func (self UInt8) Less(other Binary) bool {
func (self UInt8) Less(other interface{}) bool {
if o, ok := other.(UInt8); ok {
return self < o
} else {
@@ -163,11 +163,11 @@ func ReadUInt8(r io.Reader) UInt8 {
// Int16
func (self Int16) Equals(other Binary) bool {
func (self Int16) Equals(other interface{}) bool {
return self == other
}
func (self Int16) Less(other Binary) bool {
func (self Int16) Less(other interface{}) bool {
if o, ok := other.(Int16); ok {
return self < o
} else {
@@ -213,11 +213,11 @@ func ReadInt16(r io.Reader) Int16 {
// UInt16
func (self UInt16) Equals(other Binary) bool {
func (self UInt16) Equals(other interface{}) bool {
return self == other
}
func (self UInt16) Less(other Binary) bool {
func (self UInt16) Less(other interface{}) bool {
if o, ok := other.(UInt16); ok {
return self < o
} else {
@@ -263,11 +263,11 @@ func ReadUInt16(r io.Reader) UInt16 {
// Int32
func (self Int32) Equals(other Binary) bool {
func (self Int32) Equals(other interface{}) bool {
return self == other
}
func (self Int32) Less(other Binary) bool {
func (self Int32) Less(other interface{}) bool {
if o, ok := other.(Int32); ok {
return self < o
} else {
@@ -313,11 +313,11 @@ func ReadInt32(r io.Reader) Int32 {
// UInt32
func (self UInt32) Equals(other Binary) bool {
func (self UInt32) Equals(other interface{}) bool {
return self == other
}
func (self UInt32) Less(other Binary) bool {
func (self UInt32) Less(other interface{}) bool {
if o, ok := other.(UInt32); ok {
return self < o
} else {
@@ -363,11 +363,11 @@ func ReadUInt32(r io.Reader) UInt32 {
// Int64
func (self Int64) Equals(other Binary) bool {
func (self Int64) Equals(other interface{}) bool {
return self == other
}
func (self Int64) Less(other Binary) bool {
func (self Int64) Less(other interface{}) bool {
if o, ok := other.(Int64); ok {
return self < o
} else {
@@ -413,11 +413,11 @@ func ReadInt64(r io.Reader) Int64 {
// UInt64
func (self UInt64) Equals(other Binary) bool {
func (self UInt64) Equals(other interface{}) bool {
return self == other
}
func (self UInt64) Less(other Binary) bool {
func (self UInt64) Less(other interface{}) bool {
if o, ok := other.(UInt64); ok {
return self < o
} else {
+2 -2
View File
@@ -6,11 +6,11 @@ type String string
// String
func (self String) Equals(other Binary) bool {
func (self String) Equals(other interface{}) bool {
return self == other
}
func (self String) Less(other Binary) bool {
func (self String) Less(other interface{}) bool {
if o, ok := other.(String); ok {
return self < o
} else {
+2 -2
View File
@@ -9,7 +9,7 @@ type Time struct {
time.Time
}
func (self Time) Equals(other Binary) bool {
func (self Time) Equals(other interface{}) bool {
if o, ok := other.(Time); ok {
return self.Equal(o.Time)
} else {
@@ -17,7 +17,7 @@ func (self Time) Equals(other Binary) bool {
}
}
func (self Time) Less(other Binary) bool {
func (self Time) Less(other interface{}) bool {
if o, ok := other.(Time); ok {
return self.Before(o.Time)
} else {