01: /*
02: * ColumnValueSubstring.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.db.importer.modifier;
13:
14: /**
15: *
16: * @author support@sql-workbench.net
17: */
18: public class ColumnValueSubstring {
19: private int start;
20: private int end;
21:
22: public ColumnValueSubstring(int s, int e) {
23: start = s;
24: end = e;
25: }
26:
27: public String getSubstring(String input) {
28: if (input == null)
29: return null;
30: if (start > input.length())
31: return input;
32: if (end > input.length())
33: return input.substring(start);
34: return input.substring(start, end);
35: }
36:
37: public int getStart() {
38: return start;
39: }
40:
41: public int getEnd() {
42: return end;
43: }
44: }
|