当前位置: 首页>>代码示例>>Java>>正文


Java Name类代码示例

本文整理汇总了Java中org.jboss.seam.annotations.Name的典型用法代码示例。如果您正苦于以下问题:Java Name类的具体用法?Java Name怎么用?Java Name使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Name类属于org.jboss.seam.annotations包,在下文中一共展示了Name类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getResult

import org.jboss.seam.annotations.Name; //导入依赖的package包/类
private Map<Characterization.Name, ResultForType> getResult(Long resourceId) {
	if (resultsByResourceId.containsKey(resourceId)) {
		return resultsByResourceId.get(resourceId);
	} else {
		log.info("Calculating characterization results for resource #0", resourceId);
		Query q = entityManager.createNamedQuery("characterization.groupedResults");
		q.setParameter("resourceId", resourceId);
		Map<Characterization.Name, ResultForType> results = new HashMap<Characterization.Name, ResultForType>();
		for (Object[] row : (List<Object[]>)q.getResultList()) {
			Characterization.Name type = (Characterization.Name) row[0];
			Pair<Integer, Integer> result = new Pair<Integer, Integer>((Integer)row[1], ((Long)row[2]).intValue());
			if (!results.containsKey(type))
				results.put(type, new ResultForType());
			results.get(type).addResult(result);
		}
		resultsByResourceId.put(resourceId, results);
		return results;
	}
}
 
开发者ID:play4science,项目名称:gwap,代码行数:20,代码来源:CharacterizationBean.java

示例2: getByResource

import org.jboss.seam.annotations.Name; //导入依赖的package包/类
/**
 * Builds a list of defined characterizations for the instance type of the resource.
 * 
 * @param resource
 * @return
 */
public static List<Characterization> getByResource(Resource resource) {
	List<Characterization> dummies = new ArrayList<Characterization>();
	if (resource instanceof Statement) {
		dummies.add(new Characterization(Characterization.Name.gender));
		dummies.add(new Characterization(Characterization.Name.maturity));
		dummies.add(new Characterization(Characterization.Name.cultivation));
	}
	return dummies;
}
 
开发者ID:play4science,项目名称:gwap,代码行数:16,代码来源:CharacterizationBean.java

示例3: Characterization

import org.jboss.seam.annotations.Name; //导入依赖的package包/类
public Characterization(Name name) {
	this.name = name;
}
 
开发者ID:play4science,项目名称:gwap,代码行数:4,代码来源:Characterization.java

示例4: getName

import org.jboss.seam.annotations.Name; //导入依赖的package包/类
public Name getName() {
	return name;
}
 
开发者ID:play4science,项目名称:gwap,代码行数:4,代码来源:Characterization.java

示例5: setName

import org.jboss.seam.annotations.Name; //导入依赖的package包/类
public void setName(Name name) {
	this.name = name;
}
 
开发者ID:play4science,项目名称:gwap,代码行数:4,代码来源:Characterization.java

示例6: getAvailableItems

import org.jboss.seam.annotations.Name; //导入依赖的package包/类
/**
 * Returns the order in which the items of a characterization are displayed.
 * 
 * @param characterizationName
 * @return
 */
public Integer[] getAvailableItems(Characterization.Name characterizationName) {
	return new Integer[] { 1, 2, 3, 0 };
}
 
开发者ID:play4science,项目名称:gwap,代码行数:10,代码来源:CharacterizationBean.java


注:本文中的org.jboss.seam.annotations.Name类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。