Advertisement
Guest User

DavaOutput

a guest
Apr 11th, 2013
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 18.91 KB | None | 0 0
  1. package java.lang;
  2.  
  3.  
  4. public final class Integer extends Number implements java.lang.Comparable
  5. {
  6.     public static final int MIN_VALUE = -2147483648;
  7.     public static final int MAX_VALUE = 2147483647;
  8.     public static final Class TYPE;
  9.     static final char[] digits;
  10.     static final char[] DigitTens;
  11.     static final char[] DigitOnes;
  12.     static final int[] sizeTable;
  13.     private final int value;
  14.     public static final int SIZE = 32;
  15.     private static final long serialVersionUID = 1360826667806852920l;
  16.     static final boolean $assertionsDisabled;
  17.  
  18.     public static String toString(int  i0, int  i1)
  19.     {
  20.  
  21.         char[] r0;
  22.         boolean $z1;
  23.         int i2, $i4;
  24.         label_0:
  25.         {
  26.             if (i1 >= 2 && i1 <= 36)
  27.             {
  28.                 break label_0;
  29.             }
  30.  
  31.             i1 = 10;
  32.         } //end label_0:
  33.  
  34.  
  35.         if (i1 != 10)
  36.         {
  37.             r0 = new char[33];
  38.  
  39.             if (i0 >= 0)
  40.             {
  41.                 $z1 = false;
  42.             }
  43.             else
  44.             {
  45.                 $z1 = true;
  46.             }
  47.  
  48.             i2 = SIZE;
  49.  
  50.             if ( ! ($z1))
  51.             {
  52.                 i0 = (- (i0));
  53.             }
  54.  
  55.             while (i0 <= (- (i1)))
  56.             {
  57.                 $i4 = i2;
  58.                 i2--;
  59.                 r0[$i4] = digits[(- (i0 % i1))];
  60.                 i0 = i0 / i1;
  61.             }
  62.  
  63.             r0[i2] = digits[(- (i0))];
  64.  
  65.             if ($z1)
  66.             {
  67.                 i2--;
  68.                 r0[i2] = '-';
  69.             }
  70.  
  71.             return new String(r0, i2, 33 - i2);
  72.         }
  73.  
  74.         return Integer.toString(i0);
  75.     }
  76.  
  77.     public static String toHexString(int  i0)
  78.     {
  79.  
  80.  
  81.         return Integer.toUnsignedString(i0, 4);
  82.     }
  83.  
  84.     public static String toOctalString(int  i0)
  85.     {
  86.  
  87.  
  88.         return Integer.toUnsignedString(i0, 3);
  89.     }
  90.  
  91.     public static String toBinaryString(int  i0)
  92.     {
  93.  
  94.  
  95.         return Integer.toUnsignedString(i0, 1);
  96.     }
  97.  
  98.     private static String toUnsignedString(int  i0, int  i1)
  99.     {
  100.  
  101.         char[] r0;
  102.         int i2, i3, i4;
  103.         r0 = new char[SIZE];
  104.         i2 = SIZE;
  105.         i3 = 1 << i1;
  106.         i4 = i3 - 1;
  107.  
  108.         do
  109.         {
  110.             i2--;
  111.             r0[i2] = digits[i0 & i4];
  112.             i0 = i0 >>> i1;
  113.         }
  114.         while (i0 != 0);
  115.  
  116.         return new String(r0, i2, SIZE - i2);
  117.     }
  118.  
  119.     public static String toString(int  i0)
  120.     {
  121.  
  122.         int $i4;
  123.         char[] r0;
  124.         if (i0 != MIN_VALUE)
  125.         {
  126.             if (i0 >= 0)
  127.             {
  128.                 $i4 = Integer.stringSize(i0);
  129.             }
  130.             else
  131.             {
  132.                 $i4 = Integer.stringSize((- (i0))) + 1;
  133.             }
  134.  
  135.             r0 = new char[$i4];
  136.             Integer.getChars(i0, $i4, r0);
  137.             return new String(0, $i4, r0);
  138.         }
  139.  
  140.         return "-2147483648";
  141.     }
  142.  
  143.     static void getChars(int  i0, int  i1, char[]  r0)
  144.     {
  145.  
  146.         int i2, i4, i5, i11, i15, i19, i21;
  147.         char c3;
  148.         i2 = i1;
  149.         c3 = '\u0000';
  150.  
  151.         if (i0 < 0)
  152.         {
  153.             c3 = '-';
  154.             i0 = (- (i0));
  155.         }
  156.  
  157.         while (i0 >= 65536)
  158.         {
  159.             i4 = i0 / 100;
  160.             i5 = i0 - ((i4 << 6) + (i4 << 5) + (i4 << 2));
  161.             i0 = i4;
  162.             i11 = i2 + -1;
  163.             r0[i11] = DigitOnes[i5];
  164.             i2 = i11 + -1;
  165.             r0[i2] = DigitTens[i5];
  166.         }
  167.  
  168.         do
  169.         {
  170.             i15 = i0 * 52429 >>> 19;
  171.             i19 = i0 - ((i15 << 3) + (i15 << 1));
  172.             i2--;
  173.             r0[i2] = digits[i19];
  174.             i0 = i15;
  175.         }
  176.         while (i0 != 0);
  177.  
  178.         if (c3 != '\u0000')
  179.         {
  180.             i21 = i2 + -1;
  181.             r0[i21] = c3;
  182.         }
  183.     }
  184.  
  185.     static int stringSize(int  i0)
  186.     {
  187.  
  188.         int i1;
  189.         for (i1 = 0; i0 > sizeTable[i1]; i1++)
  190.         {
  191.         }
  192.  
  193.         return i1 + 1;
  194.     }
  195.  
  196.     public static int parseInt(String  r0, int  i0) throws java.lang.NumberFormatException
  197.     {
  198.  
  199.         int i1, i2, i3, i4, i6, i7, $i8, i10, $i12;
  200.         boolean z0;
  201.         char c5;
  202.         if (r0 != null)
  203.         {
  204.             if (i0 >= 2)
  205.             {
  206.                 if (i0 <= 36)
  207.                 {
  208.                     i1 = 0;
  209.                     z0 = false;
  210.                     i2 = 0;
  211.                     i3 = r0.length();
  212.                     i4 = -2147483647;
  213.  
  214.                     if (i3 > 0)
  215.                     {
  216.                         c5 = r0.charAt(0);
  217.  
  218.                         if (c5 < '0')
  219.                         {
  220.                             if (c5 != '-')
  221.                             {
  222.                                 if (c5 != '+')
  223.                                 {
  224.                                     throw NumberFormatException.forInputString(r0);
  225.                                 }
  226.                             }
  227.                             else
  228.                             {
  229.                                 z0 = true;
  230.                                 i4 = MIN_VALUE;
  231.                             }
  232.  
  233.                             if (i3 != 1)
  234.                             {
  235.                                 i2++;
  236.                             }
  237.                             else
  238.                             {
  239.                                 throw NumberFormatException.forInputString(r0);
  240.                             }
  241.                         }
  242.  
  243.                         i6 = i4 / i0;
  244.  
  245.                         while (i2 < i3)
  246.                         {
  247.                             $i8 = i2;
  248.                             i2++;
  249.                             i7 = Character.digit(r0.charAt($i8), i0);
  250.  
  251.                             if (i7 >= 0)
  252.                             {
  253.                                 if (i1 >= i6)
  254.                                 {
  255.                                     i10 = i1 * i0;
  256.  
  257.                                     if (i10 >= i4 + i7)
  258.                                     {
  259.                                         i1 = i10 - i7;
  260.                                     }
  261.                                     else
  262.                                     {
  263.                                         throw NumberFormatException.forInputString(r0);
  264.                                     }
  265.                                 }
  266.                                 else
  267.                                 {
  268.                                     throw NumberFormatException.forInputString(r0);
  269.                                 }
  270.                             }
  271.                             else
  272.                             {
  273.                                 throw NumberFormatException.forInputString(r0);
  274.                             }
  275.                         }
  276.  
  277.                         if ( ! (z0))
  278.                         {
  279.                             $i12 = (- (i1));
  280.                         }
  281.                         else
  282.                         {
  283.                             $i12 = i1;
  284.                         }
  285.  
  286.                         return $i12;
  287.                     }
  288.  
  289.                     throw NumberFormatException.forInputString(r0);
  290.                 }
  291.                 else
  292.                 {
  293.                     throw new NumberFormatException((new StringBuilder()).append("radix ").append(i0).append(" greater than Character.MAX_RADIX").toString());
  294.                 }
  295.             }
  296.             else
  297.             {
  298.                 throw new NumberFormatException((new StringBuilder()).append("radix ").append(i0).append(" less than Character.MIN_RADIX").toString());
  299.             }
  300.         }
  301.         else
  302.         {
  303.             throw new NumberFormatException("null");
  304.         }
  305.     }
  306.  
  307.     public static int parseInt(String  r0) throws java.lang.NumberFormatException
  308.     {
  309.  
  310.  
  311.         return Integer.parseInt(r0, 10);
  312.     }
  313.  
  314.     public static Integer valueOf(String  r0, int  i0) throws java.lang.NumberFormatException
  315.     {
  316.  
  317.  
  318.         return Integer.valueOf(Integer.parseInt(r0, i0));
  319.     }
  320.  
  321.     public static Integer valueOf(String  r0) throws java.lang.NumberFormatException
  322.     {
  323.  
  324.  
  325.         return Integer.valueOf(Integer.parseInt(r0, 10));
  326.     }
  327.  
  328.     public static Integer valueOf(int  i0)
  329.     {
  330.  
  331.  
  332.         if ( ! ($assertionsDisabled) && Integer$IntegerCache.high < 127)
  333.         {
  334.             throw new AssertionError();
  335.         }
  336.  
  337.         if (i0 >= -128 && i0 <= Integer$IntegerCache.high)
  338.         {
  339.             return Integer$IntegerCache.cache[i0 + 128];
  340.         }
  341.  
  342.         return new Integer(i0);
  343.     }
  344.  
  345.     public Integer(int  i0)
  346.     {
  347.  
  348.         value = i0;
  349.     }
  350.  
  351.     public Integer(String  r1) throws java.lang.NumberFormatException
  352.     {
  353.  
  354.         value = Integer.parseInt(r1, 10);
  355.     }
  356.  
  357.     public byte byteValue()
  358.     {
  359.  
  360.  
  361.         return (byte) value;
  362.     }
  363.  
  364.     public short shortValue()
  365.     {
  366.  
  367.  
  368.         return (short) value;
  369.     }
  370.  
  371.     public int intValue()
  372.     {
  373.  
  374.  
  375.         return value;
  376.     }
  377.  
  378.     public long longValue()
  379.     {
  380.  
  381.  
  382.         return (long) value;
  383.     }
  384.  
  385.     public float floatValue()
  386.     {
  387.  
  388.  
  389.         return (float) value;
  390.     }
  391.  
  392.     public double doubleValue()
  393.     {
  394.  
  395.  
  396.         return (double) value;
  397.     }
  398.  
  399.     public String toString()
  400.     {
  401.  
  402.  
  403.         return Integer.toString(value);
  404.     }
  405.  
  406.     public int hashCode()
  407.     {
  408.  
  409.  
  410.         return value;
  411.     }
  412.  
  413.     public boolean equals(Object  r1)
  414.     {
  415.  
  416.         boolean $z1;
  417.         if ( ! (r1 instanceof Integer))
  418.         {
  419.             return false;
  420.         }
  421.  
  422.         if (value != ((Integer) r1).intValue())
  423.         {
  424.             $z1 = false;
  425.         }
  426.         else
  427.         {
  428.             $z1 = true;
  429.         }
  430.  
  431.         return $z1;
  432.     }
  433.  
  434.     public static Integer getInteger(String  r0)
  435.     {
  436.  
  437.  
  438.         return Integer.getInteger(r0, null);
  439.     }
  440.  
  441.     public static Integer getInteger(String  r0, int  i0)
  442.     {
  443.  
  444.         Integer r1, $r2;
  445.         r1 = Integer.getInteger(r0, null);
  446.  
  447.         if (r1 != null)
  448.         {
  449.             $r2 = r1;
  450.         }
  451.         else
  452.         {
  453.             $r2 = Integer.valueOf(i0);
  454.         }
  455.  
  456.         return $r2;
  457.     }
  458.  
  459.     public static Integer getInteger(String  r0, Integer  r1)
  460.     {
  461.  
  462.         String r2;
  463.         Integer $r7;
  464.         r2 = null;
  465.  
  466.         try
  467.         {
  468.             r2 = System.getProperty(r0);
  469.         }
  470.         catch (IllegalArgumentException $r4)
  471.         {
  472.         }
  473.         catch (NullPointerException $r5)
  474.         {
  475.         }
  476.  
  477.         label_2:
  478.         if (r2 != null)
  479.         {
  480.             try
  481.             {
  482.                 $r7 = Integer.decode(r2);
  483.             }
  484.             catch (NumberFormatException $r8)
  485.             {
  486.                 break label_2;
  487.             }
  488.  
  489.             return $r7;
  490.         }
  491.  
  492.         return r1;
  493.     }
  494.  
  495.     public static Integer decode(String  r0) throws java.lang.NumberFormatException
  496.     {
  497.  
  498.         byte b0;
  499.         int i1;
  500.         boolean z0;
  501.         char c2;
  502.         Integer r1, $r7, r8;
  503.         String $r14;
  504.         b0 = (byte) (byte) 10;
  505.         i1 = 0;
  506.         z0 = false;
  507.  
  508.         if (r0.length() != 0)
  509.         {
  510.             c2 = r0.charAt(0);
  511.  
  512.             if (c2 != '-')
  513.             {
  514.                 if (c2 == '+')
  515.                 {
  516.                     i1++;
  517.                 }
  518.             }
  519.             else
  520.             {
  521.                 z0 = true;
  522.                 i1++;
  523.             }
  524.  
  525.             label_4:
  526.             {
  527.                 if ( ! (r0.startsWith("0x", i1) || r0.startsWith("0X", i1)) )
  528.                 {
  529.                     if ( ! (r0.startsWith("#", i1)))
  530.                     {
  531.                         if ( ! (r0.startsWith("0", i1)) || r0.length() <= 1 + i1)
  532.                         {
  533.                             break label_4;
  534.                         }
  535.  
  536.                         i1++;
  537.                         b0 = (byte) (byte) 8;
  538.                         break label_4;
  539.                     }
  540.  
  541.                     i1++;
  542.                     b0 = (byte) (byte) 16;
  543.                     break label_4;
  544.                 }
  545.  
  546.                 i1 = i1 + 2;
  547.                 b0 = (byte) (byte) 16;
  548.             } //end label_4:
  549.  
  550.  
  551.             if ( ! (r0.startsWith("-", i1) || r0.startsWith("+", i1)) )
  552.             {
  553.                 try
  554.                 {
  555.                     r1 = Integer.valueOf(r0.substring(i1), b0);
  556.  
  557.                     if ( ! (z0))
  558.                     {
  559.                         $r7 = r1;
  560.                     }
  561.                     else
  562.                     {
  563.                         $r7 = Integer.valueOf((- (r1.intValue())));
  564.                     }
  565.  
  566.                     r8 = $r7;
  567.                 }
  568.                 catch (NumberFormatException $r9)
  569.                 {
  570.  
  571.                     if ( ! (z0))
  572.                     {
  573.                         $r14 = r0.substring(i1);
  574.                     }
  575.                     else
  576.                     {
  577.                         $r14 = (new StringBuilder()).append("-").append(r0.substring(i1)).toString();
  578.                     }
  579.  
  580.                     r8 = Integer.valueOf($r14, b0);
  581.                 }
  582.  
  583.                 return r8;
  584.             }
  585.  
  586.             throw new NumberFormatException("Sign character in wrong position");
  587.         }
  588.         else
  589.         {
  590.             throw new NumberFormatException("Zero length string");
  591.         }
  592.     }
  593.  
  594.     public int compareTo(Integer  r1)
  595.     {
  596.  
  597.  
  598.         return Integer.compare(value, r1.value);
  599.     }
  600.  
  601.     public static int compare(int  i0, int  i1)
  602.     {
  603.  
  604.         byte $b2;
  605.         if (i0 >= i1)
  606.         {
  607.             if (i0 != i1)
  608.             {
  609.                 $b2 = (byte) (byte) 1;
  610.             }
  611.             else
  612.             {
  613.                 $b2 = (byte) (byte) 0;
  614.             }
  615.         }
  616.         else
  617.         {
  618.             $b2 = (byte) (byte) -1;
  619.         }
  620.  
  621.         return $b2;
  622.     }
  623.  
  624.     public static int highestOneBit(int  i0)
  625.     {
  626.  
  627.         int i2, i4, i6, i8, i10;
  628.         i2 = i0 | i0 >> 1;
  629.         i4 = i2 | i2 >> 2;
  630.         i6 = i4 | i4 >> 4;
  631.         i8 = i6 | i6 >> 8;
  632.         i10 = i8 | i8 >> 16;
  633.         return i10 - (i10 >>> 1);
  634.     }
  635.  
  636.     public static int lowestOneBit(int  i0)
  637.     {
  638.  
  639.  
  640.         return i0 & (- (i0));
  641.     }
  642.  
  643.     public static int numberOfLeadingZeros(int  i0)
  644.     {
  645.  
  646.         int i1, i7;
  647.         if (i0 != 0)
  648.         {
  649.             i1 = 1;
  650.  
  651.             if (i0 >>> 16 == 0)
  652.             {
  653.                 i1 = 17;
  654.                 i0 = i0 << 16;
  655.             }
  656.  
  657.             if (i0 >>> 24 == 0)
  658.             {
  659.                 i1 = i1 + 8;
  660.                 i0 = i0 << 8;
  661.             }
  662.  
  663.             if (i0 >>> 28 == 0)
  664.             {
  665.                 i1 = i1 + 4;
  666.                 i0 = i0 << 4;
  667.             }
  668.  
  669.             if (i0 >>> 30 == 0)
  670.             {
  671.                 i1 = i1 + 2;
  672.                 i0 = i0 << 2;
  673.             }
  674.  
  675.             i7 = i1 - (i0 >>> 31);
  676.             return i7;
  677.         }
  678.  
  679.         return SIZE;
  680.     }
  681.  
  682.     public static int numberOfTrailingZeros(int  i0)
  683.     {
  684.  
  685.         int i1, i2, i3, i4, i5;
  686.         if (i0 != 0)
  687.         {
  688.             i1 = 31;
  689.             i2 = i0 << 16;
  690.  
  691.             if (i2 != 0)
  692.             {
  693.                 i1 = 15;
  694.                 i0 = i2;
  695.             }
  696.  
  697.             i3 = i0 << 8;
  698.  
  699.             if (i3 != 0)
  700.             {
  701.                 i1 = i1 - 8;
  702.                 i0 = i3;
  703.             }
  704.  
  705.             i4 = i0 << 4;
  706.  
  707.             if (i4 != 0)
  708.             {
  709.                 i1 = i1 - 4;
  710.                 i0 = i4;
  711.             }
  712.  
  713.             i5 = i0 << 2;
  714.  
  715.             if (i5 != 0)
  716.             {
  717.                 i1 = i1 - 2;
  718.                 i0 = i5;
  719.             }
  720.  
  721.             return i1 - (i0 << 1 >>> 31);
  722.         }
  723.  
  724.         return SIZE;
  725.     }
  726.  
  727.     public static int bitCount(int  i0)
  728.     {
  729.  
  730.         int i3, i7, i10, i12, i14;
  731.         i3 = i0 - (i0 >>> 1 & 1431655765);
  732.         i7 = (i3 & 858993459) + (i3 >>> 2 & 858993459);
  733.         i10 = i7 + (i7 >>> 4) & 252645135;
  734.         i12 = i10 + (i10 >>> 8);
  735.         i14 = i12 + (i12 >>> 16);
  736.         return i14 & 63;
  737.     }
  738.  
  739.     public static int rotateLeft(int  i0, int  i1)
  740.     {
  741.  
  742.  
  743.         return i0 << i1 | i0 >>> (- (i1));
  744.     }
  745.  
  746.     public static int rotateRight(int  i0, int  i1)
  747.     {
  748.  
  749.  
  750.         return i0 >>> i1 | i0 << (- (i1));
  751.     }
  752.  
  753.     public static int reverse(int  i0)
  754.     {
  755.  
  756.         int i5, i10, i15, i24;
  757.         i5 = (i0 & 1431655765) << 1 | i0 >>> 1 & 1431655765;
  758.         i10 = (i5 & 858993459) << 2 | i5 >>> 2 & 858993459;
  759.         i15 = (i10 & 252645135) << 4 | i10 >>> 4 & 252645135;
  760.         i24 = i15 << 24 | (i15 & 65280) << 8 | i15 >>> 8 & 65280 | i15 >>> 24;
  761.         return i24;
  762.     }
  763.  
  764.     public static int signum(int  i0)
  765.     {
  766.  
  767.  
  768.         return i0 >> 31 | (- (i0)) >>> 31;
  769.     }
  770.  
  771.     public static int reverseBytes(int  i0)
  772.     {
  773.  
  774.  
  775.         return i0 >>> 24 | i0 >> 8 & 65280 | i0 << 8 & 16711680 | i0 << 24;
  776.     }
  777.  
  778.     public volatile int compareTo(Object  r1)
  779.     {
  780.  
  781.  
  782.         return this.compareTo((Integer) r1);
  783.     }
  784.  
  785.     static
  786.     {
  787.  
  788.         boolean $z1;
  789.         if (class "java/lang/Integer".desiredAssertionStatus())
  790.         {
  791.             $z1 = false;
  792.         }
  793.         else
  794.         {
  795.             $z1 = true;
  796.         }
  797.  
  798.         $assertionsDisabled = $z1;
  799.         TYPE = Class.getPrimitiveClass("int");
  800.         char[] $r2 = {'0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z'};
  801.         digits = $r2;
  802.         char[] $r3 = {'0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '0' , '1' , '1' , '1' , '1' , '1' , '1' , '1' , '1' , '1' , '1' , '2' , '2' , '2' , '2' , '2' , '2' , '2' , '2' , '2' , '2' , '3' , '3' , '3' , '3' , '3' , '3' , '3' , '3' , '3' , '3' , '4' , '4' , '4' , '4' , '4' , '4' , '4' , '4' , '4' , '4' , '5' , '5' , '5' , '5' , '5' , '5' , '5' , '5' , '5' , '5' , '6' , '6' , '6' , '6' , '6' , '6' , '6' , '6' , '6' , '6' , '7' , '7' , '7' , '7' , '7' , '7' , '7' , '7' , '7' , '7' , '8' , '8' , '8' , '8' , '8' , '8' , '8' , '8' , '8' , '8' , '9' , '9' , '9' , '9' , '9' , '9' , '9' , '9' , '9' , '9'};
  803.         DigitTens = $r3;
  804.         char[] $r4 = {'0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9'};
  805.         DigitOnes = $r4;
  806.         int[] $r5 = {9 , 99 , 999 , 9999 , 99999 , 999999 , 9999999 , 99999999 , 999999999 , MAX_VALUE};
  807.         sizeTable = $r5;
  808.     }
  809. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement