summaryrefslogtreecommitdiff
path: root/src/main/java/IChannelNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/IChannelNode.java')
-rw-r--r--src/main/java/IChannelNode.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/IChannelNode.java b/src/main/java/IChannelNode.java
index 463f3ac..baf7572 100644
--- a/src/main/java/IChannelNode.java
+++ b/src/main/java/IChannelNode.java
@@ -1,14 +1,19 @@
1import java.util.List; 1import java.util.List;
2import java.util.Map; 2import java.util.Map;
3 3
4public interface IChannelNode { 4public interface IChannelNode extends Comparable<IChannelNode> {
5 enum Direction { 5 enum Direction {
6 INCOMING, 6 INCOMING(0), // Users incoming from outside channel (aka: other channel forwarded this channel's post)
7 OUTGOING, 7 OUTGOING(1), // Users outgoing from this channel (aka: this channel forwarded someone else's post)
8 BOTH 8 BOTH(2); // Modify both incoming and outgoing counts at once
9
10 private final int val;
11 Direction(int val) {this.val = val;}
12 public int getVal() {return this.val;}
9 } 13 }
10 14
11 void setConnections(Map<IChannelNode, Integer> conmap, Direction dir); 15 void setConnections(Map<IChannelNode, Integer> conmap, Direction dir);
16 void setNumConnections(IChannelNode node, Direction dir, int num);
12 void addConnection(IChannelNode node, Direction dir); 17 void addConnection(IChannelNode node, Direction dir);
13 void addConnections(Iterable<IChannelNode> nodes, Direction dir); 18 void addConnections(Iterable<IChannelNode> nodes, Direction dir);
14 void removeConnection(IChannelNode node, Direction dir); 19 void removeConnection(IChannelNode node, Direction dir);
@@ -16,6 +21,7 @@ public interface IChannelNode {
16 void clearConnections(Direction dir); 21 void clearConnections(Direction dir);
17 22
18 boolean connectionExists(IChannelNode node, Direction dir); 23 boolean connectionExists(IChannelNode node, Direction dir);
24 int getNumConnections(Direction dir);
19 Map<IChannelNode, Integer> getIncomingConnections(); 25 Map<IChannelNode, Integer> getIncomingConnections();
20 Map<IChannelNode, Integer> getOutgoingConnections(); 26 Map<IChannelNode, Integer> getOutgoingConnections();
21 List<Map<IChannelNode, Integer>> getConnections(Direction dir); 27 List<Map<IChannelNode, Integer>> getConnections(Direction dir);