File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

operand types that can be compared

 
Tina Desai
Ranch Hand
Posts: 365
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I want a list of all the oeprand types that can be compared and would not give me a compile time error.
For this I tried checking the Java Language specs. I could see order of operantions, precedence etc. I wonder if such kind of information is available in specs. I feel it should be.
Anyone who has come across such information in the specs?
Thanks and Regards,
Leena
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compared -- using what? The '<' operator and friends? The JLS will tell you (all primitives except booleans, I think); the conversion rules will tell you exactly how the language handles mixed types. With compareTo()? Aything that is Comparable. This is something for the API specification rather than the language specification, and you can find a list of Comparable classes in the core API at the top of the javadoc page.
- Peter
[ June 27, 2003: Message edited by: Peter den Haan ]
 
Tina Desai
Ranch Hand
Posts: 365
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be I should make it more clear.
I am after wirting a condition parser.
If I have -
i and str, I have to decide whether they can be compared. can the spec help me in it?
Tina
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic