本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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));
}
}
示例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.);
}
}
示例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;
}
示例7: makeEmptySet
import org.apache.commons.collections15.map.HashedMap; //导入依赖的package包/类
public Set makeEmptySet() {
return MapBackedSet.decorate(new HashedMap());
}
示例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);
}
}
}
};
}