
/**
 * Implementación de lista simplemente enlazada.
 *
 * @author Jordi
 *
 */
public class ListaPR {

    PullRequest first;

    public ListaPR() {
        first = new PullRequest( null );
    }

    public void insertarPR( String t ) {
        PullRequest newNode = new PullRequest( t );
        if ( isEmpty() ) {
            first.next = newNode;
        } else {
            PullRequest aux = first;
            while ( aux.next != null ) {
                aux = aux.next;
            }
            aux.next = newNode;
        }
    }

    public int getSize() {
        int i = 0;
        PullRequest aux = first;
        while ( aux.next != null ) {
            aux = aux.next;
            i++;
        }
        return i;
    }

    public boolean isEmpty() {
        if ( first.next == null ) {
            return true;
        }
        return false;
    }

    public PullRequest getFirst() {
        return first.next;
    }

    public void listPRs() {
        PullRequest aux = first;
        while ( aux.next != null ) {
            aux = aux.next;
            System.out.println( aux.titulo );
        }
    }

    public void deletePR( String title ) {

    }

    /**
     *
     * @param title El titulo de la PullRequest a buscar
     *
     * @return La primer PullRequest con el titulo deseado
     */
    public PullRequest searchPR( String title ) {

        PullRequest resultPullRequest = null;
        PullRequest currentPullRequest;

        currentPullRequest = this.first;

        while ( currentPullRequest.next != null ) {

            if ( currentPullRequest.titulo.equals( title ) ) {
                resultPullRequest = currentPullRequest;
                break;
            }
            currentPullRequest = currentPullRequest.next;
        }

        return resultPullRequest;
    }

}

@@ -177,22 +177,20 @@
 Request(
- 
 null
- 
 );%0A    %7D
@@ -218,25 +218,24 @@
 ertarPR(
- 
 String t
  ) %7B%0A   
@@ -226,17 +226,16 @@
 String t
- 
 ) %7B%0A    
@@ -280,11 +280,9 @@
 est(
- t 
+t
 );%0A 
@@ -292,17 +292,16 @@
     if (
- 
 isEmpty(
@@ -301,17 +301,16 @@
 sEmpty()
- 
 ) %7B%0A    
@@ -404,33 +404,32 @@
          while (
- 
 aux.next != null
@@ -420,33 +420,32 @@
 aux.next != null
- 
 ) %7B%0A            
@@ -613,33 +613,32 @@
 %0A        while (
- 
 aux.next != null
@@ -629,33 +629,32 @@
 aux.next != null
- 
 ) %7B%0A            
@@ -764,17 +764,16 @@
     if (
- 
 first.ne
@@ -778,25 +778,24 @@
 next == null
- 
 ) %7B%0A        
@@ -996,17 +996,16 @@
  while (
- 
 aux.next
@@ -1008,25 +1008,24 @@
 next != null
- 
 ) %7B%0A        
@@ -1075,17 +1075,16 @@
 println(
- 
 aux.titu
@@ -1085,17 +1085,16 @@
 x.titulo
- 
 );%0A     
@@ -1130,17 +1130,16 @@
 eletePR(
- 
 String t
@@ -1134,33 +1134,32 @@
 ePR(String title
- 
 ) %7B%0A%0A    %7D%0A%0A    
@@ -1332,17 +1332,16 @@
 earchPR(
- 
 String t
@@ -1344,17 +1344,16 @@
 ng title
- 
 ) %7B%0A%0A   
@@ -1493,17 +1493,16 @@
  while (
- 
 currentP
@@ -1524,17 +1524,16 @@
  != null
- 
 ) %7B%0A%0A   
@@ -1545,17 +1545,16 @@
     if (
- 
 currentP
@@ -1582,17 +1582,14 @@
 als(
- 
 title
- ) 
+)
 ) %7B%0A

Update ListaPR.java