本文整理汇总了Java中java.util.LinkedHashMap.get方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedHashMap.get方法的具体用法?Java LinkedHashMap.get怎么用?Java LinkedHashMap.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.LinkedHashMap
的用法示例。
在下文中一共展示了LinkedHashMap.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchLucene
import java.util.LinkedHashMap; //导入方法依赖的package包/类
public Hits searchLucene(LinkedHashMap<String, Object> params, Sort[] sorts, int start, int end,
SearchContext searchContext) throws ParseException, SearchException {
String keywords = (String) params.get(Field.KEYWORD_SEARCH);
String groupId = (String) params.get(Field.GROUP_ID);
Indexer<Registration> indexer = IndexerRegistryUtil.nullSafeGetIndexer(Registration.class);
searchContext.addFullQueryEntryClassName(CLASS_NAME);
searchContext.setEntryClassNames(new String[] { CLASS_NAME });
searchContext.setAttribute("paginationType", "regular");
searchContext.setLike(true);
searchContext.setStart(start);
searchContext.setEnd(end);
searchContext.setAndSearch(true);
searchContext.setSorts(sorts);
BooleanQuery booleanQuery = null;
if (Validator.isNotNull(keywords)) {
booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
} else {
booleanQuery = indexer.getFullQuery(searchContext);
}
if (Validator.isNotNull(groupId)) {
MultiMatchQuery query = new MultiMatchQuery(groupId);
query.addFields(Field.GROUP_ID);
booleanQuery.add(query, BooleanClauseOccur.MUST);
}
booleanQuery.addRequiredTerm(Field.ENTRY_CLASS_NAME, CLASS_NAME);
return IndexSearcherHelperUtil.search(searchContext, booleanQuery);
}
示例2: populateInputStream
import java.util.LinkedHashMap; //导入方法依赖的package包/类
private InputStream populateInputStream(ArrayList<LinkedHashMap> linkedMap){
InputStream newInputStream = new InputStream();
for(LinkedHashMap hashmap : linkedMap){
switch((String)hashmap.get("rel")){
case "Type":
newInputStream.setType((String)hashmap.get("val"));
break;
case "Input_Stream_UUID":
newInputStream.setInputStream((String)hashmap.get("val"));
break;
case "DeviceUUID":
newInputStream.setDeviceUUID((String)hashmap.get("val"));
break;
}
}
return newInputStream;
}
示例3: setGeolocation
import java.util.LinkedHashMap; //导入方法依赖的package包/类
/**
* Methods to deal with nested TagEvent JSON structure. Jackson black magic can deal with it using
* annotations. So some attributes have to be deserialized in an alternative way.
* @param geolocation
*/
@JsonSetter("geolocation")
public void setGeolocation(LinkedHashMap geolocation) {
try {
if (geolocation.containsKey("zone"))
this.geoZone= geolocation.get("zone").toString();
if (geolocation.containsKey("latitude"))
this.latitude= Double.parseDouble(geolocation.get("latitude").toString());
if (geolocation.containsKey("longitude"))
this.longitude= Double.parseDouble(geolocation.get("longitude").toString());
if (geolocation.containsKey("region") && geolocation.get("region") instanceof LinkedHashMap) {
LinkedHashMap<String, String> region= (LinkedHashMap) geolocation.get("region");
if (region.containsKey("country"))
this.geoRegionCountry= region.get("country").toString();
if (region.containsKey("locality"))
this.geoRegionLocality= region.get("locality").toString();
}
} catch (Exception ex) {
log.error("Unable to parse the TagEvent(geolocation): " + geolocation + ", Exception: " + ex.getMessage());
}
}
示例4: postProcessSearchQuery
import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public void postProcessSearchQuery(BooleanQuery searchQuery,
BooleanFilter fullQueryBooleanFilter, SearchContext searchContext)
throws Exception {
addSearchTerm(searchQuery, searchContext, "data", false);
LinkedHashMap<String, Object> params = (LinkedHashMap<String, Object>) searchContext
.getAttribute("params");
if (params != null) {
String expandoAttributes = (String) params.get("expandoAttributes");
if (Validator.isNotNull(expandoAttributes)) {
addSearchExpando(searchQuery, searchContext, expandoAttributes);
}
}
}
示例5: postProcessSearchQuery
import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter,
SearchContext searchContext) throws Exception {
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.WORKINGUNIT_ID, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.GROUP_ID, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.COMPANY_ID, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.USER_ID, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.USER_NAME, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.CREATE_DATE, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.MODIFIED_DATE, false);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.NAME, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.ENNAME, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.GOV_AGENCY_CODE, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.PARENT_WORKING_UNIT_ID, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.SIBLING, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.TREEINDEX, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.ADDRESS, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.TEL_NO, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.FAX_NO, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.EMAIL, true);
addSearchTerm(searchQuery, searchContext, WorkingUnitTerm.WEBSITE, true);
@SuppressWarnings("unchecked")
LinkedHashMap<String, Object> params = (LinkedHashMap<String, Object>) searchContext.getAttribute("params");
if (params != null) {
String expandoAttributes = (String) params.get("expandoAttributes");
if (Validator.isNotNull(expandoAttributes)) {
addSearchExpando(searchQuery, searchContext, expandoAttributes);
}
}
}
示例6: countLucense
import java.util.LinkedHashMap; //导入方法依赖的package包/类
public long countLucense(LinkedHashMap<String, Object> params, Sort[] sorts, int start, int end,
SearchContext searchContext) throws ParseException, SearchException {
String keywords = (String) params.get(Field.KEYWORD_SEARCH);
String groupId = (String) params.get(Field.GROUP_ID);
Indexer<Registration> indexer = IndexerRegistryUtil.nullSafeGetIndexer(Registration.class);
searchContext.addFullQueryEntryClassName(CLASS_NAME);
searchContext.setEntryClassNames(new String[] { CLASS_NAME });
searchContext.setAttribute("paginationType", "regular");
searchContext.setLike(true);
searchContext.setAndSearch(true);
BooleanQuery booleanQuery = null;
if (Validator.isNotNull(keywords)) {
booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
} else {
booleanQuery = indexer.getFullQuery(searchContext);
}
if (Validator.isNotNull(groupId)) {
MultiMatchQuery query = new MultiMatchQuery(groupId);
query.addFields(Field.GROUP_ID);
booleanQuery.add(query, BooleanClauseOccur.MUST);
}
booleanQuery.addRequiredTerm(Field.ENTRY_CLASS_NAME, CLASS_NAME);
return IndexSearcherHelperUtil.searchCount(searchContext, booleanQuery);
}
示例7: recreateFolderHierarchy
import java.util.LinkedHashMap; //导入方法依赖的package包/类
private void recreateFolderHierarchy(LinkedHashMap<Long, Bookmark> idMap) {
for (Bookmark bookmark : idMap.values()) {
if (bookmark.mId == ROOT_FOLDER_ID) continue;
// Look for invalid parent ids and self-cycles.
if (!idMap.containsKey(bookmark.mParentId) || bookmark.mParentId == bookmark.mId) {
bookmark.mParent = idMap.get(ROOT_FOLDER_ID);
bookmark.mParent.mEntries.add(bookmark);
continue;
}
bookmark.mParent = idMap.get(bookmark.mParentId);
bookmark.mParent.mEntries.add(bookmark);
}
}
示例8: resetStyle
import java.util.LinkedHashMap; //导入方法依赖的package包/类
public void resetStyle() {
LinkedHashMap<String, StyleProperties> styles = mAppRunner.pUi.getStyles();
fromTo(styles.get("*"), props);
StyleProperties p = styles.get(viewName);
MLog.d("qq", "viewname " + viewName);
if (p != null) {
MLog.d(TAG, "" + p.size());
MLog.d(TAG, "applying view specific style for " + viewName);
fromTo(p, props);
}
}
示例9: jackJsonTest
import java.util.LinkedHashMap; //导入方法依赖的package包/类
/**
* jackson解析Map
*/
private void jackJsonTest(){
LinkedHashMap<CategoryEntity, List<CategoryEntity>> linkedHashMap = createMap();
String json = JacksonUtil.getInstance().toJson(linkedHashMap);
LOG.D(TAG, "jackJson = " + json);
LinkedHashMap<CategoryEntity, List<CategoryEntity>> parseMap = JacksonUtil.getInstance().fromJson(
json,
new com.fasterxml.jackson.core.type.TypeReference<LinkedHashMap<CategoryEntity,List<CategoryEntity>>>() {});
LOG.D(TAG, "parse map = " + parseMap.toString());
List<CategoryEntity> categoryEntityList = parseMap.get(new CategoryEntity("121", "厨房用品", false));
LOG.D(TAG, "jackson list = " + categoryEntityList.toString());
}
示例10: BSONObject
import java.util.LinkedHashMap; //导入方法依赖的package包/类
public BSONObject(String BSONString) throws BSONException {
this.bson = new LinkedHashMap<String, Object>();
BSONString bs = new BSONString();
LinkedHashMap<String, Object> map = bs.getBSON(BSONString);
String msg = (String) map.get(BSON.TAG_MSG);
if (msg.equals(BSON.MSG_BSON)) {
String tag = (String) map.get(BSON.TAG_KEY);
String value = (String) map.get(BSON.TAG_VALUE);
LinkedHashMap<String, Object> hm = bs.getValue(value);
bson.put(tag, hm.get(BSON.TAG_VALUE));
} else if (msg.equals(BSON.MSG_BSON_ARRAY)) {
map.remove(BSON.TAG_MSG);
Iterator<Entry<String, Object>> iter = map.entrySet().iterator();
while (iter.hasNext()) {
Entry<String, Object> entry = (Entry<String, Object>) iter.next();
bson.put(entry.getKey(), entry.getValue());
}
} else if (msg.equals(BSON.MSG_BSON_EMPTY)) {
BSON.Warn(BSON.MSG_BSON_EMPTY);
} else if (msg.equals(BSON.MSG_ERROR_NOTBSON)) {
throw new BSONException(msg);
} else if (msg.equals(BSON.MSG_ERROR_EMPTY)) {
throw new BSONException(msg);
} else {
throw new BSONException(BSON.MSG_ERROR_UNKNOW);
}
}
示例11: populateCPUForDevice
import java.util.LinkedHashMap; //导入方法依赖的package包/类
private void populateCPUForDevice(Device deviceToPopulate, ArrayList<LinkedHashMap> linkedMap){
for(LinkedHashMap hashmap : linkedMap){
switch((String)hashmap.get("rel")){
case "CPUUtil":
deviceToPopulate.setCpuUtil(Float.parseFloat((String)hashmap.get("val")));
break;
}
}
}
示例12: getParameterFromResult
import java.util.LinkedHashMap; //导入方法依赖的package包/类
/**
* Get the result from the specified generator
*
* @param generatorName
* @return
*/
private Object getParameterFromResult(String generatorName, LinkedHashMap<String, Object> genResults) {
for(String s : genResults.keySet()) {
if(s.equals(generatorName)) {
return genResults.get(s);
}
}
throw new Error("There are no results for the "+generatorName);
}
示例13: MediaType
import java.util.LinkedHashMap; //导入方法依赖的package包/类
protected MediaType(String type, String subtype,
LinkedHashMap<String,String> parameters) {
this.type = type;
this.subtype = subtype;
this.parameters = parameters;
String cs = parameters.get("charset");
if (cs != null && cs.length() > 0 &&
cs.charAt(0) == '"') {
cs = HttpParser.unquote(cs);
}
this.charset = cs;
}
示例14: expectRead
import java.util.LinkedHashMap; //导入方法依赖的package包/类
private void expectRead(LinkedHashMap<String, byte[]> serializedValues,
Map<String, Struct> deserializedValues) {
expectReadToEnd(serializedValues);
for (Map.Entry<String, Struct> deserializedValueEntry : deserializedValues.entrySet()) {
byte[] serializedValue = serializedValues.get(deserializedValueEntry.getKey());
EasyMock.expect(converter.toConnectData(EasyMock.eq(TOPIC), EasyMock.aryEq(serializedValue)))
.andReturn(new SchemaAndValue(null, structToMap(deserializedValueEntry.getValue())));
}
}
示例15: postProcessSearchQuery
import java.util.LinkedHashMap; //导入方法依赖的package包/类
@Override
public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter,
SearchContext searchContext) throws Exception {
@SuppressWarnings("unchecked")
LinkedHashMap<String, Object> params = (LinkedHashMap<String, Object>) searchContext.getAttribute("params");
if (params != null) {
String expandoAttributes = (String) params.get("expandoAttributes");
if (Validator.isNotNull(expandoAttributes)) {
addSearchExpando(searchQuery, searchContext, expandoAttributes);
}
}
}