當前位置: 首頁>>代碼示例>>Java>>正文


Java HashedMap類代碼示例

本文整理匯總了Java中org.apache.commons.collections.map.HashedMap的典型用法代碼示例。如果您正苦於以下問題:Java HashedMap類的具體用法?Java HashedMap怎麽用?Java HashedMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HashedMap類屬於org.apache.commons.collections.map包,在下文中一共展示了HashedMap類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: providesKafkaInputStream

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Provides
JavaInputDStream<ConsumerRecord<String, RawRating>> providesKafkaInputStream(JavaStreamingContext streamingContext) {
    Map<String, Object> kafkaParams = new HashedMap();
    kafkaParams.put("bootstrap.servers", "localhost:9092");
    kafkaParams.put("key.deserializer", StringDeserializer.class);
    kafkaParams.put("value.deserializer", JsonDeserializer.class);
    kafkaParams.put("serializedClass", RawRating.class);
    kafkaParams.put("group.id", "rating_stream");
    kafkaParams.put("auto.offset.reset", "latest");
    kafkaParams.put("enable.auto.commit", false);
    Collection<String> topics = Arrays.asList("topicA", "topicB");

    return KafkaUtils.createDirectStream(
            streamingContext,
            LocationStrategies.PreferConsistent(),
            ConsumerStrategies.<String, RawRating>Subscribe(topics, kafkaParams)
    );
}
 
開發者ID:cosminseceleanu,項目名稱:movie-recommender,代碼行數:19,代碼來源:SparkModule.java

示例2: setLoginEntity

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Override
public void setLoginEntity(LoginEntity loginEntity) {
    Map<String, Object> params = new HashedMap();
    params.put("user", "fc7kj");
    params.put("pwd", MD5Utils.digest("zhang520"));
    params.put("service", "http://i.wan.liebao.cn/login?go=http://wan.liebao.cn/game_frame/play_1087.php?sid=22&supplier_id=2");
    params.put("rm", "1");
    params.put("cn", "a6742619ae9d91bfb87b0f9507c8d0ad");
    loginEntity.setParams(params);
    loginEntity.setLoginUrl("https://login.ijinshan.com/webgame/w/loginpage.html");
    loginEntity.setActionUrl("https://login.ijinshan.com/login");
    loginEntity.setCodeUrl("https://login.ijinshan.com/imgCode?_dc=" + (System.currentTimeMillis()) + "&cn=a6742619ae9d91bfb87b0f9507c8d0ad");
    loginEntity.setCharset("UTF-8");
    loginEntity.setUnEscape(true);
    loginEntity.setMark("用戶名或密碼錯誤;驗證錯誤;驗證碼錯誤;登錄失敗;");
}
 
開發者ID:hexiaohong-code,項目名稱:LoginCrawler,代碼行數:17,代碼來源:JinShanYouXiProcessor.java

示例3: setLoginEntity

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Override
public void setLoginEntity(LoginEntity loginEntity) {
    Map<String, Object> params = new HashedMap();
    params.put("user", "fc7kj");
    params.put("pwd", MD5Utils.digest("zhang520"));
    params.put("service", "");
    params.put("rm", "1");
    params.put("cn", "b06aa38e7641826933720e37f481ac7c");
    loginEntity.setParams(params);
    loginEntity.setLoginUrl("https://login.ijinshan.com/login.html");
    loginEntity.setActionUrl("https://login.ijinshan.com/login");
    loginEntity.setCodeUrl("https://login.ijinshan.com/imgCode?_dc=" + (System.currentTimeMillis()) + "&cn=b06aa38e7641826933720e37f481ac7c");
    loginEntity.setCharset("UTF-8");
    loginEntity.setUnEscape(true);
    loginEntity.setMark("用戶名或密碼錯誤;驗證錯誤;驗證碼錯誤;登錄失敗;");
    loginEntity.setActionUrl("https://login.ijinshan.com/login");
}
 
開發者ID:hexiaohong-code,項目名稱:LoginCrawler,代碼行數:18,代碼來源:JinShanProcessor.java

