idCounterElem.java 377 B

1234567891011121314151617181920212223242526
  1. package ui.model;
  2. public class idCounterElem {
  3. private static int counter = 1;
  4. public static synchronized int nextId() {
  5. return counter++;
  6. }
  7. /**
  8. * @return the counter
  9. */
  10. public static int getCounter() {
  11. return counter;
  12. }
  13. /**
  14. * @param counter the counter to set
  15. */
  16. public static void setCounter(int counter) {
  17. idCounterElem.counter = counter;
  18. }
  19. }