1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import java.util.List;
import java.util.Map;
public interface IChannelNode extends Comparable<IChannelNode> {
enum Direction {
INCOMING(0), // Users incoming from outside channel (aka: other channel forwarded this channel's post)
OUTGOING(1), // Users outgoing from this channel (aka: this channel forwarded someone else's post)
BOTH(2); // Modify both incoming and outgoing counts at once
private final int val;
Direction(int val) {this.val = val;}
public int getVal() {return this.val;}
}
void setConnections(Map<IChannelNode, Integer> conmap, Direction dir);
void setNumConnections(IChannelNode node, Direction dir, int num);
void addConnection(IChannelNode node, Direction dir);
void addConnections(Iterable<IChannelNode> nodes, Direction dir);
void removeConnection(IChannelNode node, Direction dir);
void removeConnections(Iterable<IChannelNode> nodes, Direction dir);
void clearConnections(Direction dir);
boolean connectionExists(IChannelNode node, Direction dir);
int getNumConnections(Direction dir);
Map<IChannelNode, Integer> getIncomingConnections();
Map<IChannelNode, Integer> getOutgoingConnections();
List<Map<IChannelNode, Integer>> getConnections(Direction dir);
}
|