Example usage for java.util Collections newSetFromMap

List of usage examples for java.util Collections newSetFromMap

Introduction

In this page you can find the example usage for java.util Collections newSetFromMap.

Prototype

public static <E> Set<E> newSetFromMap(Map<E, Boolean> map) 

Source Link

Document

Returns a set backed by the specified map.

Usage

From source file:com.kixeye.chassis.transport.websocket.WebSocketSession.java

protected WebSocketSession(ActionInvokingWebSocket webSocket) {
    this.webSocket = webSocket;
    this.properties = new ConcurrentHashMap<>();
    this.closeListeners = Collections.newSetFromMap(new ConcurrentHashMap<Runnable, Boolean>());
}

From source file:com.radiofarda.istgah.model.MusicProvider.java

public MusicProvider(MusicProviderSource source) {
    mSource = source;// w w  w.  j  a va  2s .  c  om
    mMusicListById = new ConcurrentHashMap<>();
    mFavoriteTracks = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
}

From source file:com.adaptris.core.AdaptrisConnectionImp.java

/**
 * <p>/* ww  w . j  a va  2s .com*/
 * Created a new instance.
 * </p>
 */
public AdaptrisConnectionImp() {
    consumers = Collections.newSetFromMap(new WeakHashMap<AdaptrisMessageConsumer, Boolean>());
    producers = Collections.newSetFromMap(new WeakHashMap<AdaptrisMessageProducer, Boolean>());
    listeners = Collections.newSetFromMap(new WeakHashMap<StateManagedComponent, Boolean>());
    state = ClosedState.getInstance();
}

From source file:com.phearom.um.model.MyMusicProvider.java

private MyMusicProvider() {
    mMusicListByGenre = new ConcurrentHashMap<>();
    mMusicListById = new ConcurrentHashMap<>();
    mFavoriteTracks = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
}

From source file:com.phearom.um.model.MusicProvider.java

public MusicProvider(Context context) {
    this.mContext = context;
    mMusicListByGenre = new ConcurrentHashMap<>();
    mMusicListById = new ConcurrentHashMap<>();
    mFavoriteTracks = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
}

From source file:com.classiqo.nativeandroid_32bitz.model.MusicProvider.java

public MusicProvider(MusicProviderSource source) {
    mSource = source;// ww  w . j a v a  2  s .c  o m
    mMusicListByGenre = new ConcurrentHashMap<>();
    mMusicListById = new ConcurrentHashMap<>();
    mFavoriteTracks = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
}

From source file:org.b3log.symphony.processor.channel.UserChannel.java

/**
 * Called when the socket connection with the browser is established.
 *
 * @param session session/*w  w  w  . j ava  2  s.c o  m*/
 */
@OnOpen
public void onConnect(final Session session) {
    final JSONObject user = (JSONObject) Channels.getHttpSessionAttribute(session, User.USER);
    if (null == user) {
        return;
    }

    final String userId = user.optString(Keys.OBJECT_ID);

    Set<Session> userSessions = SESSIONS.get(userId);
    if (null == userSessions) {
        userSessions = Collections.newSetFromMap(new ConcurrentHashMap());
    }
    userSessions.add(session);

    SESSIONS.put(userId, userSessions);

    updateUserOnlineFlag(userId, true);
}

From source file:backup.namenode.NameNodeRestoreProcessor.java

public NameNodeRestoreProcessor(Configuration conf, NameNode namenode, UserGroupInformation ugi)
        throws Exception {
    this.ugi = ugi;
    this.conf = conf;
    this.namesystem = namenode.getNamesystem();
    this.blockManager = namesystem.getBlockManager();
    Cache<ExtendedBlock, Boolean> cache = CacheBuilder.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES)
            .build();/*from   w  ww. j a v a 2  s .com*/
    currentRequestedRestore = Collections.newSetFromMap(cache.asMap());
    pollTime = conf.getLong(DFS_BACKUP_NAMENODE_MISSING_BLOCKS_POLL_TIME_KEY,
            DFS_BACKUP_NAMENODE_MISSING_BLOCKS_POLL_TIME_DEFAULT);
    blockCheck = new NameNodeBackupBlockCheckProcessor(conf, this, namenode, ugi);
    start();
}

From source file:org.biopax.validator.impl.ValidatorImpl.java

public ValidatorImpl() {
    results = Collections.newSetFromMap(new ConcurrentHashMap<Validation, Boolean>());
}

From source file:com.pi.android.brainbeats.model.MusicProvider.java

public MusicProvider(Context context, MusicProviderSource source) {

    mSource = source;/*from  w w w.  j a  va  2  s. c o  m*/
    mMusicListByGenre = new ConcurrentHashMap<>();
    mMusicListById = new ConcurrentHashMap<>();
    mFavoriteTracks = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
}