예제 #1
0
        public int CompareTo(object obj)
        {
            AaSequence other = (AaSequence)obj;
            int        min   = Math.Min(sequence.Length, other.sequence.Length);

            for (int i = 0; i < min; i++)
            {
                if (sequence[i] != other.sequence[i])
                {
                    if (sequence[i] < other.sequence[i])
                    {
                        return(-1);
                    }
                    return(1);
                }
            }
            if (sequence.Length != other.sequence.Length)
            {
                if (sequence.Length < other.sequence.Length)
                {
                    return(-1);
                }
                return(1);
            }
            if (len != other.len)
            {
                if (len < other.len)
                {
                    return(-1);
                }
                return(1);
            }
            return(0);
        }
예제 #2
0
 public static AaSequence Read(BinaryReader reader)
 {
     AaSequence result = new AaSequence { len = reader.ReadInt32() };
     int n = reader.ReadInt32();
     result.sequence = new ulong[n];
     for (int i = 0; i < result.sequence.Length; i++) {
         result.sequence[i] = reader.ReadUInt64();
     }
     return result;
 }
예제 #3
0
        public static AaSequence Read(BinaryReader reader)
        {
            AaSequence result = new AaSequence {
                len = reader.ReadInt32()
            };
            int n = reader.ReadInt32();

            result.sequence = new ulong[n];
            for (int i = 0; i < result.sequence.Length; i++)
            {
                result.sequence[i] = reader.ReadUInt64();
            }
            return(result);
        }
예제 #4
0
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj is AaSequence)
     {
         AaSequence other = (AaSequence)obj;
         if (other.len != len)
         {
             return(false);
         }
         for (int i = 0; i < sequence.Length; i++)
         {
             if (sequence[i] != other.sequence[i])
             {
                 return(false);
             }
         }
         return(true);
     }
     return(false);
 }