From 5759e17941c537b7c73867d384cb9e22ce6f2b52 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 16 Apr 2020 15:04:40 -0400 Subject: [Update] Version 0.8.1 + Change domain to an actual website. --- .../net/transit/network/packet/ArrayPacket.java | 52 --------------- .../net/transit/network/packet/IStaticPacket.java | 23 ------- .../net/transit/network/packet/MetaPacket.java | 35 ---------- .../java/net/transit/network/packet/Packet.java | 23 ------- .../net/transit/network/packet/StaticPacket.java | 36 ----------- .../network/packet/dynamic/ArrayPacket.java | 74 ---------------------- .../network/packet/dynamic/DynamicPacket.java | 43 ------------- .../network/packet/dynamic/IDynamicPacket.java | 16 ----- .../network/packet/dynamic/MetaDynamicPacket.java | 44 ------------- .../java/net/transit/network/system/INode.java | 45 ------------- .../java/net/transit/network/system/ISystem.java | 17 ----- src/main/java/net/transit/network/system/Node.java | 45 ------------- .../java/net/transit/network/system/System.java | 17 ----- .../transit/network/system/swap/AcceptorNode.java | 39 ------------ .../transit/network/system/swap/ProviderNode.java | 29 --------- 15 files changed, 538 deletions(-) delete mode 100644 src/main/java/net/transit/network/packet/ArrayPacket.java delete mode 100644 src/main/java/net/transit/network/packet/IStaticPacket.java delete mode 100644 src/main/java/net/transit/network/packet/MetaPacket.java delete mode 100644 src/main/java/net/transit/network/packet/Packet.java delete mode 100644 src/main/java/net/transit/network/packet/StaticPacket.java delete mode 100644 src/main/java/net/transit/network/packet/dynamic/ArrayPacket.java delete mode 100644 src/main/java/net/transit/network/packet/dynamic/DynamicPacket.java delete mode 100644 src/main/java/net/transit/network/packet/dynamic/IDynamicPacket.java delete mode 100644 src/main/java/net/transit/network/packet/dynamic/MetaDynamicPacket.java delete mode 100644 src/main/java/net/transit/network/system/INode.java delete mode 100644 src/main/java/net/transit/network/system/ISystem.java delete mode 100644 src/main/java/net/transit/network/system/Node.java delete mode 100644 src/main/java/net/transit/network/system/System.java delete mode 100644 src/main/java/net/transit/network/system/swap/AcceptorNode.java delete mode 100644 src/main/java/net/transit/network/system/swap/ProviderNode.java (limited to 'src/main/java/net/transit/network') diff --git a/src/main/java/net/transit/network/packet/ArrayPacket.java b/src/main/java/net/transit/network/packet/ArrayPacket.java deleted file mode 100644 index fbea811..0000000 --- a/src/main/java/net/transit/network/packet/ArrayPacket.java +++ /dev/null @@ -1,52 +0,0 @@ -package net.transit.network.packet; - -import java.util.ArrayList; - -import net.transit.type.Type; - -public class ArrayPacket implements Packet -{ - private ArrayList arrayData; - private Type type; - - public ArrayPacket(D startValue, Type t) - { - arrayData = new ArrayList(0); - arrayData.add(startValue); - type = t; - } - - @Override - public D getData() - { - if(arrayData.size() > 0) return arrayData.get(0); - return null; - } - - public void addData(D data) - { - arrayData.add(data); - } - - public int dataStored() - { - return arrayData.size(); - } - - public D popAndShift() - { - D temp = null; - - if(arrayData.size() > 0) - { - temp = arrayData.remove(0); - } - - return temp; - } - - @Override - public Type getType() { - return type; - } -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/IStaticPacket.java b/src/main/java/net/transit/network/packet/IStaticPacket.java deleted file mode 100644 index 01073d3..0000000 --- a/src/main/java/net/transit/network/packet/IStaticPacket.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.transit.network.packet; - -import net.transit.type.Type; - -/** Interface describing an unchanging packet. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers. - */ -public interface IStaticPacket -{ - /**Get the packet's data. - * - * @return The packet's data - */ - public D getData(); - - /**Get the packet's type. - * - * @return IType<> The type of the packet - */ - public Type getType(); -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/MetaPacket.java b/src/main/java/net/transit/network/packet/MetaPacket.java deleted file mode 100644 index 7e49318..0000000 --- a/src/main/java/net/transit/network/packet/MetaPacket.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.transit.network.packet; - -import net.transit.type.Type; - -/** Static packet with extra data attached. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - * @param The type of metadata -*/ -public class MetaPacket extends StaticPacket -{ - private M metaData; - - /** Constructor - * - * @param dat The data to store - * @param t The Type of the data - * @param meta The metadata to store - */ - public MetaPacket(D dat, Type t, M meta) - { - super(dat, t); - metaData = meta; - } - - /** Get the metadata of the packet. - * - * @return The packet's metadata - */ - public M getMetaData() - { - return metaData; - } -} diff --git a/src/main/java/net/transit/network/packet/Packet.java b/src/main/java/net/transit/network/packet/Packet.java deleted file mode 100644 index 0b7c832..0000000 --- a/src/main/java/net/transit/network/packet/Packet.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.transit.network.packet; - -import net.transit.type.Type; - -/** - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers. - */ -public interface Packet -{ - /**Get the packet's data - * - * @return The packet's data - */ - public D getData(); - - /**Get the packet's type - * - * @return IType<> The type of the packet - */ - public Type getType(); -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/StaticPacket.java b/src/main/java/net/transit/network/packet/StaticPacket.java deleted file mode 100644 index eeeae3f..0000000 --- a/src/main/java/net/transit/network/packet/StaticPacket.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.transit.network.packet; - -import net.transit.type.Type; - -/** Simple packet which stores an unchanging value. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers. - */ -public class StaticPacket implements IStaticPacket -{ - private D data; - private Type type; - - /** Constructor. Stores the given data and uses the given type. - * - * @param dat The packet's data - * @param t The packet's type - */ - public StaticPacket(D dat, Type t) - { - data = dat; - type = t; - } - - @Override - public D getData() - { - return data; - } - - @Override - public Type getType() { - return type; - } -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/dynamic/ArrayPacket.java b/src/main/java/net/transit/network/packet/dynamic/ArrayPacket.java deleted file mode 100644 index 0c27c80..0000000 --- a/src/main/java/net/transit/network/packet/dynamic/ArrayPacket.java +++ /dev/null @@ -1,74 +0,0 @@ -package net.transit.network.packet.dynamic; - -import java.util.ArrayList; - -import net.transit.type.Type; - -/** A packet type which stores multiple values which can be accessed. When getting data, pop and shift from the array. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - */ -public class ArrayPacket implements IDynamicPacket -{ - private ArrayList arrayData; - private Type type; - - /** Constructor - * Create an array packet. Adds the starting value. - * @param startValue The starting value - * @param t The type of the packet - */ - public ArrayPacket(D startValue, Type t) - { - arrayData = new ArrayList(0); - arrayData.add(startValue); - type = t; - } - - /** - * Create an empty array packet of the desired type. - * @param t The type of the packet - */ - public ArrayPacket(Type t) - { - arrayData = new ArrayList(0); - type = t; - } - - /** Pop and shift data from the array. - */ - @Override - public D getData() - { - D temp = null; - - if(arrayData.size() > 0) - { - temp = arrayData.remove(0); - } - - return temp; - } - - /** Add data to the array. - * @param data The data to push - */ - public void setData(D data) - { - arrayData.add(data); - } - - /** - * @return The ammount of data the packet holds - */ - public int dataStored() - { - return arrayData.size(); - } - - @Override - public Type getType() { - return type; - } -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/dynamic/DynamicPacket.java b/src/main/java/net/transit/network/packet/dynamic/DynamicPacket.java deleted file mode 100644 index 0860487..0000000 --- a/src/main/java/net/transit/network/packet/dynamic/DynamicPacket.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.transit.network.packet.dynamic; - -import net.transit.type.Type; - -/** - * Simple packet which stores a fluid value. - * - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - */ -public class DynamicPacket implements IDynamicPacket { - private D data; - private Type type; - - /** Constructor. Stores the given data and uses the given type. - * - * @param dat The packet's data - * @param t The packet's type - */ - public DynamicPacket(D dat, Type t) - { - data = dat; - type = t; - } - - @Override - public D getData() - { - return data; - } - - @Override - public void setData(D dat) - { - data = dat; - } - - @Override - public Type getType() { - return type; - } -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/dynamic/IDynamicPacket.java b/src/main/java/net/transit/network/packet/dynamic/IDynamicPacket.java deleted file mode 100644 index 51b3c13..0000000 --- a/src/main/java/net/transit/network/packet/dynamic/IDynamicPacket.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.transit.network.packet.dynamic; - -import net.transit.network.packet.IStaticPacket; - -/** Interface describing a fluid packet. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - */ -public interface IDynamicPacket extends IStaticPacket{ - /**Set the packet's data. - * - * @return The packet's data - */ - public void setData(D dat); -} \ No newline at end of file diff --git a/src/main/java/net/transit/network/packet/dynamic/MetaDynamicPacket.java b/src/main/java/net/transit/network/packet/dynamic/MetaDynamicPacket.java deleted file mode 100644 index b6a3ec6..0000000 --- a/src/main/java/net/transit/network/packet/dynamic/MetaDynamicPacket.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.transit.network.packet.dynamic; - -import net.transit.type.Type; - -/** Static packet with extra data attached. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - * @param The type of metadata -*/ -public class MetaDynamicPacket extends DynamicPacket -{ - private M metaData; - - /** Constructor - * - * @param dat The data to store - * @param t The Type of the data - * @param meta The metadata to store - */ - public MetaDynamicPacket(D dat, Type t, M meta) - { - super(dat, t); - metaData = meta; - } - - /** Get the metadata of the packet. - * - * @return The packet's metadata - */ - public M getMetaData() - { - return metaData; - } - - /** Set the metadata of the packet. - * - * @param meta The packet's new metadata - */ - public void setMetaData(M meta) - { - metaData = meta; - } -} diff --git a/src/main/java/net/transit/network/system/INode.java b/src/main/java/net/transit/network/system/INode.java deleted file mode 100644 index 9c42bf1..0000000 --- a/src/main/java/net/transit/network/system/INode.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.transit.network.system; - -/** - * @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 interacts with - * - * @return String[] - */ - public String[] groupsProvided(); - - - /**Get the system managing the node or {@code null} if there isn't one - * - * @return System - */ - public System getSystem(); - - - /** Get the data of one of the TypeGroups the Node supports - * - * @param groupID - * @return - */ - public Object getData(String groupID); - - - /** Set the group data for the node - * - * @param dat - * @param groupID - */ - public void setData(Object dat, String groupID); - - - /** Get the nodes that this node is connected to - * - * @return Node[] - */ - public INode[] getConnections(); -} diff --git a/src/main/java/net/transit/network/system/ISystem.java b/src/main/java/net/transit/network/system/ISystem.java deleted file mode 100644 index fd2fa51..0000000 --- a/src/main/java/net/transit/network/system/ISystem.java +++ /dev/null @@ -1,17 +0,0 @@ -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(); -} diff --git a/src/main/java/net/transit/network/system/Node.java b/src/main/java/net/transit/network/system/Node.java deleted file mode 100644 index 6a661f3..0000000 --- a/src/main/java/net/transit/network/system/Node.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.transit.network.system; - -/** - * @author Kyle Gunger - * @apiNote A node inside or outside a system. Provides acceptors and providers to other nodes. - */ -public interface Node -{ - - /**Returns the groupIDs of groups the node interacts with - * - * @return String[] - */ - public String[] groupsProvided(); - - - /**Get the system managing the node or {@code null} if there isn't one - * - * @return System - */ - public System getSystem(); - - - /** Get the data of one of the TypeGroups the Node supports - * - * @param groupID - * @return - */ - public Object getData(String groupID); - - - /** Set the group data for the node - * - * @param dat - * @param groupID - */ - public void setData(Object dat, 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/System.java b/src/main/java/net/transit/network/system/System.java deleted file mode 100644 index c70292a..0000000 --- a/src/main/java/net/transit/network/system/System.java +++ /dev/null @@ -1,17 +0,0 @@ -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 System -{ - /**The nodes stored by the system - * - * @return INode[] - */ - public Node[] getNodes(); -} diff --git a/src/main/java/net/transit/network/system/swap/AcceptorNode.java b/src/main/java/net/transit/network/system/swap/AcceptorNode.java deleted file mode 100644 index 14c672d..0000000 --- a/src/main/java/net/transit/network/system/swap/AcceptorNode.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.transit.network.system.swap; - -import net.transit.network.packet.IStaticPacket; -import net.transit.network.system.INode; - -public interface AcceptorNode extends INode -{ - - /** Link another node as a provider - * - * @param requester The object to be a provider - * @param group - * @return - */ - public boolean linkProvider(INode requester, String group); - - - /** Unlink a provider from the acceptor - * - * @param toUnlink - * @return - */ - public boolean unlinkProvider(INode toUnlink); - - - /** - * @return Node[] - */ - public INode[] getProviders(); - - - /** Accept a packet from a provider - * - * @param packet - * @param group - * @return - */ - public boolean accept(IStaticPacket packet, String group); -} diff --git a/src/main/java/net/transit/network/system/swap/ProviderNode.java b/src/main/java/net/transit/network/system/swap/ProviderNode.java deleted file mode 100644 index 831c87f..0000000 --- a/src/main/java/net/transit/network/system/swap/ProviderNode.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.transit.network.system.swap; - -import net.transit.network.system.INode; - -public interface ProviderNode extends INode{ - - /** Link another node as an acceptor - * - * @param requester The object requesting the Acceptor - * @param group - * @return boolean - */ - public boolean linkAcceptor(INode requester, String group); - - - /** Unlink a provider from the acceptor - * - * @param toUnlink - * @return - */ - public boolean unlinkAcceptor(INode toUnlink); - - - /** - * @return Node[] - */ - public INode[] getAcceptors(); - -} -- cgit v1.2.3