|
| 1 | +/* |
| 2 | + * CDDL HEADER START |
| 3 | + * |
| 4 | + * The contents of this file are subject to the terms of the |
| 5 | + * Common Development and Distribution License (the "License"). |
| 6 | + * You may not use this file except in compliance with the License. |
| 7 | + * |
| 8 | + * See LICENSE.txt included in this distribution for the specific |
| 9 | + * language governing permissions and limitations under the License. |
| 10 | + * |
| 11 | + * When distributing Covered Code, include this CDDL HEADER in each |
| 12 | + * file and include the License file at LICENSE.txt. |
| 13 | + * If applicable, add the following below this CDDL HEADER, with the |
| 14 | + * fields enclosed by brackets "[]" replaced with your own identifying |
| 15 | + * information: Portions Copyright [yyyy] [name of copyright owner] |
| 16 | + * |
| 17 | + * CDDL HEADER END |
| 18 | + */ |
| 19 | + |
| 20 | +/* |
| 21 | + * Copyright (c) 2017, Chris Fraire <cfraire@me.com>. |
| 22 | + */ |
| 23 | + |
| 24 | +package org.opensolaris.opengrok.analysis; |
| 25 | + |
| 26 | +/** |
| 27 | + * Represents an event raised when a language lexer indicates that a disjoint |
| 28 | + * span has changed. |
| 29 | + */ |
| 30 | +public class DisjointSpanChangedEvent { |
| 31 | + |
| 32 | + private final Object source; |
| 33 | + private final String className; |
| 34 | + private final int position; |
| 35 | + |
| 36 | + /** |
| 37 | + * Initializes an immutable instance of {@link DisjointSpanChangedEvent}. |
| 38 | + * @param source the event source |
| 39 | + * @param className the span class name |
| 40 | + * @param position the span position |
| 41 | + */ |
| 42 | + public DisjointSpanChangedEvent(Object source, String className, |
| 43 | + int position) { |
| 44 | + this.source = source; |
| 45 | + this.className = className; |
| 46 | + this.position = position; |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Gets the event source. |
| 51 | + * @return the initial value |
| 52 | + */ |
| 53 | + public Object getSource() { |
| 54 | + return source; |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * Gets the span class name string. |
| 59 | + * @return the initial value |
| 60 | + */ |
| 61 | + public String getDisjointSpanClassName() { |
| 62 | + return className; |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * Gets the span position. |
| 67 | + * @return the initial value |
| 68 | + */ |
| 69 | + public int getPosition() { |
| 70 | + return position; |
| 71 | + } |
| 72 | +} |
0 commit comments