Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2f110bbe181a6d9d69770df534dd76da4d17f903 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*******************************************************************************
 * Copyright (c) 2004, 2009 Tasktop Technologies and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Tasktop Technologies - initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.internal.tasks.bugs;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.eclipse.mylyn.internal.provisional.tasks.bugs.IProvider;

public class SupportCategory extends AbstractSupportElement {

	private static final int DEFAULT_WEIGHT = 1000;

	private List<IProvider> providers;

	private int weight;

	public SupportCategory() {
		setWeight(DEFAULT_WEIGHT);
	}

	public void add(IProvider provider) {
		if (providers == null) {
			providers = new ArrayList<IProvider>();
		}
		providers.add(provider);
	}

	public void remove(IProvider provider) {
		if (providers != null) {
			providers.remove(provider);
		}
	}

	public List<IProvider> getProviders() {
		if (providers == null) {
			return Collections.emptyList();
		}
		return new ArrayList<IProvider>(providers);
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

}

Back to the top