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


Java HashedMap类代码示例

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


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

示例1: buildSynsetNameWithContainedUnits

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
public Map<Long, String> buildSynsetNameWithContainedUnits(List<Sense> sense) {
    Map<Long, String> names = new HashedMap<>();
    if (!sense.isEmpty()) {
        int i = 0;
        while (i < sense.size()) {
            Long id = sense.get(i).getSynset().getId();
            List<String> senseName = new ArrayList<>();
            while (sense.get(i).getSynset().getId().equals(id)) {
                senseName.add(sense.get(i).toString() + " " + sense.get(i).getLexicon().getIdentifier());
                i++;
                if (i > sense.size() - 1) {
                    break;
                }
            }
            names.put(id, senseName.toString());
            if (i < sense.size()) {
                id = sense.get(i).getSynset().getId();
            }
        }
    }
    return names;
}
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:23,代码来源:GenericListModel.java

示例2: loadTextFilter

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
public Map<String, String> loadTextFilter() {
	Map<String, String> textfilter = new HashedMap<String, String>();
	CFile file = getSelectedWordFile();
	List<String> lines = file.loadTextAsList();
	for (String line : lines) {
		KDWordSet wordset = parseLine(line);
		if (wordset == null) {
			continue;
		}

		for (String branchWord : wordset.branchWords) {
			textfilter.put(branchWord, wordset.trunkWord);
		}
	}
	return textfilter;
}
 
开发者ID:macc704,项目名称:KBDeX,代码行数:17,代码来源:KDDiscourseFile.java

示例3: OnboardingDialog

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
public OnboardingDialog(WelcomeType welcomeType) {
    super(ApplicationFrame.getApplicationFrame(), "onboarding", ModalityType.APPLICATION_MODAL, new Object[0]);
    this.sharedObjects = new HashedMap();
    this.cardPool = new HashedMap();
    this.welcomeType = WelcomeType.FIRST_WELCOME;
    this.reminderType = ReminderType.REMINDER;
    this.welcomeType = welcomeType;
    this.initGUI();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:OnboardingDialog.java

示例4: addSubstitutions

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
/**
 * Convenience method to keep track of correspondences between {@link VariablePrototype}s and {@link Variable}s (useful
 * when {@link ConstraintNetwork}s are used as meta-values in {@link MetaConstraintSolver}s).
 * @param vp2v Mapping between {@link VariablePrototype}s and {@link Variable}s.
 */	
public void addSubstitutions(HashedMap<VariablePrototype,Variable> vp2v) {

	for(VariablePrototype vp: vp2v.keySet()){
		substitutions.put(vp, vp2v.get(vp));
		substituted.put(vp2v.get(vp),vp);
		logger.finest("Added susbstitution " + vp + " <-- " + vp2v.get(vp));
	}
}
 
开发者ID:FedericoPecora,项目名称:meta-csp-framework,代码行数:14,代码来源:ConstraintNetwork.java

示例5: ClearingGiltsBondsAndCommercialLoansMarket

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
@Inject
public ClearingGiltsBondsAndCommercialLoansMarket(
   @Assisted
   final String marketName,
   @Assisted
   final ClearingHouse clearingHouse
   ) {
   super(marketName, clearingHouse);
   this.bankIsParticipating = new HashMap<String, Boolean>();
   this.firmIsParticipating = new HashMap<String, Boolean>();
   this.fundIsParticipating = new HashMap<String, Boolean>();
   this.commercialLoanRiskGrades = Arrays.asList("Low Risk", "Medium Risk", "High Risk");
   this.instruments = new HashMap<String, ClearingInstrument>();
   this.lastTradeVolumes = new HashMap<ClearingInstrument, Double>();
   this.lastTradeWeightedReturnRates = new HashMap<ClearingInstrument, Double>();
   this.commericalLoanClientRiskBuckets =
      new HashedMap<String, List<ClearingMarketParticipant>>();
   
   for(final String riskGrade : commercialLoanRiskGrades)
      addInstrument(riskGrade + " Commercial Loan", instruments);
   addInstrument("Gilt", instruments);
   addInstrument("Bank Bond", instruments);
   for(final ClearingInstrument instrument : instruments.values()) {
      lastTradeVolumes.put(instrument, 0.);
      lastTradeWeightedReturnRates.put(instrument, 0.);
   }
}
 
开发者ID:crisis-economics,项目名称:CRISIS,代码行数:28,代码来源:ClearingGiltsBondsAndCommercialLoansMarket.java

示例6: rank

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
/**
 * Assign ranks to a connected component
 * @param graph the graph
 * @param comp the component
 * @return an ordered list of vertices with the same rank
 */
public List<Set<V>> rank(DirectedGraph<V, E> graph, Collection<V> comp) {
    this.graph = graph;
    this.rank = new HashedMap<V, Integer>();
    this.maxRank = 0;
    //Tree<V, E> tree = feasibleTree(comp);
    //TODO
    return null;
}
 
开发者ID:jdfekete,项目名称:geneaquilt,代码行数:15,代码来源:LayerClusterer.java

示例7: makeEmptySet

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
public Set makeEmptySet() {
    return MapBackedSet.decorate(new HashedMap());
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:4,代码来源:TestMapBackedSet.java

示例8: PlotterTemplate

import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
/**
 * Standard constructor.
 */
public PlotterTemplate() {
	listOfDomainLines = new LinkedList<AxisParallelLineConfiguration>();
	rangeAxisCrosshairLinesMap = new HashedMap<String, List<AxisParallelLineConfiguration>>(40);
	domainAxisLinesListener = new AxisParallelLinesConfigurationListener() {
		
		@Override
		public void axisParallelLineConfigurationsChanged(AxisParallelLinesConfigurationChangeEvent e) {
			// domain axis crosshair handling
			if (e.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_ADDED)) {
				if (!listOfDomainLines.contains(e.getLineConfiguration())) {
					listOfDomainLines.add(e.getLineConfiguration());
				}
			} else if (e.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_REMOVED)) {
				listOfDomainLines.remove(e.getLineConfiguration());
			}
		}
	};
	rangeAxisConfigListener = new RangeAxisConfigListener() {
		
		@Override
		public void rangeAxisConfigChanged(RangeAxisConfigChangeEvent e) {
			if (e.getConfigurationChangeType().equals(ConfigurationChangeType.RANGE_AXIS_CONFIG_CHANGE)) {
				AxisParallelLinesConfigurationChangeEvent crosshairChange = e.getCrosshairChange();
				if (crosshairChange != null) {
					List<AxisParallelLineConfiguration> lineList = rangeAxisCrosshairLinesMap.get(e.getSource().getLabel());
					if (lineList == null) {
						lineList = new LinkedList<AxisParallelLineConfiguration>();
					}
					if (crosshairChange.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_ADDED)) {
						if (!lineList.contains(crosshairChange.getLineConfiguration())) {
							lineList.add(crosshairChange.getLineConfiguration());
						}
					} else if (crosshairChange.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_REMOVED)) {
						lineList.remove(crosshairChange.getLineConfiguration());
					}
					rangeAxisCrosshairLinesMap.put(e.getSource().getLabel(), lineList);
				}
			}
		}
	};
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:45,代码来源:PlotterTemplate.java


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