package org.curriki.plugin.analytics;

import java.util.LinkedList;

/**
 * This class is a wrapper around a list which is used in the CurrikiAnalyitcsSession to store the url history
 * of the current user. The wrapper is needed to limit the size of the information stored in the session of each user.
 */
public class UrlStore extends LinkedList<String> {
    private final static int MAX_SIZE = 50;

    @Override
    public void addLast(String s) {
        if(this.size()+1>MAX_SIZE)this.removeFirst();
        super.addLast(s);    //To change body of overridden methods use File | Settings | File Templates.
    }

    @Override
    public void addFirst(String s) {
        if(this.size()+1>MAX_SIZE)this.removeLast();
        super.addFirst(s);    //To change body of overridden methods use File | Settings | File Templates.
    }

    @Override
    public boolean add(String s) {
        if(this.size()+1>MAX_SIZE)this.removeFirst();
        return super.add(s);    //To change body of overridden methods use File | Settings | File Templates.
    }
}
@@ -529,89 +529,9 @@
 (s);
-    //To change body of overridden methods use File %7C Settings %7C File Templates.
 %0A
+
     
@@ -667,88 +667,8 @@
 (s);
-    //To change body of overridden methods use File %7C Settings %7C File Templates.
 %0A   
@@ -766,32 +766,32 @@
 .removeFirst();%0A
+
         return s
@@ -806,88 +806,8 @@
 (s);
-    //To change body of overridden methods use File %7C Settings %7C File Templates.
 %0A   

Clean up obsolete comments.