Changeset 7162 for FCSSimpleEndpoint
- Timestamp:
- 01/17/18 15:44:00 (6 years ago)
- Location:
- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/Expression.java
r7057 r7162 76 76 77 77 /** 78 * Get the layer identifier qualifier. 79 * 80 * @return the layer identifier qualifier or <code>null</code> if none 78 * Check if the expression used a given <em>Layer Type Identifier</em>. 79 * 80 * @param identifier 81 * the Layer Type Identifier to check against 82 * @return <code>true</code> if this identifier was used, <code>false</code> 83 * otherwise 84 */ 85 public boolean hasLayerIdentifier(String identifier) { 86 if (identifier == null) { 87 throw new NullPointerException("identifier == null"); 88 } 89 return this.identifier.equals(identifier); 90 } 91 92 93 /** 94 * Get the Layer Type Identifier qualifier. 95 * 96 * @return the Layer Type Identifier qualifier or <code>null</code> if none 97 * was used in this expression 81 98 */ 82 99 public String getLayerQualifier() { … … 86 103 87 104 /** 105 * Check if the Layer Type Identifier qualifier is empty. 106 * 107 * @return <code>true</code> if no Layer Type Identifier qualifier was set, 108 * <code>false</code> otherwise 109 */ 110 public boolean isLayerQualifierEmpty() { 111 return (qualifier == null); 112 } 113 114 115 /** 116 * Check if the expression used a given qualifier for the Layer Type 117 * Identifier. 118 * 119 * @param qualifier 120 * the qualifier to check against 121 * @return <code>true</code> if this identifier was used, <code>false</code> 122 * otherwise 123 */ 124 public boolean hasLayerQualifier(String qualifier) { 125 if (qualifier == null) { 126 throw new NullPointerException("qualifier == null"); 127 } 128 if (this.qualifier != null) { 129 return this.qualifier.equals(qualifier); 130 } else { 131 return false; 132 } 133 } 134 135 136 /** 88 137 * Get the operator. 89 138 * … … 96 145 97 146 /** 147 * Check if expression used a given operator. 148 * 149 * @param operator 150 * the operator to check 151 * @return <code>true</code> if the given operator was used, 152 * <code>false</code> otherwise 153 */ 154 public boolean hasOperator(Operator operator) { 155 if (operator == null) { 156 throw new NullPointerException("operator == null"); 157 } 158 return this.operator == operator; 159 } 160 161 162 /** 98 163 * Get the regex value. 99 164 * … … 108 173 * Get the regex flags set. 109 174 * 110 * @return the regex flags set or <code>null</code> if none 175 * @return the regex flags set or <code>null</code> if no flags were used 176 * in this expression 111 177 */ 112 178 public Set<RegexFlag> getRegexFlags() { 113 179 return regex_flags; 180 } 181 182 183 /** 184 * Check if a regex flag set is empty. 185 * 186 * @return <code>true</code> if no regex flags where set, <code>false</code> 187 * otherwise 188 */ 189 public boolean isRegexFlagsEmpty() { 190 return (regex_flags == null); 191 } 192 193 194 /** 195 * Check if a regex flag is set. 196 * 197 * @param flag 198 * the flag to be checked 199 * @return <code>true</code> if the flag is set, <code>false</code> 200 * otherwise 201 */ 202 public boolean hasRegexFlag(RegexFlag flag) { 203 if (flag == null) { 204 throw new NullPointerException("flag == null"); 205 } 206 if (regex_flags != null) { 207 return regex_flags.contains(flag); 208 } else { 209 return false; 210 } 114 211 } 115 212 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryNode.java
r7159 r7162 90 90 public QueryNodeType getNodeType() { 91 91 return nodeType; 92 } 93 94 95 /** 96 * Check, if node if of given type. 97 * 98 * @param nodeType 99 * type to check against 100 * @return <code>true</code> if node is of given type, <code>false</code> 101 * otherwise 102 */ 103 public boolean hasNodeType(QueryNodeType nodeType) { 104 if (nodeType == null) { 105 throw new NullPointerException("nodeType == null"); 106 } 107 return this.nodeType == nodeType; 92 108 } 93 109
Note: See TracChangeset
for help on using the changeset viewer.