Added some missing @param and @throws Javadoc comments.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
831c297ece
commit
6506967c12
|
@ -269,6 +269,7 @@ public class GameData {
|
||||||
* @param x the center x coordinate
|
* @param x the center x coordinate
|
||||||
* @param y the center y coordinate
|
* @param y the center y coordinate
|
||||||
* @param color the color of the hit object
|
* @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 curve the slider curve (or null if not applicable)
|
||||||
* @param expand whether or not the hit result animation should expand (if 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)
|
* @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.
|
* 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; }
|
public void setHitResultOffset(int[] hitResultOffset) { this.hitResultOffset = hitResultOffset; }
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class NativeLoader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unpacks natives for the current operating system to the natives directory.
|
* 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 {
|
public void loadNatives() throws IOException {
|
||||||
if (!nativeDir.exists())
|
if (!nativeDir.exists())
|
||||||
|
|
|
@ -137,14 +137,14 @@ public class ScoreData implements Comparable<ScoreData> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Empty constructor.
|
* Creates an empty score data object.
|
||||||
*/
|
*/
|
||||||
public ScoreData() {}
|
public ScoreData() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Builds a score data object from a database result set.
|
||||||
* @param rs the ResultSet to read from (at the current cursor position)
|
* @param rs the {@link ResultSet} to read from (at the current cursor position)
|
||||||
* @throws SQLException
|
* @throws SQLException if a database access error occurs or the result set is closed
|
||||||
*/
|
*/
|
||||||
public ScoreData(ResultSet rs) throws SQLException {
|
public ScoreData(ResultSet rs) throws SQLException {
|
||||||
this.timestamp = rs.getLong(1);
|
this.timestamp = rs.getLong(1);
|
||||||
|
|
|
@ -60,7 +60,6 @@ import org.lwjgl.opengl.GL11;
|
||||||
import org.newdawn.slick.Animation;
|
import org.newdawn.slick.Animation;
|
||||||
import org.newdawn.slick.GameContainer;
|
import org.newdawn.slick.GameContainer;
|
||||||
import org.newdawn.slick.Input;
|
import org.newdawn.slick.Input;
|
||||||
import org.newdawn.slick.SlickException;
|
|
||||||
import org.newdawn.slick.state.StateBasedGame;
|
import org.newdawn.slick.state.StateBasedGame;
|
||||||
import org.newdawn.slick.util.Log;
|
import org.newdawn.slick.util.Log;
|
||||||
|
|
||||||
|
@ -93,10 +92,8 @@ public class Utils {
|
||||||
* Initializes game settings and class data.
|
* Initializes game settings and class data.
|
||||||
* @param container the game container
|
* @param container the game container
|
||||||
* @param game the game object
|
* @param game the game object
|
||||||
* @throws SlickException
|
|
||||||
*/
|
*/
|
||||||
public static void init(GameContainer container, StateBasedGame game)
|
public static void init(GameContainer container, StateBasedGame game) {
|
||||||
throws SlickException {
|
|
||||||
input = container.getInput();
|
input = container.getInput();
|
||||||
int width = container.getWidth();
|
int width = container.getWidth();
|
||||||
int height = container.getHeight();
|
int height = container.getHeight();
|
||||||
|
@ -368,6 +365,7 @@ public class Utils {
|
||||||
* @param url the remote URL
|
* @param url the remote URL
|
||||||
* @return the contents as a string, or null if any error occurred
|
* @return the contents as a string, or null if any error occurred
|
||||||
* @author Roland Illig (http://stackoverflow.com/a/4308662)
|
* @author Roland Illig (http://stackoverflow.com/a/4308662)
|
||||||
|
* @throws IOException if an I/O exception occurs
|
||||||
*/
|
*/
|
||||||
public static String readDataFromUrl(URL url) throws IOException {
|
public static String readDataFromUrl(URL url) throws IOException {
|
||||||
// open connection
|
// open connection
|
||||||
|
@ -403,6 +401,7 @@ public class Utils {
|
||||||
* Returns a JSON object from a URL.
|
* Returns a JSON object from a URL.
|
||||||
* @param url the remote URL
|
* @param url the remote URL
|
||||||
* @return the JSON object, or null if an error occurred
|
* @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 {
|
public static JSONObject readJsonObjectFromUrl(URL url) throws IOException {
|
||||||
String s = Utils.readDataFromUrl(url);
|
String s = Utils.readDataFromUrl(url);
|
||||||
|
@ -421,6 +420,7 @@ public class Utils {
|
||||||
* Returns a JSON array from a URL.
|
* Returns a JSON array from a URL.
|
||||||
* @param url the remote URL
|
* @param url the remote URL
|
||||||
* @return the JSON array, or null if an error occurred
|
* @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 {
|
public static JSONArray readJsonArrayFromUrl(URL url) throws IOException {
|
||||||
String s = Utils.readDataFromUrl(url);
|
String s = Utils.readDataFromUrl(url);
|
||||||
|
|
|
@ -55,6 +55,9 @@ public class MultiClip {
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* @param name the clip name
|
* @param name the clip name
|
||||||
* @param audioIn the associated AudioInputStream
|
* @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 {
|
public MultiClip(String name, AudioInputStream audioIn) throws IOException, LineUnavailableException {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -105,6 +108,8 @@ public class MultiClip {
|
||||||
* Plays the clip with the specified volume.
|
* Plays the clip with the specified volume.
|
||||||
* @param volume the volume the play at
|
* @param volume the volume the play at
|
||||||
* @param listener the line listener
|
* @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 {
|
public void start(float volume, LineListener listener) throws LineUnavailableException {
|
||||||
Clip clip = getClip();
|
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.
|
* If no clip is available, then a new one is created if under MAX_CLIPS.
|
||||||
* Otherwise, an existing clip will be returned.
|
* Otherwise, an existing clip will be returned.
|
||||||
* @return the Clip to play
|
* @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 {
|
private Clip getClip() throws LineUnavailableException {
|
||||||
// TODO:
|
// TODO:
|
||||||
|
|
|
@ -230,6 +230,7 @@ public class MusicController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fades out the track.
|
* Fades out the track.
|
||||||
|
* @param duration the fade time (in ms)
|
||||||
*/
|
*/
|
||||||
public static void fadeOut(int duration) {
|
public static void fadeOut(int duration) {
|
||||||
if (isPlaying())
|
if (isPlaying())
|
||||||
|
|
|
@ -728,6 +728,7 @@ public class BeatmapParser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the file extension of a file.
|
* Returns the file extension of a file.
|
||||||
|
* @param file the file name
|
||||||
*/
|
*/
|
||||||
public static String getExtension(String file) {
|
public static String getExtension(String file) {
|
||||||
int i = file.lastIndexOf('.');
|
int i = file.lastIndexOf('.');
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class BeatmapSet implements Iterable<Beatmap> {
|
||||||
/**
|
/**
|
||||||
* Returns the beatmap at the given index.
|
* Returns the beatmap at the given index.
|
||||||
* @param index the beatmap 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); }
|
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.
|
* Removes the beatmap at the given index.
|
||||||
* @param index the beatmap index
|
* @param index the beatmap index
|
||||||
* @return the removed beatmap
|
* @return the removed beatmap
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException if the index is out of range
|
||||||
*/
|
*/
|
||||||
public Beatmap remove(int index) { return beatmaps.remove(index); }
|
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:{}
|
* <li>4: CS:{} HP:{} AR:{} OD:{} Stars:{}
|
||||||
* </ul>
|
* </ul>
|
||||||
* @param index the beatmap index
|
* @param index the beatmap index
|
||||||
* @throws IndexOutOfBoundsException
|
* @throws IndexOutOfBoundsException if the index is out of range
|
||||||
*/
|
*/
|
||||||
public String[] getInfo(int index) {
|
public String[] getInfo(int index) {
|
||||||
Beatmap beatmap = beatmaps.get(index);
|
Beatmap beatmap = beatmaps.get(index);
|
||||||
|
|
|
@ -330,6 +330,7 @@ public class BeatmapSetList {
|
||||||
/**
|
/**
|
||||||
* Expands the node at an index by inserting a new node for each Beatmap
|
* Expands the node at an index by inserting a new node for each Beatmap
|
||||||
* in that node and hiding the group node.
|
* in that node and hiding the group node.
|
||||||
|
* @param index the node index
|
||||||
* @return the first of the newly-inserted nodes
|
* @return the first of the newly-inserted nodes
|
||||||
*/
|
*/
|
||||||
public BeatmapSetNode expand(int index) {
|
public BeatmapSetNode expand(int index) {
|
||||||
|
|
|
@ -129,7 +129,11 @@ public class BeatmapWatchService {
|
||||||
|
|
||||||
/** Watch service listener interface. */
|
/** Watch service listener interface. */
|
||||||
public interface BeatmapWatchServiceListener {
|
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);
|
public void eventReceived(WatchEvent.Kind<?> kind, Path child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(); }
|
public int size() { return nodes.size(); }
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,13 @@ public class DownloadNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* 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,
|
public DownloadNode(int beatmapSetID, String date, String title,
|
||||||
String titleUnicode, String artist, String artistUnicode, String creator) {
|
String titleUnicode, String artist, String artistUnicode, String creator) {
|
||||||
|
|
|
@ -194,6 +194,7 @@ public class Updater {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks the program version against the version file on the update server.
|
* 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 {
|
public void checkForUpdates() throws IOException {
|
||||||
if (status != Status.INITIAL || Options.USE_XDG)
|
if (status != Status.INITIAL || Options.USE_XDG)
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class OsuReader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the input stream.
|
* Closes the input stream.
|
||||||
|
* @throws IOException if an I/O error occurs
|
||||||
*/
|
*/
|
||||||
public void close() throws IOException { reader.close(); }
|
public void close() throws IOException { reader.close(); }
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class OsuWriter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the output stream.
|
* Closes the output stream.
|
||||||
* @throws IOException
|
* @throws IOException if an I/O error occurs
|
||||||
*/
|
*/
|
||||||
public void close() throws IOException { writer.close(); }
|
public void close() throws IOException { writer.close(); }
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,8 @@ public class ReplayFrame {
|
||||||
public int getTimeDiff() { return timeDiff; }
|
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; }
|
public void setTimeDiff(int diff) { this.timeDiff = diff; }
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,8 @@ import org.newdawn.slick.gui.GUIContext;
|
||||||
* <li>Call {@link #activate()}/{@link #deactivate()} whenever the component is needed
|
* <li>Call {@link #activate()}/{@link #deactivate()} whenever the component is needed
|
||||||
* (e.g. in a state's {@code enter} and {@code leave} events.
|
* (e.g. in a state's {@code enter} and {@code leave} events.
|
||||||
* </ul>
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param <E> the type of the elements in the menu
|
||||||
*/
|
*/
|
||||||
public class DropdownMenu<E> extends AbstractComponent {
|
public class DropdownMenu<E> extends AbstractComponent {
|
||||||
/** Padding ratios for drawing. */
|
/** Padding ratios for drawing. */
|
||||||
|
|
|
@ -146,11 +146,13 @@ public class MenuButton {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a new center x coordinate.
|
* Sets a new center x coordinate.
|
||||||
|
* @param x the x coordinate
|
||||||
*/
|
*/
|
||||||
public void setX(float x) { this.x = x; }
|
public void setX(float x) { this.x = x; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a new center y coordinate.
|
* Sets a new center y coordinate.
|
||||||
|
* @param y the y coordinate
|
||||||
*/
|
*/
|
||||||
public void setY(float y) { this.y = y; }
|
public void setY(float y) { this.y = y; }
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ import org.newdawn.slick.GameContainer;
|
||||||
import org.newdawn.slick.Graphics;
|
import org.newdawn.slick.Graphics;
|
||||||
import org.newdawn.slick.Image;
|
import org.newdawn.slick.Image;
|
||||||
import org.newdawn.slick.Input;
|
import org.newdawn.slick.Input;
|
||||||
import org.newdawn.slick.SlickException;
|
|
||||||
import org.newdawn.slick.state.StateBasedGame;
|
import org.newdawn.slick.state.StateBasedGame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,10 +85,8 @@ public class UI {
|
||||||
* Initializes UI data.
|
* Initializes UI data.
|
||||||
* @param container the game container
|
* @param container the game container
|
||||||
* @param game the game object
|
* @param game the game object
|
||||||
* @throws SlickException
|
|
||||||
*/
|
*/
|
||||||
public static void init(GameContainer container, StateBasedGame game)
|
public static void init(GameContainer container, StateBasedGame game) {
|
||||||
throws SlickException {
|
|
||||||
UI.container = container;
|
UI.container = container;
|
||||||
UI.input = container.getInput();
|
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.
|
* at the bottom of the screen.
|
||||||
|
* @param g the graphics context
|
||||||
*/
|
*/
|
||||||
public static void drawLoadingProgress(Graphics g) {
|
public static void drawLoadingProgress(Graphics g) {
|
||||||
String text, file;
|
String text, file;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user