質問編集履歴

1

追加

2020/06/26 08:33

投稿

VkeX6coYU
VkeX6coYU

スコア1

test CHANGED
File without changes
test CHANGED
@@ -339,3 +339,57 @@
339
339
  Java
340
340
 
341
341
  ```
342
+
343
+
344
+
345
+ public class DoublyElement {
346
+
347
+ private Object data;
348
+
349
+ private DoublyElement next, previous;
350
+
351
+ private DoublyElement () {
352
+
353
+ }
354
+
355
+ public DoublyElement (Object obj) {
356
+
357
+ this.data = obj;
358
+
359
+ }
360
+
361
+ public Object getData() {
362
+
363
+ return this.data;
364
+
365
+ }
366
+
367
+ public DoublyElement getNextElement() {
368
+
369
+ return this.next;
370
+
371
+ }
372
+
373
+ public void setNextElement(DoublyElement nextElement) {
374
+
375
+ this.next = nextElement;
376
+
377
+ }
378
+
379
+ public DoublyElement getPreviousElement() {
380
+
381
+ return this.previous;
382
+
383
+ }
384
+
385
+ public void setPreviousElement(DoublyElement previousElement) {
386
+
387
+ this.previous = previousElement;
388
+
389
+ }public String toString() {
390
+
391
+ return this.data.toString();
392
+
393
+ }
394
+
395
+ }