fork(2) download
  1.  
  2. import java.io.Serializable;
  3. import java.time.LocalDateTime;
  4. import java.util.Comparator;
  5.  
  6. abstract class TLog<T> implements Serializable, Comparable<TLog> {
  7.  
  8. private LocalDateTime moment;
  9. private String origin;
  10. private String type;
  11. private TableName table; // This is a simple enum
  12. private Comparator<TLog<?>> comparator = Comparator.comparing(TLog<?>::getMoment)
  13. .thenComparing(TLog::getTable)
  14. .thenComparing(TLog::getOrigin)
  15. .thenComparing(TLog::getType);
  16.  
  17. public TLog() {
  18. // comparator initialization
  19. }
  20.  
  21. public LocalDateTime getMoment() {
  22. return moment;
  23. }
  24.  
  25. public String getOrigin() {
  26. return origin;
  27. }
  28.  
  29. public String getType() {
  30. return type;
  31. }
  32.  
  33. public TableName getTable() {
  34. return table;
  35. }
  36.  
  37. public Comparator<TLog<?>> getComparator() {
  38. return comparator;
  39. }
  40.  
  41. @Override
  42. public int compareTo(TLog other) {
  43. return comparator.compare(this, other);
  44. }
  45.  
  46. enum TableName {}
  47. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
spoj: The program compiled successfully, but main class was not found.
      Main class should contain method: public static void main (String[] args).
stdout
Standard output is empty