Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Compare two methods for equality

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-03-2010
Member
 
Join Date: Dec 2009
Posts: 178
Compare two methods for equality
  

Hello,
I have a class named Sequence. In my program I would use a list of Sequence. One of the fields in this class and a list of objects of type Match. At one point in this program I have to compare all objects of type game with another list, which will allow me to complete their attribute. (The game attribute possess a position that is their position on the sequence by comparing this position with a list of known positions I just deduct it are the attributes of the match in question.) My question then is, who should have the method of comparison between the game and the other list? If you have solution for this problem, then please help me with this. Thanks in advance.

Reply With Quote
  #2  
Old 09-03-2010
Member
 
Join Date: Nov 2009
Posts: 446
Re: Compare two methods for equality

Hello,
What do you comparing exactly? If the game is, simply redefine the class in the game equals method common to all objects. Otherwise I think you can also make a method in which Sequence compares two lists of matches, using the equals method of game that you've redefined. If you need more information on this, then you can visit the sun's official site and then you can see more detailed information on the same.
Reply With Quote
  #3  
Old 09-03-2010
Member
 
Join Date: Nov 2009
Posts: 356
Re: Compare two methods for equality

Hello,
I am a little restricted by the choice of the JDK, to provide a method equals to each object. For me, it's always something external that can compare. So the answer to the question Who should have the method of comparison between the game and the other list? To be smarter, I noted that there is in the class Arrays methods for comparing lists.
Reply With Quote
  #4  
Old 09-03-2010
Member
 
Join Date: Nov 2009
Posts: 343
Re: Compare two methods for equality

Hello,
There may be something somewhere that specifies the organization of these things, then it is he who will hold this as equals. Or do these rules come from constraints of your lists, or lists of objects, these bizarre rules do not fall from heaven. If they come from specific properties to these lists, then there must be method to the list. It is a difficulty responding to problems with compression algorithms that can explain compression algorithms, the objects themselves become algorithmic ideas, and we eventually get lost.
Reply With Quote
  #5  
Old 09-03-2010
Member
 
Join Date: Nov 2009
Posts: 359
Re: Compare two methods for equality

Hello,
If I understand a game is a range of characters. By comparison "you mean that you are looking at whether a range of characters (game object) is included in another range of characters. Looking therefore to know whether an object matches "is included" in another object game. Who has the information necessary to answer this question? A prior, the game objects. Therefore, this responsibility must be assigned to objects game. I therefore see such a method "public boolean contains (Match m)" in the class matches.
Reply With Quote
  #6  
Old 09-03-2010
Member
 
Join Date: Nov 2009
Posts: 446
Re: Compare two methods for equality

Hello,
But still the question of "who" will call contains and manage the assignment of attributes to the Games ... to me, it would rather blow to an external service (so in my opinion nor in the list or in game), but it's true it's a little too vague "functionally" to meet. I think this is the only solution for you, I can not think of an alternative right now, but if I come to knew about the same then I will post back.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Compare two methods for equality"
Thread Thread Starter Forum Replies Last Post
What is Equality between Premier players and Free players in Age of Empires Online Hiller Video Games 1 22-08-2011 04:40 AM
Dead Space 2 PC Equality Petition Botan Video Games 2 31-01-2011 03:26 PM
How to check object equality in .net? MAHAH Software Development 5 04-03-2010 07:52 PM
What are the different methods used by a Firewall Abhibhava Networking & Security 5 23-12-2009 12:30 AM
Get and Set methods garfield1 Software Development 3 24-11-2009 01:20 PM


All times are GMT +5.5. The time now is 02:56 PM.