Class MyContexts
- java.lang.Object
-
- eu.h2020.helios_social.core.info_control.MyContexts
-
public class MyContexts extends java.lang.ObjectThis class is a container of user contexts (MyContexts). It provides methods to get, add and remove contexts from the container. It also binds contexts to Contextual Ego Network.
-
-
Constructor Summary
Constructors Constructor Description MyContexts(eu.h2020.helios_social.core.contextualegonetwork.ContextualEgoNetwork cen, MyContextsDatabase myContextsDb)Creates a MyContexts instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Context context)Adds a context into MyContexts and associates it with contextual ego networkjava.util.List<Context>getActiveContexts()Returns currently active contextseu.h2020.helios_social.core.contextualegonetwork.ContextualEgoNetworkgetCen()Returns the associated contextual ego networkContextgetContextById(java.lang.String id)Returns context by given idjava.util.List<Context>getContexts()Returns all the contexts in MyContextsvoidremove(Context context)Removes a context from MyContexts and from contextual ego networkvoidremoveAll()voidsetActive(Context context, boolean active)intsize()Returns the number of contexts in MyContextsvoidupdate(Context context)Updates MyContextsDatabase with updates in given context
-
-
-
Constructor Detail
-
MyContexts
public MyContexts(eu.h2020.helios_social.core.contextualegonetwork.ContextualEgoNetwork cen, MyContextsDatabase myContextsDb)Creates a MyContexts instance- Parameters:
cen- the contextual ego network (or null)myContextsDb- MyContextsDatabase (or null)
-
-
Method Detail
-
add
public void add(@NonNull Context context)Adds a context into MyContexts and associates it with contextual ego network- Parameters:
context- the context
-
update
public void update(@NonNull Context context)Updates MyContextsDatabase with updates in given context- Parameters:
context- the context
-
remove
public void remove(@NonNull Context context)Removes a context from MyContexts and from contextual ego network- Parameters:
context- the context
-
removeAll
public void removeAll()
-
setActive
public void setActive(@NonNull Context context, boolean active)
-
getContextById
public Context getContextById(@NonNull java.lang.String id)
Returns context by given id- Parameters:
id- the context ids- Returns:
- the context
-
getActiveContexts
public java.util.List<Context> getActiveContexts()
Returns currently active contexts- Returns:
- the Iterator to active contexts list
-
getContexts
public java.util.List<Context> getContexts()
Returns all the contexts in MyContexts- Returns:
- the list of contexts
-
size
public int size()
Returns the number of contexts in MyContexts- Returns:
- the number of contexts
-
getCen
public eu.h2020.helios_social.core.contextualegonetwork.ContextualEgoNetwork getCen()
Returns the associated contextual ego network- Returns:
- the ContextualEgoNetwork
-
-