From fe32127ea8bceefd82b450730b5f94e009a33188 Mon Sep 17 00:00:00 2001 From: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com> Date: Thu, 22 Jun 2023 19:43:51 -0700 Subject: [PATCH] [command] Clean up Command doc comments (NFC) (#5321) --- .../wpi/first/wpilibj2/command/Command.java | 11 +++----- .../native/include/frc2/command/Command.h | 26 ++++++++---------- .../native/include/frc2/command/CommandPtr.h | 27 +++++++++---------- 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java index 702bf4054f..5bd24e16dd 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java @@ -64,8 +64,7 @@ public interface Command { /** * Decorates this command with a timeout. If the specified timeout is exceeded before the command - * finishes normally, the command will be interrupted and un-scheduled. Note that the timeout only - * applies to the command returned by this method; the calling command is not itself changed. + * finishes normally, the command will be interrupted and un-scheduled. * *

Note: This decorator works by adding this command to a composition. The command the * decorator was called on cannot be scheduled independently or be added to a different @@ -108,8 +107,8 @@ public interface Command { * commands with {@link CommandScheduler#removeComposedCommand(Command)}. The command composition * returned from this method can be further decorated without issue. * - * @param condition the interrupt condition - * @return the command with the interrupt condition added + * @param condition the run condition + * @return the command with the run condition added * @see #until(BooleanSupplier) */ default ParallelRaceGroup onlyWhile(BooleanSupplier condition) { @@ -118,9 +117,7 @@ public interface Command { /** * Decorates this command with an interrupt condition. If the specified condition becomes true - * before the command finishes normally, the command will be interrupted and un-scheduled. Note - * that this only applies to the command returned by this method; the calling command is not - * itself changed. + * before the command finishes normally, the command will be interrupted and un-scheduled. * *

Note: This decorator works by adding this command to a composition. The command the * decorator was called on cannot be scheduled independently or be added to a different diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h index 3cf0e5a28b..9d33028816 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h @@ -115,10 +115,9 @@ class Command { friend class CommandPtr; /** - * Decorates this command with a timeout. If the specified timeout is + * Decorates this command with a timeout. If the specified timeout is * exceeded before the command finishes normally, the command will be - * interrupted and un-scheduled. Note that the timeout only applies to the - * command returned by this method; the calling command is not itself changed. + * interrupted and un-scheduled. * * @param duration the timeout duration * @return the command with the timeout added @@ -127,10 +126,9 @@ class Command { CommandPtr WithTimeout(units::second_t duration) &&; /** - * Decorates this command with an interrupt condition. If the specified + * Decorates this command with an interrupt condition. If the specified * condition becomes true before the command finishes normally, the command - * will be interrupted and un-scheduled. Note that this only applies to the - * command returned by this method; the calling command is not itself changed. + * will be interrupted and un-scheduled. * * @param condition the interrupt condition * @return the command with the interrupt condition added @@ -139,13 +137,12 @@ class Command { CommandPtr Until(std::function condition) &&; /** - * Decorates this command with a run condition. If the specified condition + * Decorates this command with a run condition. If the specified condition * becomes false before the command finishes normally, the command will be - * interrupted and un-scheduled. Note that this only applies to the command - * returned by this method; the calling command is not itself changed. + * interrupted and un-scheduled. * - * @param condition the interrupt condition - * @return the command with the interrupt condition added + * @param condition the run condition + * @return the command with the run condition added */ [[nodiscard]] CommandPtr OnlyWhile(std::function condition) &&; @@ -153,8 +150,7 @@ class Command { /** * Decorates this command with an interrupt condition. If the specified * condition becomes true before the command finishes normally, the command - * will be interrupted and un-scheduled. Note that this only applies to the - * command returned by this method; the calling command is not itself changed. + * will be interrupted and un-scheduled. * * @param condition the interrupt condition * @return the command with the interrupt condition added @@ -283,9 +279,9 @@ safe) semantics. CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&; /** - * Decorates this command to run or stop when disabled. + * Decorates this command to have a different interrupt behavior. * - * @param interruptBehavior true to run when disabled. + * @param interruptBehavior the desired interrupt behavior * @return the decorated command */ [[nodiscard]] diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h b/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h index 53621ac6d4..878d63b3ff 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h @@ -63,16 +63,16 @@ class CommandPtr final { /** * Decorates this command to run or stop when disabled. * - * @param doesRunWhenDisabled true to run when disabled. + * @param doesRunWhenDisabled true to run when disabled * @return the decorated command */ [[nodiscard]] CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&; /** - * Decorates this command to run or stop when disabled. + * Decorates this command to have a different interrupt behavior. * - * @param interruptBehavior true to run when disabled. + * @param interruptBehavior the desired interrupt behavior * @return the decorated command */ [[nodiscard]] @@ -145,10 +145,9 @@ class CommandPtr final { CommandPtr BeforeStarting(CommandPtr&& before) &&; /** - * Decorates this command with a timeout. If the specified timeout is + * Decorates this command with a timeout. If the specified timeout is * exceeded before the command finishes normally, the command will be - * interrupted and un-scheduled. Note that the timeout only applies to the - * command returned by this method; the calling command is not itself changed. + * interrupted and un-scheduled. * * @param duration the timeout duration * @return the command with the timeout added @@ -157,10 +156,9 @@ class CommandPtr final { CommandPtr WithTimeout(units::second_t duration) &&; /** - * Decorates this command with an interrupt condition. If the specified + * Decorates this command with an interrupt condition. If the specified * condition becomes true before the command finishes normally, the command - * will be interrupted and un-scheduled. Note that this only applies to the - * command returned by this method; the calling command is not itself changed. + * will be interrupted and un-scheduled. * * @param condition the interrupt condition * @return the command with the interrupt condition added @@ -169,13 +167,12 @@ class CommandPtr final { CommandPtr Until(std::function condition) &&; /** - * Decorates this command with a run condition. If the specified condition + * Decorates this command with a run condition. If the specified condition * becomes false before the command finishes normally, the command will be - * interrupted and un-scheduled. Note that this only applies to the command - * returned by this method; the calling command is not itself changed. + * interrupted and un-scheduled. * - * @param condition the interrupt condition - * @return the command with the interrupt condition added + * @param condition the run condition + * @return the command with the run condition added */ [[nodiscard]] CommandPtr OnlyWhile(std::function condition) &&; @@ -243,7 +240,7 @@ class CommandPtr final { * the command's inherent Command::End(bool) method. * * @param end a lambda accepting a boolean parameter specifying whether the - * command was interrupted. + * command was interrupted * @return the decorated command */ [[nodiscard]]