1 19 package org.netbeans.modules.db.sql.visualeditor.querymodel; 20 21 22 import java.util.Collection ; 23 24 27 public final class SortSpecification implements QueryItem { 28 29 31 private ColumnItem _column; 32 33 private String _direction; 35 36 37 39 public SortSpecification(ColumnItem col, String direction) { 40 _column = col; 41 _direction = direction; 42 } 43 44 public SortSpecification(ColumnItem col) { 45 this(col, "ASC"); } 47 48 49 51 public String genText() { 52 return _column.genText() + " " + _direction; 54 } 55 56 57 59 public String getDirection() { 60 return _direction; 61 } 62 63 public Column getColumn() { 64 if (_column instanceof ColumnNode) return (Column)_column; return null; 65 } 66 67 public void getReferencedColumns(Collection columns) { 68 columns.add(_column.getReferencedColumn()); 69 } 70 71 void renameTableSpec(String oldTableSpec, String corrName) { 72 _column.renameTableSpec(oldTableSpec, corrName); 73 } 74 75 public void getQueryItems(Collection items) { 76 items.add(_column); 77 } 78 79 83 87 91 } 97 98 99 | Popular Tags |