当前位置: 首页>>代码示例>>Java>>正文


Java Speaker类代码示例

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


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

示例1: buildSpeaker

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
private void buildSpeaker(boolean isInsert, Speaker speaker,
                          ArrayList<ContentProviderOperation> list) {
    Uri allSpeakersUri = ScheduleContractHelper.setUriAsCalledFromSyncAdapter(
            ScheduleContract.Speakers.CONTENT_URI);
    Uri thisSpeakerUri = ScheduleContractHelper.setUriAsCalledFromSyncAdapter(
            ScheduleContract.Speakers.buildSpeakerUri(speaker.id));

    ContentProviderOperation.Builder builder;
    if (isInsert) {
        builder = ContentProviderOperation.newInsert(allSpeakersUri);
    } else {
        builder = ContentProviderOperation.newUpdate(thisSpeakerUri);
    }

    list.add(builder.withValue(ScheduleContract.SyncColumns.UPDATED, System.currentTimeMillis())
            .withValue(ScheduleContract.Speakers.SPEAKER_ID, speaker.id)
            .withValue(ScheduleContract.Speakers.SPEAKER_NAME, speaker.name)
            .withValue(ScheduleContract.Speakers.SPEAKER_ABSTRACT, speaker.bio)
            .withValue(ScheduleContract.Speakers.SPEAKER_COMPANY, speaker.company)
            .withValue(ScheduleContract.Speakers.SPEAKER_IMAGE_URL, speaker.thumbnailUrl)
            .withValue(ScheduleContract.Speakers.SPEAKER_PLUSONE_URL, speaker.plusoneUrl)
            .withValue(ScheduleContract.Speakers.SPEAKER_TWITTER_URL, speaker.twitterUrl)
            .withValue(ScheduleContract.Speakers.SPEAKER_IMPORT_HASHCODE,
                    speaker.getImportHashcode())
            .build());
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:27,代码来源:SpeakersHandler.java

示例2: buildSpeaker

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
private void buildSpeaker(boolean isInsert, Speaker speaker,
                          ArrayList<ContentProviderOperation> list) {
    Uri allSpeakersUri = ScheduleContract.addCallerIsSyncAdapterParameter(
            ScheduleContract.Speakers.CONTENT_URI);
    Uri thisSpeakerUri = ScheduleContract.addCallerIsSyncAdapterParameter(
            ScheduleContract.Speakers.buildSpeakerUri(speaker.id));

    ContentProviderOperation.Builder builder;
    if (isInsert) {
        builder = ContentProviderOperation.newInsert(allSpeakersUri);
    } else {
        builder = ContentProviderOperation.newUpdate(thisSpeakerUri);
    }

    list.add(builder.withValue(ScheduleContract.SyncColumns.UPDATED, System.currentTimeMillis())
            .withValue(ScheduleContract.Speakers.SPEAKER_ID, speaker.id)
            .withValue(ScheduleContract.Speakers.SPEAKER_NAME, speaker.name)
            .withValue(ScheduleContract.Speakers.SPEAKER_ABSTRACT, speaker.bio)
            .withValue(ScheduleContract.Speakers.SPEAKER_COMPANY, speaker.company)
            .withValue(ScheduleContract.Speakers.SPEAKER_IMAGE_URL, speaker.thumbnailUrl)
            .withValue(ScheduleContract.Speakers.SPEAKER_URL, speaker.plusoneUrl)
            .withValue(ScheduleContract.Speakers.SPEAKER_IMPORT_HASHCODE,
                    speaker.getImportHashcode())
            .build());
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:26,代码来源:SpeakersHandler.java

示例3: setSpeakerMap

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
public void setSpeakerMap(HashMap<String, Speaker> speakerMap) {
    mSpeakerMap = speakerMap;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:4,代码来源:SessionsHandler.java

示例4: process

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
@Override
public void process(JsonElement element) {
    for (Speaker speaker : new Gson().fromJson(element, Speaker[].class)) {
        mSpeakers.put(speaker.id, speaker);
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:7,代码来源:SpeakersHandler.java

示例5: makeContentProviderOperations

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
@Override
public void makeContentProviderOperations(ArrayList<ContentProviderOperation> list) {
    Uri uri = ScheduleContractHelper.setUriAsCalledFromSyncAdapter(
            ScheduleContract.Speakers.CONTENT_URI);
    HashMap<String, String> speakerHashcodes = loadSpeakerHashcodes();
    HashSet<String> speakersToKeep = new HashSet<String>();
    boolean isIncrementalUpdate = speakerHashcodes != null && speakerHashcodes.size() > 0;

    if (isIncrementalUpdate) {
        LOGD(TAG, "Doing incremental update for speakers.");
    } else {
        LOGD(TAG, "Doing FULL (non incremental) update for speakers.");
        list.add(ContentProviderOperation.newDelete(uri).build());
    }

    int updatedSpeakers = 0;
    for (Speaker speaker : mSpeakers.values()) {
        String hashCode = speaker.getImportHashcode();
        speakersToKeep.add(speaker.id);

        // add speaker, if necessary
        if (!isIncrementalUpdate || !speakerHashcodes.containsKey(speaker.id) ||
                !speakerHashcodes.get(speaker.id).equals(hashCode)) {
            ++updatedSpeakers;
            boolean isNew = !isIncrementalUpdate || !speakerHashcodes.containsKey(speaker.id);
            buildSpeaker(isNew, speaker, list);
        }
    }

    int deletedSpeakers = 0;
    if (isIncrementalUpdate) {
        for (String speakerId : speakerHashcodes.keySet()) {
            if (!speakersToKeep.contains(speakerId)) {
                buildDeleteOperation(speakerId, list);
                ++deletedSpeakers;
            }
        }
    }

    LOGD(TAG, "Speakers: " + (isIncrementalUpdate ? "INCREMENTAL" : "FULL") + " update. " +
            updatedSpeakers + " to update, " + deletedSpeakers + " to delete. New total: " +
            mSpeakers.size());
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:44,代码来源:SpeakersHandler.java

示例6: getSpeakerMap

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
public HashMap<String, Speaker> getSpeakerMap() {
    return mSpeakers;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:4,代码来源:SpeakersHandler.java

示例7: makeContentProviderOperations

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
@Override
public void makeContentProviderOperations(ArrayList<ContentProviderOperation> list) {
    Uri uri = ScheduleContract.addCallerIsSyncAdapterParameter(
            ScheduleContract.Speakers.CONTENT_URI);
    HashMap<String, String> speakerHashcodes = loadSpeakerHashcodes();
    HashSet<String> speakersToKeep = new HashSet<String>();
    boolean isIncrementalUpdate = speakerHashcodes != null && speakerHashcodes.size() > 0;

    if (isIncrementalUpdate) {
        LOGD(TAG, "Doing incremental update for speakers.");
    } else {
        LOGD(TAG, "Doing FULL (non incremental) update for speakers.");
        list.add(ContentProviderOperation.newDelete(uri).build());
    }

    int updatedSpeakers = 0;
    for (Speaker speaker : mSpeakers.values()) {
        String hashCode = speaker.getImportHashcode();
        speakersToKeep.add(speaker.id);

        // add speaker, if necessary
        if (!isIncrementalUpdate || !speakerHashcodes.containsKey(speaker.id) ||
                !speakerHashcodes.get(speaker.id).equals(hashCode)) {
            ++updatedSpeakers;
            boolean isNew = !isIncrementalUpdate || !speakerHashcodes.containsKey(speaker.id);
            buildSpeaker(isNew, speaker, list);
        }
    }

    int deletedSpeakers = 0;
    if (isIncrementalUpdate) {
        for (String speakerId : speakerHashcodes.keySet()) {
            if (!speakersToKeep.contains(speakerId)) {
                buildDeleteOperation(speakerId, list);
                ++deletedSpeakers;
            }
        }
    }

    LOGD(TAG, "Speakers: " + (isIncrementalUpdate ? "INCREMENTAL" : "FULL") + " update. " +
            updatedSpeakers + " to update, " + deletedSpeakers + " to delete. New total: " +
            mSpeakers.size());
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:44,代码来源:SpeakersHandler.java

示例8: process

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
@Override
public void process(@NonNull Gson gson, @NonNull JsonElement element) {
    for (Speaker speaker : gson.fromJson(element, Speaker[].class)) {
        mSpeakers.put(speaker.id, speaker);
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:7,代码来源:SpeakersHandler.java

示例9: makeContentProviderOperations

import com.google.samples.apps.iosched.io.model.Speaker; //导入依赖的package包/类
@Override
public void makeContentProviderOperations(ArrayList<ContentProviderOperation> list) {
    Uri uri = ScheduleContractHelper.setUriAsCalledFromSyncAdapter(
            ScheduleContract.Speakers.CONTENT_URI);
    HashMap<String, String> speakerHashcodes = loadSpeakerHashcodes();
    HashSet<String> speakersToKeep = new HashSet<>();
    boolean isIncrementalUpdate = speakerHashcodes != null && speakerHashcodes.size() > 0;

    if (isIncrementalUpdate) {
        LOGD(TAG, "Doing incremental update for speakers.");
    } else {
        LOGD(TAG, "Doing FULL (non incremental) update for speakers.");
        list.add(ContentProviderOperation.newDelete(uri).build());
    }

    int updatedSpeakers = 0;
    for (Speaker speaker : mSpeakers.values()) {
        String hashCode = speaker.getImportHashcode();
        speakersToKeep.add(speaker.id);

        // add speaker, if necessary
        if (!isIncrementalUpdate || !speakerHashcodes.containsKey(speaker.id) ||
                !speakerHashcodes.get(speaker.id).equals(hashCode)) {
            ++updatedSpeakers;
            boolean isNew = !isIncrementalUpdate || !speakerHashcodes.containsKey(speaker.id);
            buildSpeaker(isNew, speaker, list);
        }
    }

    int deletedSpeakers = 0;
    if (isIncrementalUpdate) {
        for (String speakerId : speakerHashcodes.keySet()) {
            if (!speakersToKeep.contains(speakerId)) {
                buildDeleteOperation(speakerId, list);
                ++deletedSpeakers;
            }
        }
    }

    LOGD(TAG, "Speakers: " + (isIncrementalUpdate ? "INCREMENTAL" : "FULL") + " update. " +
            updatedSpeakers + " to update, " + deletedSpeakers + " to delete. New total: " +
            mSpeakers.size());
}
 
开发者ID:google,项目名称:iosched,代码行数:44,代码来源:SpeakersHandler.java


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