
/**
 * 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;
    }

}

@@ -17,9 +17,8 @@
 taci
-%C3%B3
 n de
@@ -1196,19 +1196,16 @@
 El t
-i
 tulo de
- la
+l
  Pul
@@ -1248,10 +1248,10 @@
 urn 
-La
+El
  pri
@@ -1274,17 +1274,16 @@
 con el t
-i
 tulo des

add searchPR()