Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2010 IBM Corporation 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: IBM Corporation - initial API and implementation /
 
 package org.eclipse.equinox.internal.p2.updatesite;
 
 import java.util.List;
 
 public class SiteIU {
 
 	public static final String QUERY_TYPE_CONTEXT = "context"//$NON-NLS-1$
 	public static final String QUERY_TYPE_MATCH = "match"//$NON-NLS-1$
 
 	private String id = null;
 	private String range = null;
 	private String queryExpression = null;
 	private String queryType = null;
 	private List<StringqueryParams = null;
 	private List<StringcategoryNames = null;

Returns the id of the IU

Returns:
the id of the IU
 
 	public String getID() {
 		return ;
 	}

Returns the range of the IU

Returns:
the range of the IU
 
 	public String getRange() {
 		return ;
 	}

Returns the query expression for the IU.

Returns:
query expression
 
 	public String getQueryExpression() {
 		return ;
 	}

Returns the query type for the IU.

Returns:
the query type
 
 	public String getQueryType() {
 		return ;
 	}

Returns the params for the query expression for the IU

Returns:
an array of query params.
 
 	public String[] getQueryParams() {
 		if ( == null)
 			return new String[0];
 
 		return .toArray(new String[0]);
 	}

Returns the names of categories the referenced IU belongs to.

Returns:
an array of names, or an empty array.
 
 	public String[] getCategoryNames() {
 		if ( == null)
 			return new String[0];
 
 		return .toArray(new String[0]);
 	}

Sets the id for the IU.

Parameters:
id the id
 
 	public void setID(String id) {
 		this. = id;
 	}

Sets the range for the IU.

Parameters:
range the range
 
 	public void setRange(String range) {
 		this. = range;
	}

Sets the query expression for the IU.

Parameters:
queryExpression query expression
	public void setQueryExpression(String queryExpression) {
		this. = queryExpression;
	}

Sets the query type for the IU.

Parameters:
queryType the query type
	public void setQueryType(String queryType) {
		this. = queryType;
	}

Adds the name of a category this IU belongs to.

Parameters:
categoryName category name
	public void addCategoryName(String categoryName) {
		if (this. == null)
			this. = new ArrayList<String>();
		if (!this..contains(categoryName))
			this..add(categoryName);
	}

Adds a param for the query expression for this IU.

Parameters:
queryParam a query param.
	public void addQueryParams(String queryParam) {
		if (this. == null)
			this. = new ArrayList<String>();
		// don't do contains check, order matters and there may be duplicates
		this..add(queryParam);
	}
New to GrepCode? Check out our FAQ X