public void addTweetNode(long ID, NodeType type) { int newNodeIndex = nNodes; if (!tweetIDtoIndex.ContainsKey(ID)) { Node node = new Node(ID, type); allNodes.Add(newNodeIndex, node); tweetIDtoIndex.Add(ID, nNodes); nNodes += 1; } }
// Add user node including third party users public void addUserNode(long id, NodeType type) { if (!userIDs.ContainsKey(id)) { Node node = new Node(id, type); allNodes.Add(nNodes, node); userIDs.Add(id, nNodes); if (type == NodeType.USER) memberIDs.Add(id, nNodes); else thirdPartyIDs.Add(id, nNodes); nNodes += 1; } }
// Add user node(ego, followee, thirdParty(co-followee)) public void addUserNode(long ID, NodeType type) // <User's ID> { int newNodeIndex = nNodes; // 'nNodes' plays as 'node index' if (!userIDtoIndex.ContainsKey(ID)) // Check already exist { Node node = new Node(ID, type); allNodes.Add(newNodeIndex, node); userIDtoIndex.Add(ID, newNodeIndex); if (type == NodeType.USER) memberIDtoIndex.Add(ID, newNodeIndex); // member: egoUser & friends else thirdPartyIDtoIndex.Add(ID, newNodeIndex); // thirdParty: (1) !ego && !followee (2) co-followee of ego and followee nNodes += 1; } }
public void addTweetNode(long id, NodeType type) { if (!tweetIDs.ContainsKey(id)) { Node node = new Node(id, type); allNodes.Add(nNodes, node); tweetIDs.Add(id, nNodes); nNodes += 1; } }