/QingTingFanBianYi/src/com/alibaba/fastjson/serializer/FloatArraySerializer.java

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 62 lines · 54 code · 4 blank · 4 comment · 10 complexity · 43519b1cd9472dacd3a9143749df1464 MD5 · raw file

  1. package com.alibaba.fastjson.serializer;
  2. import java.io.IOException;
  3. import java.lang.reflect.Type;
  4. public class FloatArraySerializer
  5. implements ObjectSerializer
  6. {
  7. public static final FloatArraySerializer instance = new FloatArraySerializer();
  8. public final void write(JSONSerializer paramJSONSerializer, Object paramObject1, Object paramObject2, Type paramType)
  9. throws IOException
  10. {
  11. paramJSONSerializer = paramJSONSerializer.getWriter();
  12. if (paramObject1 == null)
  13. {
  14. if (paramJSONSerializer.isEnabled(SerializerFeature.WriteNullListAsEmpty))
  15. {
  16. paramJSONSerializer.write("[]");
  17. return;
  18. }
  19. paramJSONSerializer.writeNull();
  20. return;
  21. }
  22. paramObject1 = (float[])paramObject1;
  23. int j = paramObject1.length - 1;
  24. if (j == -1)
  25. {
  26. paramJSONSerializer.append("[]");
  27. return;
  28. }
  29. paramJSONSerializer.append('[');
  30. int i = 0;
  31. if (i < j)
  32. {
  33. f = paramObject1[i];
  34. if (Float.isNaN(f))
  35. paramJSONSerializer.writeNull();
  36. while (true)
  37. {
  38. paramJSONSerializer.append(',');
  39. i += 1;
  40. break;
  41. paramJSONSerializer.append(Float.toString(f));
  42. }
  43. }
  44. float f = paramObject1[j];
  45. if (Float.isNaN(f))
  46. paramJSONSerializer.writeNull();
  47. while (true)
  48. {
  49. paramJSONSerializer.append(']');
  50. return;
  51. paramJSONSerializer.append(Float.toString(f));
  52. }
  53. }
  54. }
  55. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  56. * Qualified Name: com.alibaba.fastjson.serializer.FloatArraySerializer
  57. * JD-Core Version: 0.6.2
  58. */