import java.util.*;
public class GossipPartners
{
	/*
	Courtney Karppi
	CISC 370 - GossipProtocol
	May 5, 2015
	*/

	private static GossipPartners instance;
	private Collection<GossipPartner> gossipPartners;

	private GossipPartners()
	{
		gossipPartners = new Vector<GossipPartner>();
	}//constructor

	public static GossipPartners getInstance()
	{
		if(instance == null)
		{
			instance = new GossipPartners();
		}
		return instance;
	}//getInstance

	public static GossipPartners newInstance()
	{
		return getInstance();
	}//newInstance

	public void addPartner(GossipPartner gossipPartner)
	{
		gossipPartners.add(gossipPartner);
	}//addPartner
	
	public void send(UDPMessage udpMessage)
	{
		Iterator<GossipPartner> ie;
		
		ie = gossipPartners.iterator();
		
		while(ie.hasNext())
		{
			ie.next().send(udpMessage);
		}
	}

}//class

@@ -107,14 +107,592 @@
 2015
+%0A%0A%09Class Variables:%0A%09%09instance%0A%09%09%09An instnace of GossipPartners%0A%09%09gossipPartners%0A%09%09%09a collection of all the partners%0A%09Constructors:%0A%09%09GossipPartners()%0A%09%09%09creates a new vector for the instance variable%0A%09Methods:%0A%09%09public static GossipPartners getInstance()%0A%09%09%09If the instance is null it sets a new GossipPartners%0A%09%09public static GossipPartners newInstance()%0A%09%09%09Calls getInstance%0A%09%09public void addPartner(GossipPartner gossipPartner)%0A%09%09%09Adds a partner to the collection%0A%09%09public void send(UDPMessage udpMessage)%0A%09%09%09Sends the message to all the gossipPartners if the TTL is not zero
 %0A%09*/%0A
-%0A
 %09pri
@@ -921,16 +921,73 @@
 ce()%0A%09%7B%0A
+%09%09//If the instance is null it sets a new GossipPartners%0A
 %09%09if(ins
@@ -1128,16 +1128,38 @@
 ce()%0A%09%7B%0A
+%09%09//Calls getInstance%0A
 %09%09return
@@ -1243,24 +1243,61 @@
 Partner)%0A%09%7B%0A
+%09%09//Adds a partner to the collection%0A
 %09%09gossipPart
@@ -1336,17 +1336,16 @@
 Partner%0A
-%09
 %0A%09public
@@ -1381,16 +1381,209 @@
 age)%0A%09%7B%0A
+%09%09//Sends the message to all the gossipPartners if the TTL is not zero%0A%09%09if(udpMessage.getTimeToLive() == 0)%0A%09%09%7B%0A%09%09%09//doesn't send%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A///HOW DO YOU MAKE A LOWER TTL FOR UDPMESSAGE%0A%09
 %09%09Iterat
@@ -1606,18 +1606,16 @@
 %3E ie;%0A%09%09
-%0A%09
 %09ie = go
@@ -1643,11 +1643,10 @@
 ();%0A
-%09%09
 %0A
+%09
 %09%09wh
@@ -1661,26 +1661,28 @@
 asNext())%0A%09%09
+%09
 %7B%0A
+%09
 %09%09%09ie.next()
@@ -1706,12 +1706,23 @@
 ;%0A%09%09
-%7D%0A
 %09%7D
+%0A%09%09%7D%0A%09%7D//send
 %0A%0A%7D/

Update GossipPartners.java