Ignore:
Timestamp:
12/23/14 11:15:34 (10 years ago)
Author:
pharms
Message:
  • performance improvement by using array list instead of linked list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/TaskPath.java

    r1767 r1847  
    1515package de.ugoe.cs.autoquest.tasktrees.treeifc; 
    1616 
    17 import java.util.LinkedList; 
     17import java.util.ArrayList; 
     18import java.util.List; 
    1819 
    1920/** 
     
    2728 
    2829    /** */ 
    29     private LinkedList<Entry> taskList; 
     30    private List<Entry> taskList; 
    3031     
    3132    /** 
     
    3536    public TaskPath() { 
    3637        super(); 
    37         taskList = new LinkedList<Entry>(); 
     38        taskList = new ArrayList<Entry>(); 
    3839    } 
    3940 
     
    5960     */ 
    6061    public ITask removeLast() { 
    61         Entry last = taskList.removeLast(); 
     62        Entry last = taskList.remove(taskList.size() - 1); 
    6263        if (last != null) { 
    6364            return last.getTask(); 
     
    7273     */ 
    7374    public ITask getLast() { 
    74         Entry last = taskList.getLast(); 
     75        Entry last = taskList.get(taskList.size() - 1); 
    7576        if (last != null) { 
    7677            return last.getTask(); 
     
    128129    public Entry get(int index) { 
    129130        return taskList.get(index); 
    130     } 
    131  
    132     /** 
    133      * 
    134      */ 
    135     public void remove(int index) { 
    136         taskList.remove(index); 
    137131    } 
    138132 
Note: See TracChangeset for help on using the changeset viewer.