本文整理汇总了Java中android.support.v4.util.ArrayMap.entrySet方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayMap.entrySet方法的具体用法?Java ArrayMap.entrySet怎么用?Java ArrayMap.entrySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.util.ArrayMap
的用法示例。
在下文中一共展示了ArrayMap.entrySet方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addJavaObjects
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public JsInterfaceHolder addJavaObjects(ArrayMap<String, Object> maps) {
if(!checkSecurity()){
LogUtils.i(TAG,"The injected object is not safe, give up injection");
return this;
}
LogUtils.i(TAG,"inject set:"+maps.size());
Set<Map.Entry<String, Object>> sets = maps.entrySet();
for (Map.Entry<String, Object> mEntry : sets) {
Object v = mEntry.getValue();
boolean t = checkObject(v);
if (!t)
throw new JsInterfaceObjectException("this object has not offer method javascript to call ,please check addJavascriptInterface annotation was be added");
else
addJavaObjectDirect(mEntry.getKey(), v);
}
return this;
}
示例2: addJavaObjects
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public JsInterfaceHolder addJavaObjects(ArrayMap<String, Object> maps) {
if(!checkSecurity()){
return this;
}
Set<Map.Entry<String, Object>> sets = maps.entrySet();
for (Map.Entry<String, Object> mEntry : sets) {
Object v = mEntry.getValue();
boolean t = checkObject(v);
if (!t)
throw new JsInterfaceObjectException("this object has not offer method javascript to call ,please check addJavascriptInterface annotation was be added");
else
addJavaObjectDirect(mEntry.getKey(), v);
}
return this;
}
示例3: onBindViewHolder
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.tvTitle.setText(mMap.keyAt(position));
holder.flContent.removeAllViews();
ArrayMap<String,String> mNodeBlock = mMap.valueAt(position);
for (ArrayMap.Entry<String,String> node : mNodeBlock.entrySet()) {
TextView tvNode = new TextView(mContext);
tvNode.setText(node.getValue());
tvNode.setTextColor(ContextCompat.getColor(mContext, R.color.colorText));
tvNode.setPadding(SystemUtil.dp2px(6f), SystemUtil.dp2px(6f), SystemUtil.dp2px(6f), SystemUtil.dp2px(6f));
tvNode.setOnClickListener(new OnNodeClickListener(node.getKey()));
holder.flContent.addView(tvNode);
}
}
示例4: composeNavigationUri
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
public static Uri composeNavigationUri(String schemeString, String host, String path, ArrayMap<String, String> extras)
{
StringBuilder builder = new StringBuilder(schemeString).append("://").append(host);
if(!TextUtils.isEmpty(path))
{
builder.append("/").append(path);
}
if(extras != null && extras.size() > 0)
{
builder.append("?");
for(Entry<String, String> entry : extras.entrySet())
{
if(entry == null) continue;
builder.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
}
}
String result = builder.toString();
if(result.endsWith("?") || result.endsWith("&"))
{
result = result.substring(0, result.length() - 1);
}
return Uri.parse(result);
}
示例5: parseItemName
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
public static String parseItemName(ZabbixItem item) {
String itemName = item.getName();
// parse item key
// key is presented in next format: <keyId>[<keyArg1>, <keyArg2>, ...]
final String keyString = item.getKey();
String[] keys = keyString.substring(keyString.indexOf('[') + 1,
keyString.lastIndexOf(']')).split(",");
ArrayMap<String, String> argToValueMap = new ArrayMap<String, String>();
final Matcher argMatcher = STTR_PATTERN.matcher(itemName);
while (argMatcher.find()) {
final String argument = itemName.substring(argMatcher.start(),
argMatcher.end());
final String argumentNumber = argument.replace("$", "");
// arguments starts from 1
final String value = keys[Integer.valueOf(argumentNumber) - 1];
argToValueMap.put(argument, value);
}
for (Entry<String, String> entry : argToValueMap.entrySet()) {
itemName = itemName
.replace(entry.getKey(), entry.getValue().trim());
}
return itemName;
}
示例6: onResult
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Override
public void onResult(Object result) {
Log.d("k9res", "onResult: " + result.toString());
if (result.toString().equalsIgnoreCase("swiped_down")) {
//do something or nothing
} else {
if (result != null) {
ArrayMap<String, List<String>> applied_filters = (ArrayMap<String, List<String>>) result;
if (applied_filters.size() != 0) {
List<SingleMovie> filteredList = mData.getAllMovies();
//iterate over arraymap
for (Map.Entry<String, List<String>> entry : applied_filters.entrySet()) {
Log.d("k9res", "entry.key: " + entry.getKey());
switch (entry.getKey()) {
case "genre":
filteredList = mData.getGenreFilteredMovies(entry.getValue(), filteredList);
break;
case "rating":
filteredList = mData.getRatingFilteredMovies(entry.getValue(), filteredList);
break;
case "year":
filteredList = mData.getYearFilteredMovies(entry.getValue(), filteredList);
break;
case "quality":
filteredList = mData.getQualityFilteredMovies(entry.getValue(), filteredList);
break;
}
}
Log.d("k9res", "new size: " + filteredList.size());
mList.clear();
mList.addAll(filteredList);
mAdapter.notifyDataSetChanged();
} else {
mList.addAll(mData.getAllMovies());
mAdapter.notifyDataSetChanged();
}
}
//handle result
}
}
示例7: settingsShouldBeNullIfNotChanged
import android.support.v4.util.ArrayMap; //导入方法依赖的package包/类
@Test
public void settingsShouldBeNullIfNotChanged() {
ArrayMap<String,String> testArrayMap = fattsSetting.getSpecs();
for (ArrayMap.Entry<String,String> entry : testArrayMap.entrySet()) {
assertEquals(entry.getValue(), null);
}
}