1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.core;
  17. /**
  18. * Interface that can be implemented by objects that should be
  19. * orderable, e.g. in a Collection. The actual order can be
  20. * interpreted as prioritization, the first object (with the
  21. * lowest order value) having the highest priority.
  22. *
  23. * @author Juergen Hoeller
  24. * @since 07.04.2003
  25. */
  26. public interface Ordered {
  27. /**
  28. * Return the order value of this object,
  29. * higher value meaning greater in terms of sorting.
  30. * Normally starting with 0 or 1, Integer.MAX_VALUE
  31. * indicating greatest.
  32. * Same order values will result in arbitrary positions
  33. * for the affected objects.
  34. *
  35. * <p>Higher value can be interpreted as lower priority,
  36. * consequently the first object has highest priority
  37. * (somewhat analogous to Servlet "load-on-startup" values).
  38. *
  39. * @return the order value
  40. */
  41. public int getOrder();
  42. }