You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

KeepValue.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  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. /* $Id$ */
  17. package org.apache.fop.datatypes;
  18. /**
  19. * Keep Value
  20. * Stores the different types of keeps in a single convenient format.
  21. */
  22. public class KeepValue {
  23. /** constant for keep-with-always */
  24. public static final String KEEP_WITH_ALWAYS = "KEEP_WITH_ALWAYS";
  25. /** constant for automatic keep-with computation */
  26. public static final String KEEP_WITH_AUTO = "KEEP_WITH_AUTO";
  27. /** constant for a user-settable keep-with value (??) */
  28. public static final String KEEP_WITH_VALUE = "KEEP_WITH_VALUE";
  29. private String type = KEEP_WITH_AUTO;
  30. private int value = 0;
  31. /**
  32. * Constructor
  33. * @param type one of "KEEP_WITH_ALWAYS", "KEEP_WITH_AUTO", or
  34. * "KEEP_WITH_VALUE"
  35. * @param val keep-with value to use (used only by KEEP_WITH_VALUE ??).
  36. */
  37. public KeepValue(String type, int val) {
  38. this.type = type;
  39. this.value = val;
  40. }
  41. /**
  42. * @return the keep-with value
  43. */
  44. public int getValue() {
  45. return value;
  46. }
  47. /**
  48. * @return the descriptive type
  49. */
  50. public String getType() {
  51. return type;
  52. }
  53. /**
  54. * @return string representation of this
  55. */
  56. public String toString() {
  57. return type;
  58. }
  59. }