示例4: getGrids

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
/**
 * 數據表grid查詢 It's not good enough
 * @param pageIndex
 * @param pageSize
 * @param paramsMap 給criteria添加參數使用
 * @return
 */
private Map<String, Object> getGrids(int pageIndex, int pageSize, HashMap<String, String> paramsMap) {
  PageRowBounds rowBounds = new PageRowBounds(pageIndex+1, pageSize);
  SqlSession sqlSession = MybatisHelper.getSqlSession();
  Mapper mapper = (Mapper) sqlSession.getMapper(UUserMapper.class);
  Example example = new Example(UUser.class);
  Example.Criteria criteria = example.createCriteria();
  /*criteria增加條件...*/
  List<UUser> users = (List<UUser>) mapper.selectByExampleAndRowBounds(example, rowBounds);

  /*4.構造適合miniui_grid展示的map*/
  Map<String, Object> map_grid = new HashedMap();
  map_grid.put("total", users.size());
  map_grid.put("data", users);

  return map_grid;
}
 
開發者ID:MiniPa,項目名稱:cjs_ssms,代碼行數:24,代碼來源:SelectController.java

示例5: register

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
/**
 * 注冊
 * JavaBean: User這種的bean會自動返回給前端
 *
 * @param user
 * @param model
 * @param response
 */
@RequestMapping("/register")
public void register(UUser user, Model model, HttpServletResponse response) {
  Map<String, Object> remap = new HashedMap();
  try {
    boolean b = userFService.registerUser(user);
    if (b) {
      log.info("注冊普通用戶" + user.getUsername() + "成功。");
      remap.put("msg", "恭喜您," + user.getUsername() + "注冊成功。");
      HttpRespUtil.respJson(StatusEnum.SUCCESS, remap, response);
    } else {
      remap.put("msg", "用戶名已存在。");
      HttpRespUtil.respJson(StatusEnum.SUCCESS, remap, response);
    }

  } catch (Exception e) {
    log.debug("注冊普通用戶" + user.getUsername() + "異常");
    remap.put("msg","注冊普通用戶異常");
    HttpRespUtil.respJson(StatusEnum.FAIL, remap, response);
    e.printStackTrace();
  }
}
 
開發者ID:MiniPa,項目名稱:cjs_ssms,代碼行數:30,代碼來源:UserFrontController.java

