Fan.Sys.Version.compare C# (CSharp) Méthode

compare() public méthode

public compare ( object obj ) : long
obj object
Résultat long
        public override long compare(object obj)
        {
            Version that = (Version)obj;
              List a = this.m_segments;
              List b = that.m_segments;
              for (int i=0; i<a.sz() && i<b.sz(); i++)
              {
            long ai = (a.get(i) as Long).longValue();
            long bi = (b.get(i) as Long).longValue();
            if (ai < bi) return -1;
            if (ai > bi) return +1;
              }
              if (a.sz() < b.sz()) return -1;
              if (a.sz() > b.sz()) return +1;
              return 0;
        }