01: /*
02: * Copyright 2007 Hippo.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 nl.hippo.cms.searchandreplace;
17:
18: /**
19: * <p>
20: * The result of replacing a text in a string: the resulting string and the
21: * number of replacements made.
22: * </p>
23: */
24: class ReplacementResult {
25: /**
26: * <p>
27: * The string in which the replacements have been made.
28: * </p>
29: */
30: private String m_resultString;
31:
32: /**
33: * <p>
34: * The number of replacements made.
35: * </p>
36: */
37: private int m_numberOfReplacements;
38:
39: /**
40: * <p>
41: * Create an instance of the replacement result initializing both
42: * fields.
43: * </p>
44: *
45: * @param resultString
46: * the string in which the replacements have been made.
47: * @param numberOfReplacements
48: * the number of replacements made.
49: */
50: ReplacementResult(String resultString, int numberOfReplacements) {
51: super ();
52:
53: m_resultString = resultString;
54: m_numberOfReplacements = numberOfReplacements;
55: }
56:
57: /**
58: * <p>
59: * Get the result string.
60: * </p>
61: *
62: * @return the result string.
63: */
64: String getResultString() {
65: return m_resultString;
66: }
67:
68: /**
69: * <p>
70: * Get the number of replacements made.
71: * </p>
72: *
73: * @return the number of replacements made.
74: */
75: int getNumberOfReplacements() {
76: return m_numberOfReplacements;
77: }
78: }
|