Java 类org.apache.commons.collections15.map.HashedMap 实例源码

项目:WordnetLoom    文件:GenericListModel.java   
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;
}
项目:KBDeX    文件:KDDiscourseFile.java   
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;
}
项目:rapidminer    文件:OnboardingDialog.java   
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();
}
项目:rapidminer    文件:OnboardingDialog.java   
public OnboardingDialog(ReminderType reminderType) {
    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.WELCOME_REMINDER;
    this.reminderType = reminderType;
    this.initGUI();
}
项目:meta-csp-framework    文件:ConstraintNetwork.java   
/**
 * 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));
    }
}
项目:CRISIS    文件:ClearingGiltsBondsAndCommercialLoansMarket.java   
@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.);
   }
}
项目:geneaquilt    文件:LayerClusterer.java   
/**
 * 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;
}
项目:VarJ    文件:TestMapBackedSet.java   
public Set makeEmptySet() {
    return MapBackedSet.decorate(new HashedMap());
}
项目:rapidminer-5    文件:PlotterTemplate.java   
/**
 * 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);
                }
            }
        }
    };
}