xref: /OpenGrok/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/DisjointSpanChangedEvent.java (revision 5d9f3aa0ca3da3a714233f987fa732f62c0965f6)
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 language lexer indicates that a disjoint
27b5840353SAdam Hornáček  * span has changed.
28b5840353SAdam Hornáček  */
29b5840353SAdam Hornáček public class DisjointSpanChangedEvent {
30b5840353SAdam Hornáček 
31b5840353SAdam Hornáček     private final Object source;
32b5840353SAdam Hornáček     private final String className;
33*d051e170SChris Fraire     private final long position;
34b5840353SAdam Hornáček 
35b5840353SAdam Hornáček     /**
36b5840353SAdam Hornáček      * Initializes an immutable instance of {@link DisjointSpanChangedEvent}.
37b5840353SAdam Hornáček      * @param source the event source
38b5840353SAdam Hornáček      * @param className the span class name
39b5840353SAdam Hornáček      * @param position the span position
40b5840353SAdam Hornáček      */
DisjointSpanChangedEvent(Object source, String className, long position)41*d051e170SChris Fraire     public DisjointSpanChangedEvent(Object source, String className, long position) {
42b5840353SAdam Hornáček         this.source = source;
43b5840353SAdam Hornáček         this.className = className;
44b5840353SAdam Hornáček         this.position = position;
45b5840353SAdam Hornáček     }
46b5840353SAdam Hornáček 
47b5840353SAdam Hornáček     /**
48b5840353SAdam Hornáček      * Gets the event source.
49b5840353SAdam Hornáček      * @return the initial value
50b5840353SAdam Hornáček      */
getSource()51b5840353SAdam Hornáček     public Object getSource() {
52b5840353SAdam Hornáček         return source;
53b5840353SAdam Hornáček     }
54b5840353SAdam Hornáček 
55b5840353SAdam Hornáček     /**
56b5840353SAdam Hornáček      * Gets the span class name string.
57b5840353SAdam Hornáček      * @return the initial value
58b5840353SAdam Hornáček      */
getDisjointSpanClassName()59b5840353SAdam Hornáček     public String getDisjointSpanClassName() {
60b5840353SAdam Hornáček         return className;
61b5840353SAdam Hornáček     }
62b5840353SAdam Hornáček 
63b5840353SAdam Hornáček     /**
64b5840353SAdam Hornáček      * Gets the span position.
65b5840353SAdam Hornáček      * @return the initial value
66b5840353SAdam Hornáček      */
getPosition()67*d051e170SChris Fraire     public long getPosition() {
68b5840353SAdam Hornáček         return position;
69b5840353SAdam Hornáček     }
70b5840353SAdam Hornáček }
71