Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

java.rmi.Remote and java.lang.Comparable  RSS feed

Jason Ferguson
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Report post to moderator
Okay, I'm using java.rmi.Remote and have created interfaces IAccount and ITransaction (with appropriate implementations).

However, the rule for any class implementing Remote is that all methods have to throw RemoteException. This means that the class cannot implement Comparable, because compareTo() in Comparable does not throw RemoteException.

What I'm trying to do is obtain an Account instance, which will contain a Collection of transactions. I'll then create my Transaction(s), then add it to the Collection, which I would like to be a TreeSet. I can't use a TreeSet if I can't implement Comparable.

Anyone have any ideas?
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!