01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /* $Id: KeepValue.java 426576 2006-07-28 15:44:37Z jeremias $ */
19:
20: package org.apache.fop.datatypes;
21:
22: /**
23: * Keep Value
24: * Stores the different types of keeps in a single convenient format.
25: */
26: public class KeepValue {
27: /** constant for keep-with-always */
28: public static final String KEEP_WITH_ALWAYS = "KEEP_WITH_ALWAYS";
29: /** constant for automatic keep-with computation */
30: public static final String KEEP_WITH_AUTO = "KEEP_WITH_AUTO";
31: /** constant for a user-settable keep-with value (??) */
32: public static final String KEEP_WITH_VALUE = "KEEP_WITH_VALUE";
33: private String type = KEEP_WITH_AUTO;
34: private int value = 0;
35:
36: /**
37: * Constructor
38: * @param type one of "KEEP_WITH_ALWAYS", "KEEP_WITH_AUTO", or
39: * "KEEP_WITH_VALUE"
40: * @param val keep-with value to use (used only by KEEP_WITH_VALUE ??).
41: */
42: public KeepValue(String type, int val) {
43: this .type = type;
44: this .value = val;
45: }
46:
47: /**
48: * @return the keep-with value
49: */
50: public int getValue() {
51: return value;
52: }
53:
54: /**
55: * @return the descriptive type
56: */
57: public String getType() {
58: return type;
59: }
60:
61: /**
62: * @return string representation of this
63: */
64: public String toString() {
65: return type;
66: }
67:
68: }
|