本文整理匯總了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);
}
}