Kinetica   C#   API  Version 7.2.3.0
SpecificFixed.cs
Go to the documentation of this file.
1 
18 using System;
19 using System.Collections.Generic;
20 using System.Linq;
21 using System.Text;
22 using Avro.Generic;
23 
24 namespace Avro.Specific
25 {
29  public abstract class SpecificFixed : GenericFixed
30  {
31  public SpecificFixed(uint size) : base(size) { }
32  public abstract new Schema Schema { get; }
33 
34  protected bool Equals(SpecificFixed obj)
35  {
36  if (this == obj) return true;
37  if (obj != null && obj is SpecificFixed)
38  {
39  SpecificFixed that = obj as SpecificFixed;
40  if (that.Schema.Equals(this.Schema))
41  {
42  for (int i = 0; i < value.Length; i++) if (this.value[i] != that.Value[i]) return false;
43  return true;
44  }
45  }
46  return false;
47 
48  }
49 
50  public override bool Equals(object obj)
51  {
52  if (ReferenceEquals(null, obj)) return false;
53  if (ReferenceEquals(this, obj)) return true;
54  if (obj.GetType() != this.GetType()) return false;
55  return Equals((SpecificFixed) obj);
56  }
57 
58  public override int GetHashCode()
59  {
60  int result = Schema.GetHashCode();
61  foreach (byte b in value)
62  {
63  result += 23 * b;
64  }
65  return result;
66  }
67  }
68 }
override int GetHashCode()
Hash code function
Definition: Schema.cs:272
Base class for all schema types
Definition: Schema.cs:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Base class for all generated classes
bool Equals(SpecificFixed obj)
abstract new Schema Schema
override bool Equals(object obj)
readonly byte [] value
Definition: GenericFixed.cs:30
The default type used by GenericReader and GenericWriter for objects for FixedSchema
Definition: GenericFixed.cs:28