Added some missing @param and @throws Javadoc comments.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-09-09 23:51:16 -04:00
parent 831c297ece
commit 6506967c12
19 changed files with 49 additions and 21 deletions

View File

@ -269,6 +269,7 @@ public class GameData {
* @param x the center x coordinate
* @param y the center y coordinate
* @param color the color of the hit object
* @param hitResultType the hit object type
* @param curve the slider curve (or null if not applicable)
* @param expand whether or not the hit result animation should expand (if applicable)
* @param hideResult whether or not to hide the hit result (but still show the other animations)
@ -483,6 +484,7 @@ public class GameData {
/**
* Sets the array of hit result offsets.
* @param hitResultOffset the time offset array (of size {@link #HIT_MAX})
*/
public void setHitResultOffset(int[] hitResultOffset) { this.hitResultOffset = hitResultOffset; }

View File

@ -46,7 +46,7 @@ public class NativeLoader {
/**
* Unpacks natives for the current operating system to the natives directory.
* @throws IOException
* @throws IOException if an I/O exception occurs
*/
public void loadNatives() throws IOException {
if (!nativeDir.exists())

View File

@ -137,14 +137,14 @@ public class ScoreData implements Comparable<ScoreData> {
}
/**
* Empty constructor.
* Creates an empty score data object.
*/
public ScoreData() {}
/**
* Constructor.
* @param rs the ResultSet to read from (at the current cursor position)
* @throws SQLException
* Builds a score data object from a database result set.
* @param rs the {@link ResultSet} to read from (at the current cursor position)
* @throws SQLException if a database access error occurs or the result set is closed
*/
public ScoreData(ResultSet rs) throws SQLException {
this.timestamp = rs.getLong(1);

View File

@ -60,7 +60,6 @@ import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Animation;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;
import org.newdawn.slick.util.Log;
@ -93,10 +92,8 @@ public class Utils {
* Initializes game settings and class data.
* @param container the game container
* @param game the game object
* @throws SlickException
*/
public static void init(GameContainer container, StateBasedGame game)
throws SlickException {
public static void init(GameContainer container, StateBasedGame game) {
input = container.getInput();
int width = container.getWidth();
int height = container.getHeight();
@ -368,6 +365,7 @@ public class Utils {
* @param url the remote URL
* @return the contents as a string, or null if any error occurred
* @author Roland Illig (http://stackoverflow.com/a/4308662)
* @throws IOException if an I/O exception occurs
*/
public static String readDataFromUrl(URL url) throws IOException {
// open connection
@ -403,6 +401,7 @@ public class Utils {
* Returns a JSON object from a URL.
* @param url the remote URL
* @return the JSON object, or null if an error occurred
* @throws IOException if an I/O exception occurs
*/
public static JSONObject readJsonObjectFromUrl(URL url) throws IOException {
String s = Utils.readDataFromUrl(url);
@ -421,6 +420,7 @@ public class Utils {
* Returns a JSON array from a URL.
* @param url the remote URL
* @return the JSON array, or null if an error occurred
* @throws IOException if an I/O exception occurs
*/
public static JSONArray readJsonArrayFromUrl(URL url) throws IOException {
String s = Utils.readDataFromUrl(url);

View File

@ -55,6 +55,9 @@ public class MultiClip {
* Constructor.
* @param name the clip name
* @param audioIn the associated AudioInputStream
* @throws IOException if an input or output error occurs
* @throws LineUnavailableException if a clip object is not available or
* if the line cannot be opened due to resource restrictions
*/
public MultiClip(String name, AudioInputStream audioIn) throws IOException, LineUnavailableException {
this.name = name;
@ -105,6 +108,8 @@ public class MultiClip {
* Plays the clip with the specified volume.
* @param volume the volume the play at
* @param listener the line listener
* @throws LineUnavailableException if a clip object is not available or
* if the line cannot be opened due to resource restrictions
*/
public void start(float volume, LineListener listener) throws LineUnavailableException {
Clip clip = getClip();
@ -130,6 +135,8 @@ public class MultiClip {
* If no clip is available, then a new one is created if under MAX_CLIPS.
* Otherwise, an existing clip will be returned.
* @return the Clip to play
* @throws LineUnavailableException if a clip object is not available or
* if the line cannot be opened due to resource restrictions
*/
private Clip getClip() throws LineUnavailableException {
// TODO:

View File

@ -230,6 +230,7 @@ public class MusicController {
/**
* Fades out the track.
* @param duration the fade time (in ms)
*/
public static void fadeOut(int duration) {
if (isPlaying())

View File

@ -728,6 +728,7 @@ public class BeatmapParser {
/**
* Returns the file extension of a file.
* @param file the file name
*/
public static String getExtension(String file) {
int i = file.lastIndexOf('.');

View File

@ -47,7 +47,7 @@ public class BeatmapSet implements Iterable<Beatmap> {
/**
* Returns the beatmap at the given index.
* @param index the beatmap index
* @throws IndexOutOfBoundsException
* @throws IndexOutOfBoundsException if the index is out of range
*/
public Beatmap get(int index) { return beatmaps.get(index); }
@ -55,7 +55,7 @@ public class BeatmapSet implements Iterable<Beatmap> {
* Removes the beatmap at the given index.
* @param index the beatmap index
* @return the removed beatmap
* @throws IndexOutOfBoundsException
* @throws IndexOutOfBoundsException if the index is out of range
*/
public Beatmap remove(int index) { return beatmaps.remove(index); }
@ -72,7 +72,7 @@ public class BeatmapSet implements Iterable<Beatmap> {
* <li>4: CS:{} HP:{} AR:{} OD:{} Stars:{}
* </ul>
* @param index the beatmap index
* @throws IndexOutOfBoundsException
* @throws IndexOutOfBoundsException if the index is out of range
*/
public String[] getInfo(int index) {
Beatmap beatmap = beatmaps.get(index);

View File

@ -330,6 +330,7 @@ public class BeatmapSetList {
/**
* Expands the node at an index by inserting a new node for each Beatmap
* in that node and hiding the group node.
* @param index the node index
* @return the first of the newly-inserted nodes
*/
public BeatmapSetNode expand(int index) {

View File

@ -129,7 +129,11 @@ public class BeatmapWatchService {
/** Watch service listener interface. */
public interface BeatmapWatchServiceListener {
/** Indication that an event was received. */
/**
* Indication that an event was received.
* @param kind the event kind
* @param child the child directory
*/
public void eventReceived(WatchEvent.Kind<?> kind, Path child);
}

View File

@ -75,7 +75,7 @@ public class DownloadList {
}
/**
* Returns the size of the doownloads list.
* Returns the size of the downloads list.
*/
public int size() { return nodes.size(); }

View File

@ -218,6 +218,13 @@ public class DownloadNode {
/**
* Constructor.
* @param beatmapSetID the beatmap set ID
* @param date the last modified date string
* @param title the song title
* @param titleUnicode the Unicode song title (or {@code null} if none)
* @param artist the song artist
* @param artistUnicode the Unicode song artist (or {@code null} if none)
* @param creator the beatmap creator
*/
public DownloadNode(int beatmapSetID, String date, String title,
String titleUnicode, String artist, String artistUnicode, String creator) {

View File

@ -194,6 +194,7 @@ public class Updater {
/**
* Checks the program version against the version file on the update server.
* @throws IOException if an I/O exception occurs
*/
public void checkForUpdates() throws IOException {
if (status != Status.INITIAL || Options.USE_XDG)

View File

@ -61,6 +61,7 @@ public class OsuReader {
/**
* Closes the input stream.
* @throws IOException if an I/O error occurs
*/
public void close() throws IOException { reader.close(); }

View File

@ -62,7 +62,7 @@ public class OsuWriter {
/**
* Closes the output stream.
* @throws IOException
* @throws IOException if an I/O error occurs
*/
public void close() throws IOException { writer.close(); }

View File

@ -81,7 +81,8 @@ public class ReplayFrame {
public int getTimeDiff() { return timeDiff; }
/**
* Sets the time since the previous action, in milliseconds.
* Sets the time since the previous action.
* @param diff the time difference, in milliseconds
*/
public void setTimeDiff(int diff) { this.timeDiff = diff; }

View File

@ -43,6 +43,8 @@ import org.newdawn.slick.gui.GUIContext;
* <li>Call {@link #activate()}/{@link #deactivate()} whenever the component is needed
* (e.g. in a state's {@code enter} and {@code leave} events.
* </ul>
*
* @param <E> the type of the elements in the menu
*/
public class DropdownMenu<E> extends AbstractComponent {
/** Padding ratios for drawing. */

View File

@ -146,11 +146,13 @@ public class MenuButton {
/**
* Sets a new center x coordinate.
* @param x the x coordinate
*/
public void setX(float x) { this.x = x; }
/**
* Sets a new center y coordinate.
* @param y the y coordinate
*/
public void setY(float y) { this.y = y; }

View File

@ -38,7 +38,6 @@ import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;
/**
@ -86,10 +85,8 @@ public class UI {
* Initializes UI data.
* @param container the game container
* @param game the game object
* @throws SlickException
*/
public static void init(GameContainer container, StateBasedGame game)
throws SlickException {
public static void init(GameContainer container, StateBasedGame game) {
UI.container = container;
UI.input = container.getInput();
@ -271,8 +268,9 @@ public class UI {
}
/**
* Draws loading progress (OSZ unpacking, beatmap parsing, sound loading)
* Draws loading progress (OSZ unpacking, beatmap parsing, replay importing, sound loading)
* at the bottom of the screen.
* @param g the graphics context
*/
public static void drawLoadingProgress(Graphics g) {
String text, file;