View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: MostRecentlyUsedProject.java
13   * Created: 2007-00-00
14   * Author: awos
15   * $Id: MostRecentlyUsedProject.java 3266 2009-08-27 15:28:45Z tmilos $
16   */
17  
18  package pl.edu.agh.cast.project;
19  
20  import java.util.Collections;
21  import java.util.LinkedList;
22  import java.util.List;
23  
24  import org.eclipse.core.runtime.IPath;
25  import org.eclipse.core.runtime.Path;
26  
27  /**
28   * A wrapper for most recently used project information.
29   *
30   * @author AGH CAST Team
31   */
32  public class MostRecentlyUsedProject {
33  
34  	/**
35  	 * Name of the project.
36  	 */
37  	private String name;
38  
39  	/**
40  	 * List of possible locations of the project.
41  	 */
42  	private List<IPath> locations;
43  
44  	/**
45  	 * Creates new MRU descriptor.
46  	 *
47  	 * @param name
48  	 *            name of the project
49  	 * @param locations
50  	 *            list of possible project locations
51  	 */
52  	public MostRecentlyUsedProject(String name, List<String> locations) {
53  		this.name = name;
54  		this.locations = new LinkedList<IPath>();
55  		for (String l : locations) {
56  			this.locations.add(new Path(l));
57  		}
58  	}
59  
60  	public String getName() {
61  		return name;
62  	}
63  
64  	public List<IPath> getLocations() {
65  		return Collections.unmodifiableList(locations);
66  	}
67  
68  }