X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fhighlevel%2FRequest.java;h=565c8d7b671f3591e5c47efd6abe660e3fdef9aa;hb=a30d521e1add957b2ddfee455bc6e061efbf44b7;hp=0b0f46e704a300c22f116db3a8bb909709eabba1;hpb=508624458578f01a393f8b44f32b98b40054fdc8;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/Request.java b/src/main/java/net/pterodactylus/fcp/highlevel/Request.java index 0b0f46e..565c8d7 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/Request.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/Request.java @@ -1,9 +1,9 @@ /* - * jFCPlib - Request.java - Copyright © 2009 David Roden + * jFCPlib - Request.java - Copyright © 2009–2016 David Roden * - * This program is free software; you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -12,8 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ package net.pterodactylus.fcp.highlevel; @@ -132,7 +131,8 @@ public abstract class Request { * Sets whether this request is complete. * * @param complete - * true if this request is complete, false otherwise + * true if this request is complete, false + * otherwise */ void setComplete(boolean complete) { this.complete = complete; @@ -219,8 +219,8 @@ public abstract class Request { } /** - * Returns whether this request has fatally failed, i.e. repitition will not - * cause the request to succeed. + * Returns whether this request has fatally failed, i.e. repitition will + * not cause the request to succeed. * * @return true if this request can not be made succeed by * repeating, false otherwise @@ -255,90 +255,107 @@ public abstract class Request { * @param totalBlocks * This request’s total number of blocks */ - public void setTotalBlocks(int totalBlocks) { + void setTotalBlocks(int totalBlocks) { this.totalBlocks = totalBlocks; } /** - * TODO + * Returns the number of required blocks. Any progress percentages should + * be calculated against this value as 100%. Also, as long as + * {@link #isFinalizedTotal()} returns {@code false} this value might + * change. * - * @return the requiredBlocks + * @return The number of required blocks */ public int getRequiredBlocks() { return requiredBlocks; } /** - * TODO + * Sets the number of required blocks. * * @param requiredBlocks - * the requiredBlocks to set + * The number of required blocks */ - public void setRequiredBlocks(int requiredBlocks) { + void setRequiredBlocks(int requiredBlocks) { this.requiredBlocks = requiredBlocks; } /** - * TODO + * Returns the number of succeeded blocks. * - * @return the succeededBlocks + * @return The number of succeeded blocks */ public int getSucceededBlocks() { return succeededBlocks; } /** - * TODO + * Sets the number of succeeded blocks. * * @param succeededBlocks - * the succeededBlocks to set + * The number of succeeded blocks */ - public void setSucceededBlocks(int succeededBlocks) { + void setSucceededBlocks(int succeededBlocks) { this.succeededBlocks = succeededBlocks; } /** - * TODO + * Returns the number of failed blocks. These blocks may be retried untill + * the maximum number of retries has been reached. * - * @return the failedBlocks + * @return The number of failed blocks */ public int getFailedBlocks() { return failedBlocks; } /** - * TODO + * Sets the number of failed blocks. * * @param failedBlocks - * the failedBlocks to set + * The number of failed blocks */ - public void setFailedBlocks(int failedBlocks) { + void setFailedBlocks(int failedBlocks) { this.failedBlocks = failedBlocks; } /** - * TODO + * Returns the number of fatally failed blocks. * - * @return the fatallyFailedBlocks + * @return The number of fatally failed blocks */ public int getFatallyFailedBlocks() { return fatallyFailedBlocks; } /** - * TODO + * Sets the number of fatally failed blocks. * * @param fatallyFailedBlocks - * the fatallyFailedBlocks to set + * The number of fatally failed blocks */ - public void setFatallyFailedBlocks(int fatallyFailedBlocks) { + void setFatallyFailedBlocks(int fatallyFailedBlocks) { this.fatallyFailedBlocks = fatallyFailedBlocks; } + /** + * Returns whether the number of blocks has been finalized. + * + * @return {@code true} if the number of blocks is finalized, {@code false} + * otherwise + */ public boolean isFinalizedTotal() { return finalizedTotal; } + /** + * Sets whether the number of blocks has been finalized. + * + * @param finalizedTotal + * {@code true} if the number of blocks has been finalized, + * {@code false} otherwise + */ void setFinalizedTotal(boolean finalizedTotal) { this.finalizedTotal = finalizedTotal; }