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

	Class Variables:
		instance
			An instnace of GossipPartners
		gossipPartners
			a collection of all the partners
	Constructors:
		GossipPartners()
			creates a new vector for the instance variable
	Methods:
		public static GossipPartners getInstance()
			If the instance is null it sets a new GossipPartners
		public static GossipPartners newInstance()
			Calls getInstance
		public void addPartner(GossipPartner gossipPartner)
			Adds a partner to the collection
		public void send(UDPMessage udpMessage)
			Sends the message to all the gossipPartners if the TTL is not zero
	*/
	private static GossipPartners instance;
	private Collection<GossipPartner> gossipPartners;

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

	public static GossipPartners getInstance()
	{
		//If the instance is null it sets a new GossipPartners
		if(instance == null)
		{
			instance = new GossipPartners();
		}
		return instance;
	}//getInstance

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

	public void addPartner(GossipPartner gossipPartner)
	{
		//Adds a partner to the collection
		gossipPartners.add(gossipPartner);
	}//addPartner

	public void send(UDPMessage udpMessage)
	{
		//Sends the message to all the gossipPartners if the TTL is not zero
		if(udpMessage.getTimeToLive().getLengthInBytes() == 0)
		{
			//doesn't send
		}
		else
		{
///HOW DO YOU MAKE A LOWER TTL FOR UDPMESSAGE
			Iterator<GossipPartner> ie;
			ie = gossipPartners.iterator();

			while(ie.hasNext())
			{
				ie.next().send(udpMessage);
			}
		}
	}//send

}//class

@@ -1452,16 +1452,39 @@
 ot zero%0A
+%09%09UDPMessage%09message;%0A%0A
 %09%09if(udp
@@ -1514,21 +1514,8 @@
 .get
-LengthInBytes
 () =
@@ -1560,54 +1560,8 @@
 %09%09%7B%0A
-///HOW DO YOU MAKE A LOWER TTL FOR UDPMESSAGE%0A
 %09%09%09I
@@ -1623,16 +1623,162 @@
 tor();%0A%0A
+%09%09%09message = new UDPMessage(udpMessage.getID1(),udpMessage.getID2(),new TimeToLive(1-udpMessage.getTimeToLive().get()), udpMessage.getMessage());%0A
 %09%09%09while
@@ -1816,20 +1816,17 @@
 ().send(
-udpM
+m
 essage);

Update GossipPartners.java