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