• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SimpleStringSplitter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.text.TextUtils.SimpleStringSplitter的典型用法代码示例。如果您正苦于以下问题:Java SimpleStringSplitter类的具体用法?Java SimpleStringSplitter怎么用?Java SimpleStringSplitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SimpleStringSplitter类属于android.text.TextUtils包,在下文中一共展示了SimpleStringSplitter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isEnableAutoInstall

import android.text.TextUtils.SimpleStringSplitter; //导入依赖的package包/类
public static boolean isEnableAutoInstall() {
	Context mContext = AutoInstallerContext.getContext();
	SimpleStringSplitter simpleStringSplitter = new SimpleStringSplitter(':');
	if (!SettingsUtil.isAccessibiltiyEnable(mContext)) {
		return false;
	}
	String string = Secure.getString(mContext.getContentResolver(), "enabled_accessibility_services");
	if (string == null) {
		return false;
	}
	simpleStringSplitter.setString(string);
	while (simpleStringSplitter.hasNext()) {
		if (simpleStringSplitter.next().equalsIgnoreCase(
				AutoInstallerContext.getTargetService())) {
			return true;
		}
	}
	return false;
}
 
开发者ID:bunnyblue,项目名称:ApkAutoInstaller,代码行数:20,代码来源:InstallerUtils.java


示例2: loadStopLocations

import android.text.TextUtils.SimpleStringSplitter; //导入依赖的package包/类
void loadStopLocations(String routeNum, HashMap<Integer, LTCStop> stops) throws ScrapeException, IOException {
    StringBuilder builder = new StringBuilder(8192);
    String line;
    URL url;
    HttpURLConnection connection;
    boolean try_proxy = PROXY_ENABLED;
    while (true) {
        try {
            if (try_proxy) {
                url = new URL(String.format(PROXY_BASE + LOCATIONS_PATH, routeNum));
                connection = (HttpURLConnection) url.openConnection();
            } else {
                url = new URL(String.format(LTC_BASE + LOCATIONS_PATH, routeNum));
                connection = (HttpURLConnection) url.openConnection();
            }
            connection.setConnectTimeout(MAXIMUM_FETCH_TIMEOUT);
            connection.setReadTimeout(MAXIMUM_FETCH_TIMEOUT);
            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            while ((line = reader.readLine()) != null) {
                builder.append(line);
            }
            int offset = 0;
            String stopData = builder.toString();
            // skip past the crap at the start by finding the 1st asterisk
            for (int i = 0; i < 1; ++i) {
                offset = stopData.indexOf('*', offset) + 1;
            }
            /* get the interesting part, and while we're at it, remove all asterisks
     * so we don't have to deal with them at the start of latitudes later
     */
            String actualStopText = stopData.substring(offset).replace("*", "");
            StringSplitter splitter = new SimpleStringSplitter(';');
            splitter.setString(actualStopText);
            for (String stopInfo : splitter) {
                String elems[] = stopInfo.split("\\|");
                if (elems.length == 7) {
                    double latitude = Double.valueOf(elems[0]);
                    double longitude = Double.valueOf(elems[1]);
                    Matcher stopNumMatch = LOCATION_STOP_PATTERN.matcher(elems[4]);
                    if (stopNumMatch.find()) {
                        int stopNum = Integer.valueOf(stopNumMatch.group(1));
                        LTCStop stop = stops.get(stopNum);
                        if (stop != null) {
                            stop.latitude = latitude;
                            stop.longitude = longitude;
                        }
                    }
                }
            }
            connection.disconnect();
            return;
        } catch (SocketException e) {
            if (try_proxy) {
                try_proxy = false;
                continue;
            }
            // if this is already not the proxy, give up
            throw e;
        }
    }
}
 
开发者ID:LTBuses,项目名称:LTB-android,代码行数:62,代码来源:LTCScraper.java


示例3: iterator

import android.text.TextUtils.SimpleStringSplitter; //导入依赖的package包/类
@Override
public Iterator<String> iterator() {
          SimpleStringSplitter splitter = new SimpleStringSplitter(',');
          splitter.setString(value);
          return splitter.iterator();
      }
 
开发者ID:devscitech1,项目名称:aakash-fdroid-client,代码行数:7,代码来源:DB.java


示例4: iterator

import android.text.TextUtils.SimpleStringSplitter; //导入依赖的package包/类
@Override
public Iterator<String> iterator() {
	SimpleStringSplitter splitter = new SimpleStringSplitter(',');
	splitter.setString(value);
	return splitter.iterator();
}
 
开发者ID:keensam04,项目名称:aakash_bazaar_client,代码行数:7,代码来源:DB.java



注:本文中的android.text.TextUtils.SimpleStringSplitter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimpleIRIMapper类代码示例发布时间:2022-05-22
下一篇:
Java PrettyXmlSerializer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap