Definitions.java revision 1071
377N/A * The contents of this file are subject to the terms of the 377N/A * Common Development and Distribution License (the "License"). 377N/A * You may not use this file except in compliance with the License. 377N/A * language governing permissions and limitations under the License. 377N/A * When distributing Covered Code, include this CDDL HEADER in each 377N/A * If applicable, add the following below this CDDL HEADER, with the 377N/A * fields enclosed by brackets "[]" replaced with your own identifying 377N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1372N/A * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 377N/A /** Map from symbol to the line numbers on which the symbol is defined. */ 377N/A /** List of all the tags. */ 1470N/A * Get all symbols used in definitions. 1470N/A * @return a set containing all the symbols 377N/A * Check if there is a tag for a symbol. 377N/A * @param symbol the symbol to check 377N/A * @return {@code true} iff there is a tag for {@code symbol} 1470N/A * Check whether the specified symbol is defined on the given line. 1470N/A * @param symbol the symbol to look for 1470N/A * @param lineNumber the line to check 1470N/A * @return {@code true} iff {@code symbol} is defined on the specified line 377N/A * Return the number of occurrences of definitions with the specified 377N/A * @param symbol the symbol to count the occurrences of 377N/A * @return the number of times the specified symbol is defined 377N/A * Return the number of distinct symbols. 377N/A * @return number of distinct symbols 377N/A * Class that represents a single tag. 377N/A /** Line number of the tag. */ 377N/A /** The symbol used in the definition. */ 377N/A /** The type of the tag. */ 1470N/A /** The full line on which the definition occurs. */ 377N/A // The strings are frequently repeated (a symbol can be used in 377N/A // multiple definitions, multiple definitions can have the same type, 1470N/A // one line can contain multiple definitions). Intern them to minimize 377N/A // the space consumed by them (see bug #809). 496N/A * Create a binary representation of this object. 496N/A * @return a byte array representing this object 496N/A * @throws IOException if an error happens when writing to the array 496N/A * Deserialize a binary representation of a {@code Definitions} object. 496N/A * @param bytes a byte array containing the {@code Definitions} object 496N/A * @return a {@code Definitions} object 496N/A * @throws IOException if an I/O error happens when reading the array 496N/A * @throws ClassNotFoundException if the class definition for an object 496N/A * stored in the byte array cannot be found 496N/A * @throws ClassCastException if the array contains an object of another 377N/A * type than {@code Definitions}