Exemplo n.º 1
0
        public override bool Equals(object other)
        {
            if (!(other is VariableDescriptor))
            {
                return(false);
            }

            VariableDescriptor other_typed = (VariableDescriptor)other;



            if (!other_typed.Name.Equals(this.Name))
            {
                return(false);
            }

            if (!other_typed.DataLevel.Equals(this.DataLevel))
            {
                return(false);
            }

            if (!other_typed.ValueStrings.Count.Equals(this.ValueStrings.Count))
            {
                return(false);
            }

            for (int value_string_index = 0; value_string_index < ValueStrings.Count; value_string_index++)
            {
                if (!this.ValueStrings[value_string_index].Equals(other_typed.ValueStrings[value_string_index]))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        public void Write(BinaryWriter writer)
        {
            writer.Write(this.FeatureCount);
            for (int feature_index = 0; feature_index < FeatureCount; feature_index++)
            {
                VariableDescriptor desciptor = this.feature_descriptors[feature_index];
                writer.Write(desciptor.Name);
                writer.WriteEnum(desciptor.DataLevel);
                writer.WriteStringArray1D(desciptor.ValueStrings);
            }

            writer.Write(this.LabelCount);
            for (int label_index = 0; label_index < LabelCount; label_index++)
            {
                VariableDescriptor desciptor = this.label_descriptors[label_index];
                writer.Write(desciptor.Name);
                writer.WriteEnum(desciptor.DataLevel);
                writer.WriteStringArray1D(desciptor.ValueStrings);
            }
        }