您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SortDirection.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * 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, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.shared.data.sort;
  17. import java.io.Serializable;
  18. /**
  19. * Describes sorting direction.
  20. *
  21. * @since 7.4
  22. * @author Vaadin Ltd
  23. */
  24. public enum SortDirection implements Serializable {
  25. /**
  26. * Ascending (e.g. A-Z, 1..9) sort order
  27. */
  28. ASCENDING {
  29. @Override
  30. public SortDirection getOpposite() {
  31. return DESCENDING;
  32. }
  33. },
  34. /**
  35. * Descending (e.g. Z-A, 9..1) sort order
  36. */
  37. DESCENDING {
  38. @Override
  39. public SortDirection getOpposite() {
  40. return ASCENDING;
  41. }
  42. };
  43. /**
  44. * Get the sort direction that is the direct opposite to this one.
  45. *
  46. * @return a sort direction value
  47. */
  48. public abstract SortDirection getOpposite();
  49. }