fork(1) download
  1.  
  2. class Main
  3. {
  4. public static void main ( String [ ] args )
  5. {
  6. }
  7. }
  8.  
  9.  
  10. enum AllowableImageSize
  11. {
  12. THUMBNAIL_MID(ImageSize.THUMBNAIL_MID), THUMBNAIL(ImageSize.THUMBNAIL);
  13.  
  14. public final ImageSize imageSize;
  15.  
  16. AllowableImageSize(ImageSize imageSize)
  17. {
  18. this.imageSize=imageSize;
  19. }
  20. }
  21.  
  22. enum ImageSize
  23. {
  24. THUMBNAIL(50, 50, "t"), PASSPORT(200, 200, "p"), SMALL(240, 135, "s"), MEDIUM(
  25. 480, 270, "m"), LARGE(960, 540, "l"), A4(800, 600, "a4"),THUMBNAIL_MID(120,155,"t");
  26. /**
  27.   * The width of the image in pixels
  28.   */
  29. private final int width;
  30. /**
  31.   * The height of the image in pixels
  32.   */
  33. private final int height;
  34. /**
  35.   * The image size type
  36.   */
  37. private final String type;
  38.  
  39. ImageSize(int width, int height, String type)
  40. {
  41. this.width = width;
  42. this.height = height;
  43. this.type = type;
  44. }
  45.  
  46. public int getWidth()
  47. {
  48. return width;
  49. }
  50.  
  51. public int getHeight()
  52. {
  53. return height;
  54. }
  55.  
  56. public String getType()
  57. {
  58. return type;
  59. }
  60.  
  61. public static ImageSize getImageSizeByType(String type)
  62. {
  63. if (type != null)
  64. {
  65. if (type.equalsIgnoreCase(THUMBNAIL.getType()))
  66. {
  67. return THUMBNAIL;
  68. }
  69. if (type.equalsIgnoreCase(PASSPORT.getType()))
  70. {
  71. return PASSPORT;
  72. }
  73. if (type.equalsIgnoreCase(SMALL.getType()))
  74. {
  75. return SMALL;
  76. }
  77. if (type.equalsIgnoreCase(MEDIUM.getType()))
  78. {
  79. return MEDIUM;
  80. }
  81. if (type.equalsIgnoreCase(LARGE.getType()))
  82. {
  83. return LARGE;
  84. }
  85. if (type.equalsIgnoreCase(THUMBNAIL_MID.getType()))
  86. {
  87. return THUMBNAIL_MID;
  88. }
  89. }
  90. return null;
  91. }
  92. }
  93.  
  94.  
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Standard output is empty