01: /*
02: * IndexColumn.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;
13:
14: import workbench.util.StringUtil;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class IndexColumn {
21: private String column;
22: private String direction;
23:
24: public IndexColumn(String col, String dir) {
25: this .column = col;
26: this .direction = dir;
27: }
28:
29: public String getColumn() {
30: return this .column;
31: }
32:
33: public String getDirection() {
34: return this .direction;
35: }
36:
37: public String getExpression() {
38: if (StringUtil.isEmptyString(direction)) {
39: return this .column;
40: } else {
41: return this .column + " " + this.direction;
42: }
43: }
44: }
|