001/************************* PROJECT RON *************************/ 002/* Copyright (c) 2026 StuyPulse Robotics. All rights reserved. */ 003/* Use of this source code is governed by an MIT-style license */ 004/* that can be found in the repository LICENSE file. */ 005/***************************************************************/ 006package tools.ToolClasses; 007 008/** 009 * <h2>Tool</h2> 010 * <p>A class that represents a tool that can be run. This is for simple actions and doesn't take in any arguments. 011 * For tools that take in arguments, use {@link ArgumentedTool} instead. 012 * <p>To use, simply extend this class and implement the {@link #execute()} method. Then, to run the tool, simply call the {@link #run()} method. 013 */ 014public abstract class Tool { 015 /** 016 * Default constructor for the tool. This is protected to prevent instantiation of the tool without extending it. 017 */ 018 protected Tool() { 019 020 } 021 022 /** 023 * The functionality for the tool. Must be implemented. 024 */ 025 protected abstract void execute(); 026 /** 027 * The main entry point for the tool. This will call the {@link #execute()} method. 028 */ 029 public final void run() { 030 execute(); 031 } 032}