示例#1
0
 public override bool Equals(Object obj)
 {
     if (GetType() != obj.GetType())
     {
         return(false);
     }
     iText.Layout.Properties.UnitValue other = (iText.Layout.Properties.UnitValue)obj;
     return(JavaUtil.IntegerCompare(unitType, other.unitType) == 0 && JavaUtil.FloatCompare(value, other.value)
            == 0);
 }
示例#2
0
        public virtual int CompareTo(iText.Kernel.Pdf.PdfVersion o)
        {
            int majorResult = JavaUtil.IntegerCompare(major, o.major);

            if (majorResult != 0)
            {
                return(majorResult);
            }
            else
            {
                return(JavaUtil.IntegerCompare(minor, o.minor));
            }
        }
示例#3
0
            public virtual int Compare(String o1, String o2)
            {
                int lengthComparison = -JavaUtil.IntegerCompare(o1.Length, o2.Length);

                if (0 != lengthComparison)
                {
                    return(lengthComparison);
                }
                else
                {
                    return(string.CompareOrdinal(o1, o2));
                }
            }
示例#4
0
 protected internal virtual int CompareContent(iText.Kernel.Pdf.PdfPrimitiveObject o)
 {
     for (int i = 0; i < Math.Min(content.Length, o.content.Length); i++)
     {
         if (content[i] > o.content[i])
         {
             return(1);
         }
         if (content[i] < o.content[i])
         {
             return(-1);
         }
     }
     return(JavaUtil.IntegerCompare(content.Length, o.content.Length));
 }
示例#5
0
        public virtual int Compare(ITextChunkLocation first, ITextChunkLocation second)
        {
            if (first == second)
            {
                return(0);
            }
            // not really needed, but just in case
            int result;

            result = JavaUtil.IntegerCompare(first.OrientationMagnitude(), second.OrientationMagnitude());
            if (result != 0)
            {
                return(result);
            }
            int distPerpendicularDiff = first.DistPerpendicular() - second.DistPerpendicular();

            if (distPerpendicularDiff != 0)
            {
                return(distPerpendicularDiff);
            }
            return(leftToRight ? JavaUtil.FloatCompare(first.DistParallelStart(), second.DistParallelStart()) : -JavaUtil.FloatCompare
                       (first.DistParallelEnd(), second.DistParallelEnd()));
        }
            public virtual int Compare(LocationTextExtractionStrategy2.ITextChunkLocation first, LocationTextExtractionStrategy2.ITextChunkLocation second)
            {
                if (first == second)
                {
                    return(0);
                }
                int num = JavaUtil.IntegerCompare(first.OrientationMagnitude(), second.OrientationMagnitude());

                if (num != 0)
                {
                    return(num);
                }
                int num2 = first.DistPerpendicular() - second.DistPerpendicular();

                if (num2 != 0)
                {
                    return(num2);
                }
                if (!this.leftToRight)
                {
                    return(-JavaUtil.FloatCompare(first.DistParallelEnd(), second.DistParallelEnd()));
                }
                return(JavaUtil.FloatCompare(first.DistParallelStart(), second.DistParallelStart()));
            }