From charlesreid1

Line 1: Line 1:
==List ADT==
==List Interfaces in Java API==
 
===List ADT===
 
The List interface - adding <code>implements List<E></code> to a class - has quite a few methods that need to be defined. This makes a data collection capable of being treated as a Collections object.
 
The full list is here: List interface class abstract methods: https://docs.oracle.com/javase/8/docs/api/java/util/List.html
 
 


===LinkedList ADT===
===LinkedList ADT===

Revision as of 06:12, 1 June 2017

List Interfaces in Java API

List ADT

The List interface - adding implements List<E> to a class - has quite a few methods that need to be defined. This makes a data collection capable of being treated as a Collections object.

The full list is here: List interface class abstract methods: https://docs.oracle.com/javase/8/docs/api/java/util/List.html


LinkedList ADT

Link to implementation on git.charlesreid1.com: https://charlesreid1.com:3000/cs/java/src/master/lists/linked-lists

The linked list abstract data type provides the following methods:

  • size
  • isEmpty
  • first
  • last
  • addFirst
  • addLast
  • removeFirst

Furthermore, convenience methods can be added, like:

  • add
  • remove
  • remove(i)
  • removeFirst
  • removeLast

See Java API for LinkedList class: https://docs.oracle.com/javase/7/docs/api/java/util/LinkedList.html

Flags