Changeset 10299 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-05-29T16:33:08+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r10208 r10299 319 319 defaultExtension, 320 320 description + (!extensionsForDescription.isEmpty() 321 ? (" (" + Utils.join(", ", extensionsForDescription) + ")")321 ? (" (" + Utils.join(", ", extensionsForDescription) + ')') 322 322 : "") 323 323 ); -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r10220 r10299 244 244 245 245 public interface BinaryMatchFactory extends MatchFactory { 246 BinaryMatch get(String keyword, Match lhs, Match rhs, PushbackTokenizer tokenizer) throws ParseError;246 AbstractBinaryMatch get(String keyword, Match lhs, Match rhs, PushbackTokenizer tokenizer) throws ParseError; 247 247 } 248 248 … … 337 337 * A binary search operator which may take data parameters. 338 338 */ 339 public abstract static class BinaryMatch extends Match {339 public abstract static class AbstractBinaryMatch extends Match { 340 340 341 341 protected final Match lhs; 342 342 protected final Match rhs; 343 343 344 public BinaryMatch(Match lhs, Match rhs) { 344 /** 345 * Constructs a new {@code BinaryMatch}. 346 * @param lhs Left hand side 347 * @param rhs Right hand side 348 */ 349 public AbstractBinaryMatch(Match lhs, Match rhs) { 345 350 this.lhs = lhs; 346 351 this.rhs = rhs; 347 352 } 348 353 349 public Match getLhs() { 354 /** 355 * Returns left hand side. 356 * @return left hand side 357 */ 358 public final Match getLhs() { 350 359 return lhs; 351 360 } 352 361 353 public Match getRhs() { 362 /** 363 * Returns right hand side. 364 * @return right hand side 365 */ 366 public final Match getRhs() { 354 367 return rhs; 355 368 } … … 438 451 * Matches if both left and right expressions match. 439 452 */ 440 public static class And extends BinaryMatch { 453 public static class And extends AbstractBinaryMatch { 454 /** 455 * Constructs a new {@code And} match. 456 * @param lhs left hand side 457 * @param rhs right hand side 458 */ 441 459 public And(Match lhs, Match rhs) { 442 460 super(lhs, rhs); … … 455 473 @Override 456 474 public String toString() { 457 return (lhs instanceof BinaryMatch && !(lhs instanceof And) ? "(" + lhs + ")": lhs) + " && "458 + (rhs instanceof BinaryMatch && !(rhs instanceof And) ? "(" + rhs + ")": rhs);475 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof And) ? ("(" + lhs + ')') : lhs) + " && " 476 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof And) ? ("(" + rhs + ')') : rhs); 459 477 } 460 478 } … … 463 481 * Matches if the left OR the right expression match. 464 482 */ 465 public static class Or extends BinaryMatch { 483 public static class Or extends AbstractBinaryMatch { 484 /** 485 * Constructs a new {@code Or} match. 486 * @param lhs left hand side 487 * @param rhs right hand side 488 */ 466 489 public Or(Match lhs, Match rhs) { 467 490 super(lhs, rhs); … … 480 503 @Override 481 504 public String toString() { 482 return (lhs instanceof BinaryMatch && !(lhs instanceof Or) ? "(" + lhs + ")": lhs) + " || "483 + (rhs instanceof BinaryMatch && !(rhs instanceof Or) ? "(" + rhs + ")": rhs);505 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof Or) ? ("(" + lhs + ')') : lhs) + " || " 506 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof Or) ? ("(" + rhs + ')') : rhs); 484 507 } 485 508 } … … 488 511 * Matches if the left OR the right expression match, but not both. 489 512 */ 490 public static class Xor extends BinaryMatch { 513 public static class Xor extends AbstractBinaryMatch { 514 /** 515 * Constructs a new {@code Xor} match. 516 * @param lhs left hand side 517 * @param rhs right hand side 518 */ 491 519 public Xor(Match lhs, Match rhs) { 492 520 super(lhs, rhs); … … 505 533 @Override 506 534 public String toString() { 507 return (lhs instanceof BinaryMatch && !(lhs instanceof Xor) ? "(" + lhs + ")": lhs) + " ^ "508 + (rhs instanceof BinaryMatch && !(rhs instanceof Xor) ? "(" + rhs + ")": rhs);535 return (lhs instanceof AbstractBinaryMatch && !(lhs instanceof Xor) ? ("(" + lhs + ')') : lhs) + " ^ " 536 + (rhs instanceof AbstractBinaryMatch && !(rhs instanceof Xor) ? ("(" + rhs + ')') : rhs); 509 537 } 510 538 } … … 1755 1783 final String forKey = '"' + escapeStringForSearch(key) + '"' + '='; 1756 1784 if (value == null || value.isEmpty()) { 1757 return forKey + "*";1785 return forKey + '*'; 1758 1786 } else { 1759 1787 return forKey + '"' + escapeStringForSearch(value) + '"';
Note:
See TracChangeset
for help on using the changeset viewer.