Code example for LinkedHashSet

Methods: add

0
    protected static String TAG = "feedPresence";
    protected final static boolean DBG = true;
 
    public final void setFeedPresence(Context context, Uri feed, boolean present) {
        if (present) {
            mActiveFeeds.add(feed);
        } else { 
            mActiveFeeds.remove(feed);
        } 
        onPresenceUpdated(context, feed, present);
    } 
 
    protected abstract void onPresenceUpdated(Context context, Uri feed, boolean present);
 
    public final LinkedHashSet<Uri> getFeedsWithPresence() {
        return mActiveFeeds;
    } 
 
    public boolean isPresent(Uri feedUri) {
        return mActiveFeeds.contains(feedUri);
    }