@@ -544,26 +544,54 @@ public V put(final K key, final V value) {
544544 return this .put (key , value , Position .LAST );
545545 }
546546
547+ /**
548+ * Insert at the beginning.
549+ * @param key the key
550+ * @param value the value
551+ * @return the inserted value
552+ */
547553 public V addFirst (final K key , final V value ) {
548554 return this .put (key , value , Position .FIRST );
549555 }
550556
557+ /**
558+ * Append at the end.
559+ * @param key the key
560+ * @param value the value
561+ * @return the appended value
562+ */
551563 public V add (final K key , final V value ) {
552564 return this .put (key , value , Position .LAST );
553565 }
554566
567+ /**
568+ * Append at the end.
569+ * @param key the key
570+ * @param value the value
571+ * @return the appended value
572+ */
555573 public V addLast (final K key , final V value ) {
556574 return this .put (key , value , Position .LAST );
557575 }
558576
577+ /**
578+ * @return the first value.
579+ */
559580 public V getFirst () {
560581 return getValue (0 );
561582 }
562583
584+ /**
585+ * @return the last value.
586+ */
563587 public V getLast () {
564588 return getValue (this .orderedListSize_ - 1 );
565589 }
566590
591+ /**
592+ * Removes the first entry.
593+ * @return the removed value or null if the map was empty.
594+ */
567595 public V removeFirst () {
568596 if (this .orderedListSize_ > 0 ) {
569597 final int pos = this .orderedList_ [0 ];
@@ -573,6 +601,10 @@ public V removeFirst() {
573601 return null ;
574602 }
575603
604+ /**
605+ * Removes the last entry.
606+ * @return the removed value or null if the map was empty.
607+ */
576608 public V removeLast () {
577609 if (this .orderedListSize_ > 0 ) {
578610 final int pos = this .orderedList_ [this .orderedListSize_ - 1 ];
0 commit comments