1 22 23 package org.xquark.extractor.sql; 24 25 26 import java.util.ArrayList ; 27 import java.util.List ; 28 29 30 public class SqlFunction extends SqlExpression 31 { 32 33 private static final String RCSRevision = "$Revision: 1.3 $"; 34 private static final String RCSName = "$Name: $"; 35 36 private String _name; 37 protected List _arguments; 38 39 42 public SqlFunction() 43 { 44 } 45 46 public SqlFunction(String functionName) 47 { 48 setName(functionName); 49 } 50 51 56 public SqlFunction(String functionName, List arguments) 57 { 58 setName(functionName); 59 setArguments(arguments); 60 } 61 62 67 public String getName() 68 { 69 return _name; 70 } 71 72 77 public void setName(String aName) 78 { 79 _name = aName; 80 } 81 82 87 public List getArguments() 88 { 89 return _arguments; 90 } 91 92 97 public void setArguments(List aArguments) 98 { 99 _arguments = aArguments; 100 } 101 102 106 public SqlExpression getArgument(int index ) 107 { 108 return (SqlExpression)_arguments.get(index); 109 } 110 111 115 public void setArgument(int index ,SqlExpression operand) 116 { 117 if (null == _arguments ) { 118 _arguments = new ArrayList (); 119 } 120 while (_arguments.size()<index+1 ) { 121 _arguments.add(null); 122 } 123 _arguments.set(index,operand); 124 } 125 126 public int getArgumentNumber() 127 { 128 if (null == _arguments) { 129 return 0; 130 } 131 else { 132 return _arguments.size(); 133 } 134 } 135 136 137 } 138 139 | Popular Tags |