1b5840353SAdam Hornáček /* 2b5840353SAdam Hornáček * CDDL HEADER START 3b5840353SAdam Hornáček * 4b5840353SAdam Hornáček * The contents of this file are subject to the terms of the 5b5840353SAdam Hornáček * Common Development and Distribution License (the "License"). 6b5840353SAdam Hornáček * You may not use this file except in compliance with the License. 7b5840353SAdam Hornáček * 8b5840353SAdam Hornáček * See LICENSE.txt included in this distribution for the specific 9b5840353SAdam Hornáček * language governing permissions and limitations under the License. 10b5840353SAdam Hornáček * 11b5840353SAdam Hornáček * When distributing Covered Code, include this CDDL HEADER in each 12b5840353SAdam Hornáček * file and include the License file at LICENSE.txt. 13b5840353SAdam Hornáček * If applicable, add the following below this CDDL HEADER, with the 14b5840353SAdam Hornáček * fields enclosed by brackets "[]" replaced with your own identifying 15b5840353SAdam Hornáček * information: Portions Copyright [yyyy] [name of copyright owner] 16b5840353SAdam Hornáček * 17b5840353SAdam Hornáček * CDDL HEADER END 18b5840353SAdam Hornáček */ 19b5840353SAdam Hornáček 20b5840353SAdam Hornáček /* 21*d051e170SChris Fraire * Copyright (c) 2017, 2020, Chris Fraire <cfraire@me.com>. 22b5840353SAdam Hornáček */ 239805b761SAdam Hornáček package org.opengrok.indexer.analysis; 24b5840353SAdam Hornáček 25b5840353SAdam Hornáček /** 26b5840353SAdam Hornáček * Represents an event raised when a symbol matcher matches a path-like string 27b5840353SAdam Hornáček * that would not be published as a symbol. 28b5840353SAdam Hornáček */ 29b5840353SAdam Hornáček public class PathlikeMatchedEvent { 30b5840353SAdam Hornáček 31b5840353SAdam Hornáček private final Object source; 32b5840353SAdam Hornáček private final String str; 33b5840353SAdam Hornáček private final char sep; 34b5840353SAdam Hornáček private final boolean canonicalize; 35*d051e170SChris Fraire private final long start; 36*d051e170SChris Fraire private final long end; 37b5840353SAdam Hornáček 38b5840353SAdam Hornáček /** 39b5840353SAdam Hornáček * Initializes an immutable instance of {@link PathlikeMatchedEvent}. 40b5840353SAdam Hornáček * @param source the event source 41b5840353SAdam Hornáček * @param str the path text string 42b5840353SAdam Hornáček * @param sep the path separator 43b5840353SAdam Hornáček * @param canonicalize a value indicating whether the path should be 44b5840353SAdam Hornáček * canonicalized 45b5840353SAdam Hornáček * @param start the text start position 46b5840353SAdam Hornáček * @param end the text end position 47b5840353SAdam Hornáček */ PathlikeMatchedEvent(Object source, String str, char sep, boolean canonicalize, long start, long end)48b5840353SAdam Hornáček public PathlikeMatchedEvent(Object source, String str, char sep, 49*d051e170SChris Fraire boolean canonicalize, long start, long end) { 50b5840353SAdam Hornáček this.source = source; 51b5840353SAdam Hornáček this.str = str; 52b5840353SAdam Hornáček this.sep = sep; 53b5840353SAdam Hornáček this.canonicalize = canonicalize; 54b5840353SAdam Hornáček this.start = start; 55b5840353SAdam Hornáček this.end = end; 56b5840353SAdam Hornáček } 57b5840353SAdam Hornáček 58b5840353SAdam Hornáček /** 59b5840353SAdam Hornáček * Gets the event source. 60b5840353SAdam Hornáček * @return the initial value 61b5840353SAdam Hornáček */ getSource()62b5840353SAdam Hornáček public Object getSource() { 63b5840353SAdam Hornáček return source; 64b5840353SAdam Hornáček } 65b5840353SAdam Hornáček 66b5840353SAdam Hornáček /** 67b5840353SAdam Hornáček * Gets the path text string. 68b5840353SAdam Hornáček * @return the initial value 69b5840353SAdam Hornáček */ getStr()70b5840353SAdam Hornáček public String getStr() { 71b5840353SAdam Hornáček return str; 72b5840353SAdam Hornáček } 73b5840353SAdam Hornáček 74b5840353SAdam Hornáček /** 75b5840353SAdam Hornáček * Gets the text start position. 76b5840353SAdam Hornáček * @return the initial value 77b5840353SAdam Hornáček */ getStart()78*d051e170SChris Fraire public long getStart() { 79b5840353SAdam Hornáček return start; 80b5840353SAdam Hornáček } 81b5840353SAdam Hornáček 82b5840353SAdam Hornáček /** 83b5840353SAdam Hornáček * Gets the text end position. 84b5840353SAdam Hornáček * @return the initial value 85b5840353SAdam Hornáček */ getEnd()86*d051e170SChris Fraire public long getEnd() { 87b5840353SAdam Hornáček return end; 88b5840353SAdam Hornáček } 89b5840353SAdam Hornáček 90b5840353SAdam Hornáček /** 91b5840353SAdam Hornáček * Gets the path separator. 92b5840353SAdam Hornáček * @return the initial value 93b5840353SAdam Hornáček */ getSep()94b5840353SAdam Hornáček public char getSep() { 95b5840353SAdam Hornáček return sep; 96b5840353SAdam Hornáček } 97b5840353SAdam Hornáček 98b5840353SAdam Hornáček /** 99b5840353SAdam Hornáček * Gets a value indicating whether the path should be canonicalized. 100b5840353SAdam Hornáček * @return the initial value 101b5840353SAdam Hornáček */ getCanonicalize()102b5840353SAdam Hornáček public boolean getCanonicalize() { 103b5840353SAdam Hornáček return canonicalize; 104b5840353SAdam Hornáček } 105b5840353SAdam Hornáček } 106