示例6: makeFeatureModelForTesting

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
private  Map<Integer,Map<String,Object>> makeFeatureModelForTesting(DateSeriesDataSetModel ds) {

        Map<Integer,Map<String,Object>> items = new HashMap<>();

        //make a copy
        INDArray features = ds.getDataSet().copy().getFeatureMatrix();

        try {
            List<List<Double>> rows = NDArrayUtils.makeRowsFromNDArray(features,6);
            for (int i = 0; i < rows.size(); i++) {
                List<Double> row = rows.get(i);
                Map<String,Object> itemModel = new HashedMap();
                itemModel.put("seriesNumber",i);
                itemModel.put("seriesData",row);
                itemModel.put("seriesName", ds.getSeriesNames().get(i));
                items.put(i,itemModel);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return items;
    }
 
開發者ID:claytantor,項目名稱:blueweave,代碼行數:24,代碼來源:TimeseriesClassifierNetwork.java

示例7: testSetDetailsWithRootCredentials

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Test
public void testSetDetailsWithRootCredentials() {

    final HostResponse hostResponse = new HostResponse();
    final Map details = new HashMap<>();

    details.put(VALID_KEY, VALID_VALUE);
    details.put("username", "test");
    details.put("password", "password");

    final Map expectedDetails = new HashedMap();
    expectedDetails.put(VALID_KEY, VALID_VALUE);

    hostResponse.setDetails(details);
    final Map actualDetails = hostResponse.getDetails();

    assertTrue(details != actualDetails);
    assertEquals(expectedDetails, actualDetails);
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:20,代碼來源:HostResponseTest.java

示例8: testSetDetailsWithoutRootCredentials

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Test
public void testSetDetailsWithoutRootCredentials() {

    final HostResponse hostResponse = new HostResponse();
    final Map details = new HashMap<>();

    details.put(VALID_KEY, VALID_VALUE);

    final Map expectedDetails = new HashedMap();
    expectedDetails.put(VALID_KEY, VALID_VALUE);

    hostResponse.setDetails(details);
    final Map actualDetails = hostResponse.getDetails();

    assertTrue(details != actualDetails);
    assertEquals(expectedDetails, actualDetails);
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:18,代碼來源:HostResponseTest.java

示例9: getPage

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Request("page/{id}")
public Result getPage(@PathParam("id") Id id, @Context HttpServletRequest request,
    @Context HttpServletResponse response) {
    Content content = contents.findById(Content.class, id);

    app.setViewPath("page/content/view_" + id.str());
    app.setActionURI(request.getRequestURI());


    Map<String, Object> params = new HashedMap();
    if (content.getPreviewProductId() != null) {
        params.put("product", productService.getProduct(content.getPreviewProductId()));
    }

    Result result = freemarkerTemplateStream(content.getTemplate(), params, "3h");
    if (content.getPreviewProductId() != null) {
        result.bind("product", productService.getProduct(content.getPreviewProductId()));
    }
    return result;
}
 
開發者ID:geetools,項目名稱:geeCommerce-Java-Shop-Software-and-PIM,代碼行數:21,代碼來源:ContentController.java

示例10: getProductPage

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Request("product/{id}")
public Result getProductPage(@PathParam("id") Id id, @Context HttpServletRequest request,
                      @Context HttpServletResponse response) {

    Product product = productService.getProduct(id);
    Content content = contents.findById(Content.class, product.getTemplateId());

    app.setViewPath("page/content/view_" + content.getId().str() + "_" + product.getId());
    app.setActionURI(request.getRequestURI());

    Map<String, Object> params = new HashedMap();
    params.put("product", product);
    
    Result result = freemarkerTemplateStream(content.getTemplate(),params, "3h");
    result.bind("product", product);
    return result;
}
 
開發者ID:geetools,項目名稱:geeCommerce-Java-Shop-Software-and-PIM,代碼行數:18,代碼來源:ContentController.java

示例11: alterationsToString

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
private static String alterationsToString(Collection<Alteration> alterations) {
    Map<Gene, Set<String>> mapGeneVariants = new HashedMap();
    for (Alteration alteration : alterations) {
        Gene gene = alteration.getGene();
        Set<String> variants = mapGeneVariants.get(gene);
        if (variants == null) {
            variants = new HashSet<>();
            mapGeneVariants.put(gene, variants);
        }
        variants.add(alteration.getName());
    }

    List<String> list = new ArrayList<>();
    for (Map.Entry<Gene, Set<String>> entry : mapGeneVariants.entrySet()) {
        for (String variant : entry.getValue()) {
            list.add(getGeneMutationNameInVariantSummary(alterations.iterator().next().getGene(), variant));
        }
    }

    String ret = MainUtils.listToString(list, " or ");

    return ret;
}
 
開發者ID:oncokb,項目名稱:oncokb,代碼行數:24,代碼來源:SummaryUtils.java

示例12: serializeSettings

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
private Map<String, Object> serializeSettings() {
	final Map<String, Object> result = new HashedMap();

	result.put("isCourseLetterGradeDisplayed", settings.isCourseLetterGradeDisplayed());
	result.put("isCourseAverageDisplayed", settings.isCourseAverageDisplayed());
	result.put("isCoursePointsDisplayed", settings.isCoursePointsDisplayed());
	result.put("isPointsGradeEntry", GradingType.valueOf(settings.getGradeType()).equals(GradingType.POINTS));
	result.put("isPercentageGradeEntry", GradingType.valueOf(settings.getGradeType()).equals(GradingType.PERCENTAGE));
	result.put("isCategoriesEnabled", GbCategoryType.valueOf(settings.getCategoryType()) != GbCategoryType.NO_CATEGORY);
	result.put("isCategoryTypeWeighted", GbCategoryType.valueOf(settings.getCategoryType()) == GbCategoryType.WEIGHTED_CATEGORY);
	result.put("isStudentOrderedByLastName", uiSettings.getNameSortOrder() == GbStudentNameSortOrder.LAST_NAME);
	result.put("isStudentOrderedByFirstName", uiSettings.getNameSortOrder() == GbStudentNameSortOrder.FIRST_NAME);
	result.put("isGroupedByCategory", uiSettings.isGroupedByCategory());
	result.put("isCourseGradeReleased", settings.isCourseGradeDisplayed());
	result.put("showPoints", uiSettings.getShowPoints());
	result.put("instructor", isInstructor());
	result.put("isStudentNumberVisible", this.isStudentNumberVisible);

	return result;
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:21,代碼來源:GbGradebookData.java

示例13: testHumanReadable

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Test
public void testHumanReadable() {
    // setup
    Map<String, Object> configuration = new HashedMap();
    configuration.put("primitive", 1);
    configuration.put("wrapper", 1);
    configuration.put("object", new CustomObj("Peter"));
    configuration.put("array", new Object[]{"value1", "value2"});
    configuration.put("class", CustomConstraint.class);
    configuration.put("groups", new Class<?>[]{Update.class});
    configuration.put("payload", new Class<?>[0]);
    Constraint constraint = new Constraint("Custom", configuration);

    when(delegate.resolveForProperty("prop", this.getClass()))
            .thenReturn(singletonList(constraint));
    when(delegate.resolveForParameter(any(MethodParameter.class)))
            .thenReturn(singletonList(constraint));

    List<Constraint> constraints = resolver.resolveForProperty("prop", this.getClass());
    assertConstraints(constraints);

    constraints = resolver.resolveForParameter(Mockito.mock(MethodParameter.class));
    assertConstraints(constraints);
}
 
開發者ID:ScaCap,項目名稱:spring-auto-restdocs,代碼行數:25,代碼來源:HumanReadableConstraintResolverTest.java

示例14: doFullTest

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
/**
 * fold: 表示十折交叉驗證的第幾個
 */
public void doFullTest(File rawCorpusDir, File miningDir, boolean raw, boolean esa, boolean espm, boolean espmesa, int fold) {

    Map<String, Double> results = new HashedMap();

    StringBuilder sb = new StringBuilder();
    if (raw) {
        runTask("BoW", rawCorpusDir, miningDir, fold, MyPipe.Type.PURE_BOW);
    }

    if (esa) {
        runTask("ESA", rawCorpusDir, miningDir, fold, MyPipe.Type.PURE_ESA);
        runTask("BoW+ESA", rawCorpusDir, miningDir, fold, MyPipe.Type.BOW_ESA);
    }

    if (espm) {
        runTask("ESPM", rawCorpusDir, miningDir, fold, MyPipe.Type.PURE_ESPM);
        runTask("BoW+ESPM", rawCorpusDir, miningDir, fold, MyPipe.Type.BOW_ESPM);
    }


    if (espmesa) {
        runTask("ESPM+ESA", rawCorpusDir, miningDir, fold, MyPipe.Type.PURE_ESPM_ESA);
        runTask("BoW+ESPM+ESA", rawCorpusDir, miningDir, fold, MyPipe.Type.BOW_ESPM_ESA);
    }
}
 
開發者ID:iamxiatian,項目名稱:wikit,代碼行數:29,代碼來源:EspmClassify.java

示例15: calculateByPackage

import org.apache.commons.collections.map.HashedMap; //導入依賴的package包/類
@Deprecated
public Map<String, NGrams> calculateByPackage(List<CtType<?>> all) throws JSAPException {

	Map<String, NGrams> result = new HashedMap();
	IngredientProcessor ingp = new IngredientProcessor<>(ingredientProcessor);
	int allElements = 0;

	for (CtType<?> ctType : all) {
		NGrams ns = new NGrams();
		CtPackage parent = (CtPackage) ctType.getParent(CtPackage.class);
		if (!result.containsKey(parent.getQualifiedName())) {
			allElements += getNGramsFromCodeElements(parent, ns, ingp);
			result.put(parent.getQualifiedName(), ns);
		}
	}
	logger.debug("allElements " + allElements);
	return result;
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:19,代碼來源:GramProcessor.java


注:本文中的org.apache.commons.collections.map.HashedMap類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。