Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hw1;
- /**
- * The itemsLinkedList acts as a linkedlist for all the items.
- *
- * @author Philip Bei Xu Yong
- */
- public class itemsLinkedList
- {
- /**
- * This is the constructor for the firstNode.
- */
- public Node firstNode;
- /**
- * This is the constructor to initialize the firstNode.
- * @param info String[] information from text file.
- */
- itemsLinkedList(String[] info)
- {
- firstNode = new Node(info);
- }
- /**
- * This method looks for the next empty node to add new infomation.
- * @param node just references the firstNode.
- * @param info String[] information from text file.
- */
- void add(Node node, String[] info)
- {
- if(node.next == null)
- {
- Node nextNode = new Node(info);
- node.next = nextNode;
- nextNode.prev = node;
- }
- else
- {
- add(node.next, info);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement