summaryrefslogtreecommitdiff
path: root/src/main/java/net/transit
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2019-11-22 14:10:10 -0500
committerKyle Gunger <kgunger12@gmail.com>2019-11-22 14:10:10 -0500
commit224e0341bbc4402ca25493d465e2a68c66815114 (patch)
tree87fd53241d56bfaddf985ee266348be50ef30eb1 /src/main/java/net/transit
parentc05689ba385733ee52ca825b194134126640af8a (diff)
[Update] More methods to impliment so that everyone plays nice
+ Unlinkers for nodes + Get connections for nodes Signed-off-by: Kyle Gunger <kgunger12@gmail.com>
Diffstat (limited to 'src/main/java/net/transit')
-rw-r--r--src/main/java/net/transit/network/system/Node.java6
-rw-r--r--src/main/java/net/transit/network/system/swap/AcceptorNode.java10
-rw-r--r--src/main/java/net/transit/network/system/swap/ProviderNode.java9
3 files changed, 24 insertions, 1 deletions
diff --git a/src/main/java/net/transit/network/system/Node.java b/src/main/java/net/transit/network/system/Node.java
index 9e9ac10..9ab9812 100644
--- a/src/main/java/net/transit/network/system/Node.java
+++ b/src/main/java/net/transit/network/system/Node.java
@@ -27,4 +27,10 @@ public interface Node
* @return
*/
public Object getData(String groupID);
+
+ /** Get the nodes that this node is connected to
+ *
+ * @return Node[]
+ */
+ public Node[] getConnections();
}
diff --git a/src/main/java/net/transit/network/system/swap/AcceptorNode.java b/src/main/java/net/transit/network/system/swap/AcceptorNode.java
index c583146..69c07e7 100644
--- a/src/main/java/net/transit/network/system/swap/AcceptorNode.java
+++ b/src/main/java/net/transit/network/system/swap/AcceptorNode.java
@@ -10,11 +10,19 @@ public interface AcceptorNode extends Node
*
* @param requester The object to be a provider
* @param group
- * @return Provider
+ * @return
*/
public boolean linkProvider(Node requestor, String group);
+ /** Unlink a provider from the acceptor
+ *
+ * @param toUnlink
+ * @return
+ */
+ public boolean unlinkProvider(Node toUnlink);
+
+
/**
* @return Node[]
*/
diff --git a/src/main/java/net/transit/network/system/swap/ProviderNode.java b/src/main/java/net/transit/network/system/swap/ProviderNode.java
index 4cd9dba..1ba1ef3 100644
--- a/src/main/java/net/transit/network/system/swap/ProviderNode.java
+++ b/src/main/java/net/transit/network/system/swap/ProviderNode.java
@@ -12,6 +12,15 @@ public interface ProviderNode extends Node{
*/
public boolean linkAcceptor(Node requester, String group);
+
+ /** Unlink a provider from the acceptor
+ *
+ * @param toUnlink
+ * @return
+ */
+ public boolean unlinkAcceptor(Node toUnlink);
+
+
/**
* @return Node[]
*/