summaryrefslogtreecommitdiff
path: root/src/main/java/net/transit/network/system
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2019-11-20 12:45:16 -0500
committerKyle Gunger <kgunger12@gmail.com>2019-11-20 12:45:16 -0500
commitdf044930bca4252ff6e4814c654a612c6aee2136 (patch)
tree906eddbbfdecb63e3525657cd4e6f75c8ba91bc3 /src/main/java/net/transit/network/system
parentebc33c58c8a3669822a0dba99cbfe8a451782813 (diff)
[0.1.7 REWRITE] Codebase overhaul.
~ Codebase split into two sub-packages ~ net.transit.network for transfering between objects ~ net.transit.type for type registering and conversion + Added new interfaces (INode and ISystem) + More documentation + (Kinda) Working build - Removed unnessairy interfaces (IGenerator and IConsumer) - Removed base types ~ Restructured type system
Diffstat (limited to 'src/main/java/net/transit/network/system')
-rw-r--r--src/main/java/net/transit/network/system/INode.java50
-rw-r--r--src/main/java/net/transit/network/system/ISystem.java17
2 files changed, 67 insertions, 0 deletions
diff --git a/src/main/java/net/transit/network/system/INode.java b/src/main/java/net/transit/network/system/INode.java
new file mode 100644
index 0000000..2dc3686
--- /dev/null
+++ b/src/main/java/net/transit/network/system/INode.java
@@ -0,0 +1,50 @@
+package net.transit.network.system;
+
+import net.transit.network.swap.IAcceptor;
+import net.transit.network.swap.IProvider;
+
+/**
+ * @author Kyle Gunger
+ * @apiNote A node inside or outside a system. Provides acceptors and providers to other nodes.
+ */
+public interface INode
+{
+ /**Returns the groupIDs of groups the node provide
+ *
+ * @return String[]
+ */
+ public String[] groupsProvided();
+
+ /**Get the system managing the node or {@code null} if there isn't one
+ *
+ * @return ISystem
+ */
+ public ISystem getSystem();
+
+ /**Returns {@code true} if the node provides IAcceptors
+ *
+ * @return boolean
+ */
+ public boolean isAcceptor();
+
+ /**Returns an IAcceptor or {@code null} depending on the requester and group
+ *
+ * @param requester The object requesting the IAcceptor
+ * @param group
+ * @return IAcceptor
+ */
+ public IAcceptor<?> requestAcceptor(Object requester, String group);
+
+ /**Returns {@code true} if the node provides IProviders
+ *
+ */
+ public boolean isProvider();
+
+ /**Returns an IProvider or {@code null} depending on the requester and group
+ *
+ * @param requester The object requesting the IProvider
+ * @param group
+ * @return IProvider
+ */
+ public IProvider<?> requestProvider(Object requestor, String group);
+}
diff --git a/src/main/java/net/transit/network/system/ISystem.java b/src/main/java/net/transit/network/system/ISystem.java
new file mode 100644
index 0000000..fd2fa51
--- /dev/null
+++ b/src/main/java/net/transit/network/system/ISystem.java
@@ -0,0 +1,17 @@
+package net.transit.network.system;
+
+
+/**ISystem - a group of nodes optimized for performance
+ *
+ * A node can exist without a system, but a system can not exist without at least one root node.
+ *
+ * @param T The object type stored in the system.
+ */
+public interface ISystem
+{
+ /**The nodes stored by the system
+ *
+ * @return INode[]
+ */
+ public INode[] getNodes();
+}