All pastes #750085 Raw Edit

Stuff

public text v1 · immutable
#750085 ·published 2007-10-26 06:36 UTC
rendered paste body
class dllist<item_t> implements list<item_t> {

   private class node {
      item_t item;
      node prev;
      node next;
   };

   private node first = null;
   private node current = null;
   private node last = null;
   private int currentposition = 0;

   public void setposition (position pos) {
      System.out.println("hello!");
//        if (this.position == FIRST){
//         System.out.println("position FIRST");
         node np = new node();
         np = first;
           current.item=getitem();
           first.item=current.item;
//         currentposition++;
"dllist.java" 66 lines, 1620 characters

[3]+  Stopped                 vi dllist.java
bash-2.03$ vi dllist.java
"dllist.java" 66 lines, 1620 characters 
// $Id: dllist.java,v 1.16 2007-10-25 21:33:49-07 - - $

class dllist<item_t> implements list<item_t> {

   private class node {
      item_t item;
      node prev;
      node next;
   };

   private node first = null;
   private node current = null;
   private node last = null;
   private int currentposition = 0;

   public void setposition (position pos) {
      System.out.println("hello!");
//        if (this.position == FIRST){
//         System.out.println("position FIRST");
         node np = new node();
         np = first;
           current.item=getitem();
           first.item=current.item;
//         currentposition++;
//         System.out.println(first.item);
//        }
      throw new UnsupportedOperationException();
   };

   public boolean isempty () {
      System.out.println("is empty? lolz");
      if (current.item==null){
         System.out.println("empty");
         return true;
      }else{
         System.out.println("not empty");
         return false;
       //  throw new UnsupportedOperationException();
      }
   };

   public item_t getitem () {

      if (current.item != null){
         System.out.println(current.item);
         return current.item;
      }else{
         System.out.println("item is null lawlsor");
         throw new UnsupportedOperationException();
      }
   };

   public int getposition () {
      throw new UnsupportedOperationException();
   };

   public void delete () {
      throw new UnsupportedOperationException();
   };

   public void insert (item_t item, position pos) {
      throw new UnsupportedOperationException();
   };

};