{"id":1088,"date":"2025-10-13T03:55:12","date_gmt":"2025-10-12T19:55:12","guid":{"rendered":"https:\/\/vm1.go2see.me\/?p=1088"},"modified":"2025-10-13T03:55:53","modified_gmt":"2025-10-12T19:55:53","slug":"1088","status":"publish","type":"post","link":"https:\/\/vm1.go2see.me\/?p=1088","title":{"rendered":"Java Lab 5: ADTs (JobManager) \u5206\u6790\u554f\u984c"},"content":{"rendered":"<h1>Java Lab 5: ADTs (The  Add comment Overview JobManager)<\/h1>\n<p>This lab activity focuses on the design and  implementation of an abstract data type (ADT) that  we shall call  JobManager . <\/p>\n<p>A  JobManager is  responsible to managing a set of jobs, which are  identified by integer IDs from 1 to  n . <\/p>\n<p>A  JobManager also maintains a set of  Robot  objects that are responsible for completing these  jobs. <\/p>\n<p>The  JobManager ADT&#8217;s operations enable  its user to manage the set of  Robots and the  assignment of jobs to those  Robots.<\/p>\n<h2>Learning Goals<\/h2>\n<ul>\n<li>Develop proficiency in recognizing, reasoning  about, and implementing ADTs, which includes:\n<ul>\n<li>Interpreting the specified operations for an  ADT; <\/li>\n<li>Classifying ADT operations by type <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Robot.java<\/h3>\n<pre><code class=\"language-java\">package jobmanager;\n\n\/**\n * This immutable class represents a real-world Robot, which has a unique positive integer id. A Null Robot, which can\n * be used to indicate the absence of a real-world Robot, has an id of 0.\n *\/\n\npublic final class Robot {\n\n    private final static Robot nullRobot = new Robot();\n\n    public final int id;\n\n    \/**\n     * Creates a new real-world Robot with the specified id.\n     *\n     * @param id\n     * @throws IllegalArgumentException if id &lt;= 0\n     *\/\n    public Robot(int id)\n    {\n        if (id &lt;= 0) { throw new IllegalArgumentException(&quot;Robot id must be strictly positive&quot;); }\n        this.id = id;\n    }\n\n    private Robot() { this.id = 0; }\n\n    \/**\n     * Checks if this Robot is a Null Robot\n     *\n     * @return true iff this.id = 0\n     *\/\n    public boolean isNull() {\n        return id == 0;\n    }\n\n    \/**\n     * Compares the specified object with this Robot for equality\n     *\n     * @param o\n     * @return true iff this and o represent real-world Robots with the same id\n     *\/\n    @Override\n    public boolean equals(Object o) {\n        if (o == null || !(o instanceof Robot)) { return false; }\n        Robot other = (Robot) o;\n        return this.id == other.id;\n    }\n\n    \/**\n     * Returns the hashcode for this Robot\n     *\n     * @return the hashcode value which is the id of this\n     *\/\n    @Override\n    public int hashCode() {\n        return id;\n    }\n\n    \/**\n     * Returns a Null Robot\n     *\n     * @return a Robot instance with id = 0\n     *\/\n    public static Robot getNullRobot() { return Robot.nullRobot; }\n\n}<\/code><\/pre>\n<h2>Robot \u985e\u5225\u8aaa\u660e\uff08\u4f86\u81ea\u7d22\u5f15\u6a19\u7c64\uff09<\/h2>\n<h3>\ud83d\udccc \u985e\u5225\u529f\u80fd<\/h3>\n<ul>\n<li>\u8868\u793a\u4e00\u500b\u5177\u6709\u552f\u4e00\u6b63\u6574\u6578 ID \u7684\u6a5f\u5668\u4eba\u3002<\/li>\n<li>\u63d0\u4f9b\u4e00\u500b\u7279\u6b8a\u7684\u300cNull Robot\u300d\uff0c\u5176 ID \u70ba 0\uff0c\u7528\u4f86\u8868\u793a\u300c\u6c92\u6709\u6a5f\u5668\u4eba\u300d\u7684\u60c5\u6cc1\u3002<\/li>\n<\/ul>\n<h3>\ud83d\udd0d \u65b9\u6cd5\u8207\u884c\u70ba<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u65b9\u6cd5<\/th>\n<th>\u529f\u80fd\u8aaa\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>Robot(int id)<\/code><\/td>\n<td>\u5efa\u69cb\u5b50\uff1a\u5efa\u7acb\u4e00\u500b\u771f\u5be6\u6a5f\u5668\u4eba\uff0cID \u5fc5\u9808\u70ba\u6b63\u6574\u6578\uff0c\u5426\u5247\u4e1f\u51fa\u4f8b\u5916\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>private Robot()<\/code><\/td>\n<td>\u79c1\u6709\u5efa\u69cb\u5b50\uff1a\u5efa\u7acb Null Robot\uff08ID \u70ba 0\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>isNull()<\/code><\/td>\n<td>\u5224\u65b7\u662f\u5426\u70ba Null Robot\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>equals(Object o)<\/code><\/td>\n<td>\u6bd4\u8f03\u5169\u500b Robot \u662f\u5426\u76f8\u7b49\uff08\u6839\u64da ID\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>hashCode()<\/code><\/td>\n<td>\u56de\u50b3\u6a5f\u5668\u4eba\u7684\u96dc\u6e4a\u78bc\uff08\u5c31\u662f ID\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>getNullRobot()<\/code><\/td>\n<td>\u56de\u50b3 Null Robot \u7684\u55ae\u4e00\u5be6\u4f8b\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\ud83e\udde0 \u8a2d\u8a08\u7279\u6027<\/h3>\n<ul>\n<li><strong>\u4e0d\u53ef\u8b8a\u6027<\/strong>\uff1a<code>id<\/code> \u662f <code>final<\/code>\uff0c\u4e14\u985e\u5225\u672c\u8eab\u662f <code>final<\/code>\uff0c\u78ba\u4fdd\u7269\u4ef6\u5efa\u7acb\u5f8c\u4e0d\u53ef\u4fee\u6539\u3002<\/li>\n<li><strong>Null Object \u6a21\u5f0f<\/strong>\uff1a\u4f7f\u7528 <code>Robot(0)<\/code> \u4f5c\u70ba Null Robot\uff0c\u907f\u514d\u4f7f\u7528 <code>null<\/code> \u53c3\u8003\u3002<\/li>\n<li><strong>\u76f8\u7b49\u6027\u8207\u96dc\u6e4a\u4e00\u81f4\u6027<\/strong>\uff1a<code>equals()<\/code> \u8207 <code>hashCode()<\/code> \u6839\u64da <code>id<\/code> \u5b9a\u7fa9\uff0c\u9069\u5408\u7528\u65bc\u96c6\u5408\u985e\u578b\u5982 <code>HashSet<\/code> \u6216 <code>HashMap<\/code>\u3002<\/li>\n<\/ul>\n<h3>\u2705 \u7528\u6cd5\u7bc4\u4f8b\uff08\u4e2d\u6587\u8a3b\u89e3\uff09<\/h3>\n<pre><code class=\"language-java\">Robot r1 = new Robot(5);           \/\/ \u5efa\u7acb ID \u70ba 5 \u7684\u6a5f\u5668\u4eba\nRobot r2 = Robot.getNullRobot();   \/\/ \u53d6\u5f97 Null Robot\nSystem.out.println(r1.isNull());   \/\/ false\nSystem.out.println(r2.isNull());   \/\/ true<\/code><\/pre>\n<h2>Java \u5be6\u9a57\u4e94\uff1a\u62bd\u8c61\u8cc7\u6599\u578b\u5225\uff08ADT\uff09\u2014 JobManager<\/h2>\n<p>\u9019\u9805\u5be6\u9a57\u6d3b\u52d5\u7684\u91cd\u9ede\u662f\u8a2d\u8a08\u8207\u5be6\u4f5c\u4e00\u500b\u540d\u70ba <strong>JobManager<\/strong> \u7684\u62bd\u8c61\u8cc7\u6599\u578b\u5225\uff08ADT\uff09\u3002<\/p>\n<h3>JobManager \u7684\u8077\u8cac<\/h3>\n<ul>\n<li><strong>\u7ba1\u7406\u4e00\u7d44\u5de5\u4f5c\uff08jobs\uff09<\/strong>\uff1a\u6bcf\u500b\u5de5\u4f5c\u7531\u4e00\u500b\u6574\u6578 ID \u8868\u793a\uff0c\u7bc4\u570d\u5f9e <code>1<\/code> \u5230 <code>n<\/code>\u3002<\/li>\n<li><strong>\u7ba1\u7406\u4e00\u7d44\u6a5f\u5668\u4eba\uff08Robot\uff09\u7269\u4ef6<\/strong>\uff1a\u9019\u4e9b\u6a5f\u5668\u4eba\u8ca0\u8cac\u5b8c\u6210\u4e0a\u8ff0\u5de5\u4f5c\u3002<\/li>\n<li><strong>\u63d0\u4f9b\u64cd\u4f5c\u65b9\u6cd5<\/strong>\uff1a\u8b93\u4f7f\u7528\u8005\u80fd\u5920\u7ba1\u7406\u6a5f\u5668\u4eba\u96c6\u5408\uff0c\u4ee5\u53ca\u5c07\u5de5\u4f5c\u5206\u914d\u7d66\u9019\u4e9b\u6a5f\u5668\u4eba\u3002<\/li>\n<\/ul>\n<h2>\u5b78\u7fd2\u76ee\u6a19\uff08Learning Goals\uff09<\/h2>\n<p>\u900f\u904e\u9019\u6b21\u5be6\u9a57\uff0c\u4f60\u5c07\u57f9\u990a\u4ee5\u4e0b\u80fd\u529b\uff1a<\/p>\n<ul>\n<li>\u719f\u7df4\u5730\u8fa8\u8b58\u3001\u63a8\u7406\u8207\u5be6\u4f5c\u62bd\u8c61\u8cc7\u6599\u578b\u5225\uff08ADT\uff09\uff0c\u5305\u62ec\uff1a\n<ul>\n<li>\u89e3\u8b80 ADT \u7684\u64cd\u4f5c\u898f\u683c\uff1b<\/li>\n<li>\u5c07 ADT \u7684\u64cd\u4f5c\u5206\u985e\u70ba\u4ee5\u4e0b\u5e7e\u7a2e\u578b\u5225\uff1a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>\u985e\u578b<\/th>\n<th>\u8aaa\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Creator\uff08\u5275\u5efa\u8005\uff09<\/strong><\/td>\n<td>\u5efa\u7acb\u65b0\u7684 ADT \u5be6\u4f8b\uff0c\u4f8b\u5982\u5efa\u69cb\u5b50\u3002<\/td>\n<\/tr>\n<tr>\n<td><strong>Producer\uff08\u751f\u7522\u8005\uff09<\/strong><\/td>\n<td>\u7522\u751f\u65b0\u7684\u8cc7\u6599\u6216\u72c0\u614b\uff0c\u4f8b\u5982\u5206\u914d\u5de5\u4f5c\u3002<\/td>\n<\/tr>\n<tr>\n<td><strong>Observer\uff08\u89c0\u5bdf\u8005\uff09<\/strong><\/td>\n<td>\u67e5\u8a62\u76ee\u524d\u72c0\u614b\uff0c\u4f8b\u5982\u6aa2\u67e5\u662f\u5426\u5df2\u5206\u914d\u5de5\u4f5c\u3002<\/td>\n<\/tr>\n<tr>\n<td><strong>Mutator\uff08\u8b8a\u7570\u8005\uff09<\/strong><\/td>\n<td>\u4fee\u6539\u73fe\u6709\u72c0\u614b\uff0c\u4f8b\u5982\u65b0\u589e\u6216\u79fb\u9664\u6a5f\u5668\u4eba\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Lab 5.1 Assessment overview Total points: 0\/0 Score: 0% Question LB5.1.1 Total points: \u2014 Report an error in this question  Previous question Next question Personal Notes No attached notes Attach a file  Add text note  <\/p>\n<h3><strong>Lab 5\uff1a\u62bd\u8c61\u8cc7\u6599\u578b\u5225\uff08ADT\uff09\u2014 JobManager<\/strong><\/h3>\n<p>\u9019\u6b21\u5be6\u9a57\u7684\u91cd\u9ede\u662f\u8a2d\u8a08\u4e26\u5be6\u4f5c\u4e00\u500b\u540d\u70ba <strong>JobManager<\/strong> \u7684\u62bd\u8c61\u8cc7\u6599\u578b\u5225\uff08ADT\uff09\u3002JobManager \u7684\u8077\u8cac\u662f\u7ba1\u7406\u4e00\u7d44\u5de5\u4f5c\uff08jobs\uff09\uff0c\u6bcf\u500b\u5de5\u4f5c\u7531\u4e00\u500b\u6574\u6578 ID\uff08\u5f9e 1 \u5230 n\uff09\u8b58\u5225\u3002\u5b83\u540c\u6642\u4e5f\u7ba1\u7406\u4e00\u7d44 <strong>Robot<\/strong> \u7269\u4ef6\uff0c\u9019\u4e9b\u6a5f\u5668\u4eba\u8ca0\u8cac\u5b8c\u6210\u9019\u4e9b\u5de5\u4f5c\u3002<\/p>\n<h3>\ud83c\udfaf <strong>\u5b78\u7fd2\u76ee\u6a19<\/strong><\/h3>\n<ul>\n<li>\u719f\u6089 ADT \u7684\u8a2d\u8a08\u8207\u5be6\u4f5c\u3002<\/li>\n<li>\u80fd\u5920\u89e3\u8b80 ADT \u7684\u64cd\u4f5c\u898f\u683c\u3002<\/li>\n<li>\u80fd\u5920\u5c07 ADT \u7684\u64cd\u4f5c\u5206\u985e\u70ba\uff1a\n<ul>\n<li><strong>\u5275\u5efa\u8005\uff08Creator\uff09<\/strong><\/li>\n<li><strong>\u751f\u7522\u8005\uff08Producer\uff09<\/strong><\/li>\n<li><strong>\u89c0\u5bdf\u8005\uff08Observer\uff09<\/strong><\/li>\n<li><strong>\u8b8a\u7570\u8005\uff08Mutator\uff09<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u2699\ufe0f <strong>JobManager \u7684\u529f\u80fd\u6982\u8ff0<\/strong><\/h3>\n<table>\n<thead>\n<tr>\n<th>\u65b9\u6cd5<\/th>\n<th>\u529f\u80fd\u8aaa\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>JobManager(int n)<\/code><\/td>\n<td>\u5efa\u7acb\u4e00\u500b\u7ba1\u7406 n \u500b\u5de5\u4f5c\u7684 JobManager\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>hasRobot(Robot robot)<\/code><\/td>\n<td>\u6aa2\u67e5\u662f\u5426\u5df2\u7ba1\u7406\u6307\u5b9a\u7684\u6a5f\u5668\u4eba\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>addRobot(Robot robot)<\/code><\/td>\n<td>\u5c07\u6a5f\u5668\u4eba\u52a0\u5165\u7ba1\u7406\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>removeRobot(Robot robot)<\/code><\/td>\n<td>\u79fb\u9664\u6a5f\u5668\u4eba\u4e26\u53d6\u6d88\u5176\u6240\u6709\u5de5\u4f5c\u5206\u914d\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>assignJobs(Robot robot, int jobId)<\/code><\/td>\n<td>\u5c07\u6240\u6709\u672a\u5206\u914d\u4e14 ID \u2264 jobId \u7684\u5de5\u4f5c\u5206\u914d\u7d66\u6307\u5b9a\u6a5f\u5668\u4eba\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>isAssigned(int jobId)<\/code><\/td>\n<td>\u6aa2\u67e5\u67d0\u500b\u5de5\u4f5c\u662f\u5426\u5df2\u88ab\u5206\u914d\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>getRobot(int jobId)<\/code><\/td>\n<td>\u53d6\u5f97\u8ca0\u8cac\u67d0\u500b\u5de5\u4f5c\u7684\u6a5f\u5668\u4eba\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>moveJobs(Robot src, Robot dst, int jobId)<\/code><\/td>\n<td>\u5c07\u4f86\u6e90\u6a5f\u5668\u4eba\u4e2d ID \u2264 jobId \u7684\u5de5\u4f5c\u8f49\u79fb\u7d66\u76ee\u6a19\u6a5f\u5668\u4eba\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>moveJobs(Robot src, Robot dst)<\/code><\/td>\n<td>\u5c07\u4f86\u6e90\u6a5f\u5668\u4eba\u7684\u6240\u6709\u5de5\u4f5c\u8f49\u79fb\u7d66\u76ee\u6a19\u6a5f\u5668\u4eba\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>getHighestPriorityJob(Robot robot, int jobId)<\/code><\/td>\n<td>\u53d6\u5f97\u6307\u5b9a\u6a5f\u5668\u4eba\u4e2d ID \u2264 jobId \u7684\u6700\u9ad8\u512a\u5148\u5de5\u4f5c\u3002<\/td>\n<\/tr>\n<tr>\n<td><code>sameAs(JobManager o)<\/code><\/td>\n<td>\u6bd4\u8f03\u5169\u500b JobManager \u662f\u5426\u5728\u89c0\u5bdf\u4e0a\u76f8\u7b49\uff08\u6a5f\u5668\u4eba\u6c60\u3001\u5de5\u4f5c\u5206\u914d\u3001\u672a\u5206\u914d\u5de5\u4f5c\u90fd\u76f8\u540c\uff09\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\ud83e\udd16 <strong>Robot \u985e\u5225\u7c21\u4ecb<\/strong><\/h3>\n<ul>\n<li>\u6bcf\u500b Robot \u6709\u552f\u4e00\u7684\u6b63\u6574\u6578 ID\u3002<\/li>\n<li>Null Robot\uff08ID \u70ba 0\uff09\u4ee3\u8868\u300c\u6c92\u6709\u6a5f\u5668\u4eba\u300d\uff0c\u4e0d\u80fd\u88ab\u5206\u914d\u5de5\u4f5c\u3002<\/li>\n<li>Robot \u662f\u4e0d\u53ef\u8b8a\u985e\u5225\uff08immutable\uff09\uff0c\u652f\u63f4\u76f8\u7b49\u6027\u6bd4\u8f03\u8207 hashCode\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u60f3\u8981\u6211\u5e6b\u4f60\u7ffb\u8b6f\u67d0\u6bb5\u5177\u9ad4\u7684\u7a0b\u5f0f\u78bc\u6216\u8aaa\u660e\u6587\u5b57\uff0c\u6216\u662f\u9700\u8981\u5e6b\u5fd9\u64b0\u5beb <code>JobManager.java<\/code> \u7684\u5be6\u4f5c\uff0c\u6211\u4e5f\u53ef\u4ee5\u4e00\u6b65\u6b65\u5e36\u4f60\u5b8c\u6210\u3002\u4f60\u60f3\u5148\u5f9e\u54ea\u500b\u65b9\u6cd5\u958b\u59cb\u5462\uff1f<\/p>\n<p>\u5e6b\u5fd9\u64b0\u5beb JobManager.java \u7684\u5be6\u4f5c\uff0c\u6211\u4e5f\u53ef\u4ee5\u4e00\u6b65\u6b65\u5e36\u4f60\u5b8c\u6210\u3002<\/p>\n<p>\u592a\u597d\u4e86\uff0c\u5f37\uff01\u6211\u5011\u5c31\u4e00\u6b65\u6b65\u4f86\u5be6\u4f5c <code>JobManager.java<\/code>\u3002\u9019\u500b\u985e\u5225\u7684\u6838\u5fc3\u4efb\u52d9\u662f\u7ba1\u7406\u5de5\u4f5c\uff08jobs\uff09\u8207\u6a5f\u5668\u4eba\uff08robots\uff09\u7684\u5206\u914d\u3002\u4ee5\u4e0b\u662f\u6211\u5011\u7684\u7b56\u7565\uff1a<\/p>\n<h2>\ud83e\uddf1 \u7b2c\u4e00\u6b65\uff1a\u985e\u5225\u7d50\u69cb\u8207\u6b04\u4f4d\u8a2d\u8a08<\/h2>\n<p>\u6211\u5011\u9700\u8981\u8ffd\u8e64\uff1a<\/p>\n<ul>\n<li>\u6240\u6709\u5de5\u4f5c\uff08job IDs\uff09<\/li>\n<li>\u54ea\u4e9b\u5de5\u4f5c\u5df2\u5206\u914d\u7d66\u54ea\u500b\u6a5f\u5668\u4eba<\/li>\n<li>\u54ea\u4e9b\u6a5f\u5668\u4eba\u6b63\u5728\u88ab\u7ba1\u7406<\/li>\n<\/ul>\n<p>java<\/p>\n<pre><code>package jobmanager;\n\nimport java.util.*;\n\npublic class JobManager {\n    private final int maxJobId;\n    private final Set&lt;Robot&gt; robots;\n    private final Map&lt;Integer, Robot&gt; jobAssignments;\n\n    public JobManager(int n) {\n        if (n &lt; 1) throw new IllegalArgumentException(&quot;Job count must be \u2265 1&quot;);\n        this.maxJobId = n;\n        this.robots = new HashSet&lt;&gt;();\n        this.jobAssignments = new HashMap&lt;&gt;();\n    }<\/code><\/pre>\n<h2>\ud83e\udd16 \u7b2c\u4e8c\u6b65\uff1a\u6a5f\u5668\u4eba\u7ba1\u7406\u65b9\u6cd5<\/h2>\n<h3><code>hasRobot(Robot robot)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean hasRobot(Robot robot) {\n        return robots.contains(robot);\n    }<\/code><\/pre>\n<h3><code>addRobot(Robot robot)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean addRobot(Robot robot) {\n        if (robot == null || robot.isNull()) return false;\n        return robots.add(robot);\n    }<\/code><\/pre>\n<h3><code>removeRobot(Robot robot)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean removeRobot(Robot robot) {\n        if (!robots.remove(robot)) return false;\n        for (Map.Entry&lt;Integer, Robot&gt; entry : jobAssignments.entrySet()) {\n            if (entry.getValue().equals(robot)) {\n                entry.setValue(Robot.getNullRobot());\n            }\n        }\n        return true;\n    }<\/code><\/pre>\n<h2>\ud83d\udce6 \u7b2c\u4e09\u6b65\uff1a\u5de5\u4f5c\u5206\u914d\u8207\u67e5\u8a62<\/h2>\n<h3><code>assignJobs(Robot robot, int jobId)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean assignJobs(Robot robot, int jobId) {\n        if (!hasRobot(robot) || jobId &lt; 1 || jobId &gt; maxJobId) return false;\n        boolean assigned = false;\n        for (int i = 1; i &lt;= jobId; i++) {\n            if (!jobAssignments.containsKey(i) || jobAssignments.get(i).isNull()) {\n                jobAssignments.put(i, robot);\n                assigned = true;\n            }\n        }\n        return assigned;\n    }<\/code><\/pre>\n<h3><code>isAssigned(int jobId)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean isAssigned(int jobId) {\n        return jobAssignments.containsKey(jobId) &amp;&amp; !jobAssignments.get(jobId).isNull();\n    }<\/code><\/pre>\n<h3><code>getRobot(int jobId)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public Robot getRobot(int jobId) {\n        if (!jobAssignments.containsKey(jobId)) return Robot.getNullRobot();\n        return jobAssignments.get(jobId);\n    }<\/code><\/pre>\n<h2>\ud83d\udd04 \u7b2c\u56db\u6b65\uff1a\u5de5\u4f5c\u8f49\u79fb\u8207\u67e5\u8a62\u512a\u5148\u5de5\u4f5c<\/h2>\n<h3><code>moveJobs(Robot src, Robot dst, int jobId)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean moveJobs(Robot src, Robot dst, int jobId) {\n        if (!hasRobot(src) || !hasRobot(dst)) return false;\n        boolean moved = false;\n        for (int i = 1; i &lt;= jobId; i++) {\n            if (src.equals(jobAssignments.get(i))) {\n                jobAssignments.put(i, dst);\n                moved = true;\n            }\n        }\n        return moved;\n    }<\/code><\/pre>\n<h3><code>moveJobs(Robot src, Robot dst)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean moveJobs(Robot src, Robot dst) {\n        if (!hasRobot(src) || !hasRobot(dst)) return false;\n        boolean moved = false;\n        for (int i = 1; i &lt;= maxJobId; i++) {\n            if (src.equals(jobAssignments.get(i))) {\n                jobAssignments.put(i, dst);\n                moved = true;\n            }\n        }\n        return moved;\n    }<\/code><\/pre>\n<h3><code>getHighestPriorityJob(Robot robot, int jobId)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public int getHighestPriorityJob(Robot robot, int jobId) {\n        if (!hasRobot(robot)) return 0;\n        for (int i = jobId; i &gt;= 1; i--) {\n            if (robot.equals(jobAssignments.get(i))) {\n                return i;\n            }\n        }\n        return 0;\n    }<\/code><\/pre>\n<h2>\ud83e\uddea \u7b2c\u4e94\u6b65\uff1a\u89c0\u5bdf\u76f8\u7b49\u6027<\/h2>\n<h3><code>sameAs(JobManager o)<\/code><\/h3>\n<p>java<\/p>\n<pre><code>    public boolean sameAs(JobManager o) {\n        if (this.maxJobId != o.maxJobId) return false;\n        if (!this.robots.equals(o.robots)) return false;\n        for (int i = 1; i &lt;= maxJobId; i++) {\n            Robot r1 = this.jobAssignments.getOrDefault(i, Robot.getNullRobot());\n            Robot r2 = o.jobAssignments.getOrDefault(i, Robot.getNullRobot());\n            if (!r1.equals(r2)) return false;\n        }\n        return true;\n    }\n}<\/code><\/pre>\n<p>\u9019\u6a23\u5c31\u5b8c\u6210\u4e86\u6574\u500b <code>JobManager<\/code> \u7684\u5be6\u4f5c\uff01\u4f60\u60f3\u63a5\u4e0b\u4f86\u4e00\u8d77\u64b0\u5beb\u6e2c\u8a66\u6848\u4f8b\u55ce\uff1f\u9084\u662f\u8981\u512a\u5316\u67d0\u500b\u65b9\u6cd5\u7684\u908f\u8f2f\uff1f\u6211\u53ef\u4ee5\u5e6b\u4f60\u6a21\u64ec\u5e7e\u500b\u5178\u578b\u5834\u666f\u4f86\u9a57\u8b49\u5b83\u7684\u6b63\u78ba\u6027\u3002<\/p>\n<h2>\u5be6\u4f5c <code>jobmanager.java<\/code><\/h2>\n<pre><code class=\"language-java\">package jobmanager;\n\nimport java.util.*;\n\npublic class JobManager {\n    \/\/ Maximum job ID managed by this JobManager\n    private final int maxJobId;\n\n    \/\/ Set of Robots currently managed\n    private final Set&lt;Robot&gt; robotPool;\n\n    \/\/ Mapping from job ID to assigned Robot\n    private final Map&lt;Integer, Robot&gt; jobAssignments;\n\n    \/**\n     * Constructs a JobManager to manage jobs with IDs from 1 to n.\n     * @param n the number of jobs\n     * @throws IllegalArgumentException if n &lt; 1\n     *\/\n    public JobManager(int n) {\n        if (n &lt; 1) throw new IllegalArgumentException(&quot;Job count must be \u2265 1&quot;);\n        this.maxJobId = n;\n        this.robotPool = new HashSet&lt;&gt;();\n        this.jobAssignments = new HashMap&lt;&gt;();\n    }\n\n    \/**\n     * Checks if the specified Robot is currently managed by this JobManager.\n     * @param robot the Robot to check\n     * @return true if robot is in the pool, false otherwise\n     *\/\n    public boolean hasRobot(Robot robot) {\n        return robot != null &amp;&amp; robotPool.contains(robot);\n    }\n\n    \/**\n     * Adds a Robot to the JobManager&#039;s pool.\n     * @param robot the Robot to add\n     * @return true if robot was not already present, false otherwise\n     *\/\n    public boolean addRobot(Robot robot) {\n        if (robot == null || robot.isNull()) return false;\n        return robotPool.add(robot);\n    }\n\n    \/**\n     * Removes a Robot from the pool and unassigns all jobs previously assigned to it.\n     * @param robot the Robot to remove\n     * @return true if robot was removed, false otherwise\n     *\/\n    public boolean removeRobot(Robot robot) {\n        if (!robotPool.remove(robot)) return false;\n        for (int i = 1; i &lt;= maxJobId; i++) {\n            if (robot.equals(jobAssignments.get(i))) {\n                jobAssignments.put(i, Robot.getNullRobot());\n            }\n        }\n        return true;\n    }\n\n    \/**\n     * Assigns all unassigned jobs with ID \u2264 jobId to the specified Robot.\n     * @param robot the Robot to assign jobs to\n     * @param jobId the upper bound of job IDs to assign\n     * @return true if any job was assigned, false otherwise\n     *\/\n    public boolean assignJobs(Robot robot, int jobId) {\n        if (!hasRobot(robot) || jobId &lt; 1 || jobId &gt; maxJobId) return false;\n        boolean changed = false;\n        for (int i = 1; i &lt;= jobId; i++) {\n            Robot current = jobAssignments.getOrDefault(i, Robot.getNullRobot());\n            if (current.isNull()) {\n                jobAssignments.put(i, robot);\n                changed = true;\n            }\n        }\n        return changed;\n    }\n\n    \/**\n     * Checks if a job with the given ID is assigned to any Robot.\n     * @param jobId the job ID to check\n     * @return true if assigned, false otherwise\n     *\/\n    public boolean isAssigned(int jobId) {\n        if (jobId &lt; 1 || jobId &gt; maxJobId) return false;\n        Robot r = jobAssignments.getOrDefault(jobId, Robot.getNullRobot());\n        return !r.isNull();\n    }\n\n    \/**\n     * Returns the Robot assigned to the specified job ID.\n     * @param jobId the job ID\n     * @return the assigned Robot, or Null Robot if unassigned or invalid\n     *\/\n    public Robot getRobot(int jobId) {\n        if (jobId &lt; 1 || jobId &gt; maxJobId) return Robot.getNullRobot();\n        return jobAssignments.getOrDefault(jobId, Robot.getNullRobot());\n    }\n\n    \/**\n     * Moves jobs with ID \u2264 jobId from srcRobot to dstRobot.\n     * @param srcRobot the source Robot\n     * @param dstRobot the destination Robot\n     * @param jobId the upper bound of job IDs to move\n     * @return true if any job was moved, false otherwise\n     *\/\n    public boolean moveJobs(Robot srcRobot, Robot dstRobot, int jobId) {\n        if (!hasRobot(srcRobot) || !hasRobot(dstRobot) || jobId &lt; 1 || jobId &gt; maxJobId) return false;\n        boolean moved = false;\n        for (int i = 1; i &lt;= jobId; i++) {\n            if (srcRobot.equals(jobAssignments.get(i))) {\n                jobAssignments.put(i, dstRobot);\n                moved = true;\n            }\n        }\n        return moved;\n    }\n\n    \/**\n     * Moves all jobs from srcRobot to dstRobot.\n     * @param srcRobot the source Robot\n     * @param dstRobot the destination Robot\n     * @return true if any job was moved, false otherwise\n     *\/\n    public boolean moveJobs(Robot srcRobot, Robot dstRobot) {\n        if (!hasRobot(srcRobot) || !hasRobot(dstRobot)) return false;\n        boolean moved = false;\n        for (int i = 1; i &lt;= maxJobId; i++) {\n            if (srcRobot.equals(jobAssignments.get(i))) {\n                jobAssignments.put(i, dstRobot);\n                moved = true;\n            }\n        }\n        return moved;\n    }\n\n    \/**\n     * Returns the highest priority job (largest ID \u2264 jobId) assigned to the specified Robot.\n     * @param robot the Robot to check\n     * @param jobId the upper bound of job IDs\n     * @return the highest priority job ID, or 0 if none found\n     *\/\n    public int getHighestPriorityJob(Robot robot, int jobId) {\n        if (!hasRobot(robot) || jobId &lt; 1 || jobId &gt; maxJobId) return 0;\n        for (int i = jobId; i &gt;= 1; i--) {\n            if (robot.equals(jobAssignments.get(i))) {\n                return i;\n            }\n        }\n        return 0;\n    }\n\n    \/**\n     * Checks if this JobManager is observationally equal to another.\n     * @param o the other JobManager\n     * @return true if both have same robot pool and identical job assignments\n     *\/\n    public boolean sameAs(JobManager o) {\n        if (this.maxJobId != o.maxJobId) return false;\n        if (!this.robotPool.equals(o.robotPool)) return false;\n        for (int i = 1; i &lt;= maxJobId; i++) {\n            Robot r1 = this.jobAssignments.getOrDefault(i, Robot.getNullRobot());\n            Robot r2 = o.jobAssignments.getOrDefault(i, Robot.getNullRobot());\n            if (!r1.equals(r2)) return false;\n        }\n        return true;\n    }\n}\n<\/code><\/pre>\n<p>\u9019\u4efd\u5be6\u4f5c\u6db5\u84cb\u4e86\u6240\u6709 Lab 5 \u6240\u9700\u7684\u529f\u80fd\uff0c\u4e26\u4e14\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>HashSet<\/code> \u7ba1\u7406\u6a5f\u5668\u4eba\u6c60\u3002<\/li>\n<li>\u4f7f\u7528 <code>HashMap<\/code> \u7ba1\u7406\u5de5\u4f5c\u5206\u914d\u3002<\/li>\n<li>\u78ba\u4fdd Null Robot \u4e0d\u6703\u88ab\u52a0\u5165\u6216\u5206\u914d\u3002<\/li>\n<li>\u6240\u6709\u65b9\u6cd5\u90fd\u7b26\u5408 ADT \u64cd\u4f5c\u5206\u985e\uff08Creator\u3001Producer\u3001Observer\u3001Mutator\uff09\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u60f3\u9032\u4e00\u6b65\u64b0\u5beb\u6e2c\u8a66\u6848\u4f8b\u3001\u6a21\u64ec\u4f7f\u7528\u60c5\u5883\uff0c\u6216\u512a\u5316\u67d0\u4e9b\u908f\u8f2f\uff0c\u6211\u4e5f\u53ef\u4ee5\u5e6b\u4f60\u8a2d\u8a08 <code>JobManagerTest.java<\/code>\u3002\u4f60\u60f3\u63a5\u4e0b\u4f86\u505a\u4ec0\u9ebc\uff1f\u6211\u5011\u53ef\u4ee5\u9a57\u8b49 assign\/move\/sameAs \u7684\u884c\u70ba\u662f\u5426\u6b63\u78ba\u3002<\/p>\n<h2><code>JobManagerTest.java<\/code><\/h2>\n<pre><code class=\"language-java\">package jobmanager;\n\nimport org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class JobManagerTest {\n\n    @Test\n    public void testAddAndHasRobot() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n\n        assertFalse(jm.hasRobot(r1));\n        assertTrue(jm.addRobot(r1));\n        assertTrue(jm.hasRobot(r1));\n        assertFalse(jm.addRobot(r1)); \/\/ already added\n        assertTrue(jm.addRobot(r2));\n    }\n\n    @Test\n    public void testAssignJobs() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        jm.addRobot(r1);\n\n        assertTrue(jm.assignJobs(r1, 3));\n        assertTrue(jm.isAssigned(1));\n        assertTrue(jm.isAssigned(2));\n        assertTrue(jm.isAssigned(3));\n        assertFalse(jm.isAssigned(4));\n        assertEquals(r1, jm.getRobot(2));\n    }\n\n    @Test\n    public void testRemoveRobot() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        jm.addRobot(r1);\n        jm.assignJobs(r1, 5);\n\n        assertTrue(jm.removeRobot(r1));\n        assertFalse(jm.hasRobot(r1));\n        assertFalse(jm.isAssigned(3));\n        assertEquals(Robot.getNullRobot(), jm.getRobot(3));\n    }\n\n    @Test\n    public void testMoveJobsWithLimit() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n        jm.addRobot(r1);\n        jm.addRobot(r2);\n        jm.assignJobs(r1, 5);\n\n        assertTrue(jm.moveJobs(r1, r2, 3));\n        assertEquals(r2, jm.getRobot(1));\n        assertEquals(r2, jm.getRobot(3));\n        assertEquals(r1, jm.getRobot(4)); \/\/ not moved\n    }\n\n    @Test\n    public void testMoveAllJobs() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n        jm.addRobot(r1);\n        jm.addRobot(r2);\n        jm.assignJobs(r1, 5);\n\n        assertTrue(jm.moveJobs(r1, r2));\n        for (int i = 1; i &lt;= 5; i++) {\n            assertEquals(r2, jm.getRobot(i));\n        }\n    }\n\n    @Test\n    public void testHighestPriorityJob() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        jm.addRobot(r1);\n        jm.assignJobs(r1, 4);\n\n        assertEquals(4, jm.getHighestPriorityJob(r1, 5));\n        assertEquals(3, jm.getHighestPriorityJob(r1, 3));\n        assertEquals(0, jm.getHighestPriorityJob(r1, 0));\n    }\n\n    @Test\n    public void testSameAs() {\n        JobManager jm1 = new JobManager(5);\n        JobManager jm2 = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n\n        jm1.addRobot(r1);\n        jm1.addRobot(r2);\n        jm1.assignJobs(r1, 3);\n        jm1.assignJobs(r2, 5);\n\n        jm2.addRobot(r1);\n        jm2.addRobot(r2);\n        jm2.assignJobs(r1, 3);\n        jm2.assignJobs(r2, 5);\n\n        assertTrue(jm1.sameAs(jm2));\n    }\n}<\/code><\/pre>\n<h3>\ud83e\uddea \u6e2c\u8a66\u6db5\u84cb\u91cd\u9ede<\/h3>\n<ul>\n<li>\u2705 \u6a5f\u5668\u4eba\u65b0\u589e\u8207\u67e5\u8a62<\/li>\n<li>\u2705 \u5de5\u4f5c\u5206\u914d\u8207\u67e5\u8a62<\/li>\n<li>\u2705 \u6a5f\u5668\u4eba\u79fb\u9664\u5f8c\u5de5\u4f5c\u89e3\u9664\u5206\u914d<\/li>\n<li>\u2705 \u5de5\u4f5c\u642c\u79fb\uff08\u9650\u5236\u8207\u5168\u90e8\uff09<\/li>\n<li>\u2705 \u67e5\u8a62\u6700\u9ad8\u512a\u5148\u5de5\u4f5c<\/li>\n<li>\u2705 ADT \u76f8\u7b49\u6027\u5224\u65b7<\/li>\n<\/ul>\n<p>\u9019\u4e9b\u6e2c\u8a66\u53ef\u4ee5\u76f4\u63a5\u5728 IDE \u4e2d\u57f7\u884c\uff08\u5982 IntelliJ \u6216 Eclipse\uff09\uff0c\u4e26\u4f7f\u7528 JUnit 5 \u7684 <code>@Test<\/code> \u6a19\u8a3b\u4f86\u9a57\u8b49\u6bcf\u500b\u65b9\u6cd5\u7684\u884c\u70ba\u3002\u4f60\u60f3\u8981\u6211\u5e6b\u4f60\u8a2d\u8a08\u908a\u754c\u6e2c\u8a66\uff08\u4f8b\u5982\u975e\u6cd5 jobId \u6216 Null Robot\uff09\u55ce\uff1f\u9084\u662f\u8981\u52a0\u5165\u66f4\u591a\u7570\u5e38\u8655\u7406\u6e2c\u8a66\uff1f\u6211\u5011\u53ef\u4ee5\u8b93\u9019\u4efd\u6e2c\u8a66\u66f4\u5f37\u97cc\u3002<\/p>\n<pre><code class=\"language-java\">package jobmanager;\n\nimport org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class JobManagerTest {\n\n    \/**\n     * Tests adding robots and verifying their presence.\n     *\/\n    @Test\n    public void testAddAndHasRobot() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n\n        assertFalse(jm.hasRobot(r1));\n        assertTrue(jm.addRobot(r1));\n        assertTrue(jm.hasRobot(r1));\n        assertFalse(jm.addRobot(r1)); \/\/ Should not add duplicate\n        assertTrue(jm.addRobot(r2));\n    }\n\n    \/**\n     * Tests assigning jobs to a robot and verifying job ownership.\n     *\/\n    @Test\n    public void testAssignJobs() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        jm.addRobot(r1);\n\n        assertTrue(jm.assignJobs(r1, 3));\n        assertTrue(jm.isAssigned(1));\n        assertTrue(jm.isAssigned(2));\n        assertTrue(jm.isAssigned(3));\n        assertFalse(jm.isAssigned(4));\n        assertEquals(r1, jm.getRobot(2));\n    }\n\n    \/**\n     * Tests removing a robot and ensuring its jobs are unassigned.\n     *\/\n    @Test\n    public void testRemoveRobot() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        jm.addRobot(r1);\n        jm.assignJobs(r1, 5);\n\n        assertTrue(jm.removeRobot(r1));\n        assertFalse(jm.hasRobot(r1));\n        assertFalse(jm.isAssigned(3));\n        assertEquals(Robot.getNullRobot(), jm.getRobot(3));\n    }\n\n    \/**\n     * Tests moving jobs up to a specific job ID from one robot to another.\n     *\/\n    @Test\n    public void testMoveJobsWithLimit() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n        jm.addRobot(r1);\n        jm.addRobot(r2);\n        jm.assignJobs(r1, 5);\n\n        assertTrue(jm.moveJobs(r1, r2, 3));\n        assertEquals(r2, jm.getRobot(1));\n        assertEquals(r2, jm.getRobot(3));\n        assertEquals(r1, jm.getRobot(4)); \/\/ Should remain with r1\n    }\n\n    \/**\n     * Tests moving all jobs from one robot to another.\n     *\/\n    @Test\n    public void testMoveAllJobs() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n        jm.addRobot(r1);\n        jm.addRobot(r2);\n        jm.assignJobs(r1, 5);\n\n        assertTrue(jm.moveJobs(r1, r2));\n        for (int i = 1; i &lt;= 5; i++) {\n            assertEquals(r2, jm.getRobot(i));\n        }\n    }\n\n    \/**\n     * Tests retrieving the highest priority job assigned to a robot.\n     *\/\n    @Test\n    public void testHighestPriorityJob() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n        jm.addRobot(r1);\n        jm.assignJobs(r1, 4);\n\n        assertEquals(4, jm.getHighestPriorityJob(r1, 5));\n        assertEquals(3, jm.getHighestPriorityJob(r1, 3));\n        assertEquals(0, jm.getHighestPriorityJob(r1, 0)); \/\/ Invalid range\n    }\n\n    \/**\n     * Tests observational equality between two JobManager instances.\n     *\/\n    @Test\n    public void testSameAs() {\n        JobManager jm1 = new JobManager(5);\n        JobManager jm2 = new JobManager(5);\n        Robot r1 = new Robot(1);\n        Robot r2 = new Robot(2);\n\n        jm1.addRobot(r1);\n        jm1.addRobot(r2);\n        jm1.assignJobs(r1, 3);\n        jm1.assignJobs(r2, 5);\n\n        jm2.addRobot(r1);\n        jm2.addRobot(r2);\n        jm2.assignJobs(r1, 3);\n        jm2.assignJobs(r2, 5);\n\n        assertTrue(jm1.sameAs(jm2));\n    }\n\n    \/**\n     * Tests edge cases: null robot, invalid job ID, and duplicate removal.\n     *\/\n    @Test\n    public void testEdgeCases() {\n        JobManager jm = new JobManager(5);\n        Robot r1 = new Robot(1);\n\n        \/\/ Null robot should not be added\n        assertFalse(jm.addRobot(Robot.getNullRobot()));\n\n        \/\/ Assigning jobs to unregistered robot should fail\n        assertFalse(jm.assignJobs(r1, 3));\n\n        \/\/ Adding then removing robot twice\n        assertTrue(jm.addRobot(r1));\n        assertTrue(jm.removeRobot(r1));\n        assertFalse(jm.removeRobot(r1)); \/\/ Already removed\n\n        \/\/ Invalid job ID queries\n        assertFalse(jm.isAssigned(0));\n        assertFalse(jm.isAssigned(6));\n        assertEquals(Robot.getNullRobot(), jm.getRobot(0));\n        assertEquals(Robot.getNullRobot(), jm.getRobot(6));\n    }\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Java Lab 5: ADTs (The Add comment Overview JobManager) &#8230; &raquo; <a class=\"read-more-link\" href=\"https:\/\/vm1.go2see.me\/?p=1088\">\u95b1\u8b80\u5168\u6587<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1088","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts\/1088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1088"}],"version-history":[{"count":3,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts\/1088\/revisions"}],"predecessor-version":[{"id":1091,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=\/wp\/v2\/posts\/1088\/revisions\/1091"}],"wp:attachment":[{"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vm1.go2see.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}