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

Java Tags类代码示例

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

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



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

示例1: addTagsFilter

import com.google.samples.apps.iosched.provider.ScheduleContract.Tags; //导入依赖的package包/类
/** Adds the tags filter query parameter to the given builder. */
private void addTagsFilter(SelectionBuilder builder, String tagsFilter) {
    // Note: for context, remember that session queries are done on a join of sessions
    // and the sessions_tags relationship table, and are GROUP'ed BY the session ID.
    String[] requiredTags = tagsFilter.split(",");
    if (requiredTags.length == 0) {
        // filtering by 0 tags -- no-op
        return;
    } else if (requiredTags.length == 1) {
        // filtering by only one tag, so a simple WHERE clause suffices
        builder.where(Tags.TAG_ID + "=?", requiredTags[0]);
    } else {
        // Filtering by multiple tags, so we must add a WHERE clause with an IN operator,
        // and add a HAVING statement to exclude groups that fall short of the number
        // of required tags. For example, if requiredTags is { "X", "Y", "Z" }, and a certain
        // session only has tags "X" and "Y", it will be excluded by the HAVING statement.
        String questionMarkTuple = makeQuestionMarkTuple(requiredTags.length);
        builder.where(Tags.TAG_ID + " IN " + questionMarkTuple, requiredTags);
        builder.having("COUNT(" + Qualified.SESSIONS_SESSION_ID + ") >= " + requiredTags.length);
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:22,代码来源:ScheduleProvider.java


示例2: addTagsFilter

import com.google.samples.apps.iosched.provider.ScheduleContract.Tags; //导入依赖的package包/类
/**
 * Adds the {@code tagsFilter} query parameter to the given {@code builder}. This query
 * parameter is used by the {@link com.google.samples.apps.iosched.explore.ExploreSessionsActivity}
 * when the user makes a selection containing multiple filters.
 */
private void addTagsFilter(SelectionBuilder builder, String tagsFilter, String numCategories) {
    // Note: for context, remember that session queries are done on a join of sessions
    // and the sessions_tags relationship table, and are GROUP'ed BY the session ID.
    String[] requiredTags = tagsFilter.split(",");
    if (requiredTags.length == 0) {
        // filtering by 0 tags -- no-op
        return;
    } else if (requiredTags.length == 1) {
        // filtering by only one tag, so a simple WHERE clause suffices
        builder.where(Tags.TAG_ID + "=?", requiredTags[0]);
    } else {
        // Filtering by multiple tags, so we must add a WHERE clause with an IN operator,
        // and add a HAVING statement to exclude groups that fall short of the number
        // of required tags. For example, if requiredTags is { "X", "Y", "Z" }, and a certain
        // session only has tags "X" and "Y", it will be excluded by the HAVING statement.
        int categories = 1;
        if (numCategories != null && TextUtils.isDigitsOnly(numCategories)) {
            try {
                categories = Integer.parseInt(numCategories);
                LOGD(TAG, "Categories being used " + categories);
            } catch (Exception ex) {
                LOGE(TAG, "exception parsing categories ", ex);
            }
        }
        String questionMarkTuple = makeQuestionMarkTuple(requiredTags.length);
        builder.where(Tags.TAG_ID + " IN " + questionMarkTuple, requiredTags);
        builder.having(
                "COUNT(" + Qualified.SESSIONS_SESSION_ID + ") >= " + categories);
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:36,代码来源:ScheduleProvider.java


示例3: performQuery

import com.google.samples.apps.iosched.provider.ScheduleContract.Tags; //导入依赖的package包/类
@Override
public Cursor performQuery(@NonNull CursorModelLoader<TagMetadata> loader,
        @NonNull CancellationSignal cancellationSignal) {
    return ContentResolverCompat.query(loader.getContext().getContentResolver(),
            Tags.CONTENT_URI, TagMetadata.TAGS_PROJECTION, null, null, null,
            cancellationSignal);
}
 
开发者ID:google,项目名称:iosched,代码行数:8,代码来源:TagMetadataCursorTransform.java


示例4: addTagsFilter

import com.google.samples.apps.iosched.provider.ScheduleContract.Tags; //导入依赖的package包/类
/**
 * Adds the {@code tagsFilter} query parameter to the given {@code builder}. This query
 * parameter is used when the user makes a selection containing multiple filters.
 */
private void addTagsFilter(SelectionBuilder builder, String tagsFilter, String numCategories) {
    // Note: for context, remember that session queries are done on a join of sessions
    // and the sessions_tags relationship table, and are GROUP'ed BY the session ID.
    String[] requiredTags = tagsFilter.split(",");
    if (requiredTags.length == 0) {
        // filtering by 0 tags -- no-op
        return;
    } else if (requiredTags.length == 1) {
        // filtering by only one tag, so a simple WHERE clause suffices
        builder.where(Tags.TAG_ID + "=?", requiredTags[0]);
    } else {
        // Filtering by multiple tags, so we must add a WHERE clause with an IN operator,
        // and add a HAVING statement to exclude groups that fall short of the number
        // of required tags. For example, if requiredTags is { "X", "Y", "Z" }, and a certain
        // session only has tags "X" and "Y", it will be excluded by the HAVING statement.
        int categories = 1;
        if (numCategories != null && TextUtils.isDigitsOnly(numCategories)) {
            try {
                categories = Integer.parseInt(numCategories);
                LOGD(TAG, "Categories being used " + categories);
            } catch (Exception ex) {
                LOGE(TAG, "exception parsing categories ", ex);
            }
        }
        String questionMarkTuple = makeQuestionMarkTuple(requiredTags.length);
        builder.where(Tags.TAG_ID + " IN " + questionMarkTuple, requiredTags);
        builder.having(
                "COUNT(" + Qualified.SESSIONS_SESSION_ID + ") >= " + categories);
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:35,代码来源:ScheduleProvider.java


示例5: getObserverUri

import com.google.samples.apps.iosched.provider.ScheduleContract.Tags; //导入依赖的package包/类
@Override
public Uri getObserverUri(@NonNull CursorModelLoader<TagMetadata> loader) {
    return Tags.CONTENT_URI;
}
 
开发者ID:google,项目名称:iosched,代码行数:5,代码来源:TagMetadataCursorTransform.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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