Re: Enumset



On Aug 31, 4:08 am, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
I was thinking of writing some JNI to access the Windows file
attributes. On the Java side this would be an EnumSet. On the Windows
side it would be a bitmap. Are there are any fast ways to
interconvert?
--
Roedy Green Canadian Mind Products
The Java Glossaryhttp://mindprod.com

Fast, as in optimal, or Fast as in, takes less than 5 minutes to
create?

I don't know much about JNI, but I think my approach would be have
this method be private, and simply return the bitmap value (in a int
value, or is possible, a BitSet). Then convert it to a BitSet. Have
the enums declared in the order that the BitSet reports the bits, and
use bitSet.nextSet() (I think thats the name) to determine the ordinal
of the enum you want to add to the EnumSet.

So, in other words, the conversion would be done on the Java side, and
you don't need to worry about performance until you find it to be a
bottleneck.

.



Relevant Pages

  • Re: VS.NET against JAVA
    ... Personally I found my GUI development to take 1/10th of the time when I switched from Java to C#. ... As an example, I recently found that a particular method I'd written was running slowly, and had to modify it (I'd rather not have to do the optimizing compiler's job, particularly in simple cases). ... public Bitmap CopyBitmap ... Even the silly little compilers I wrote as an undergrad could cope with that task! ...
    (microsoft.public.dotnet.general)
  • Re: Bitflags in Enum
    ... In Java geht das nicht so, ... Ich könnte das natürlich normal mit enum machen, nur frag ich mich, wie ich die Daten aus einer Datei hole und wie ich sie wieder dorthin speichere. ... Leider gibt es keine Möglichkeit solch einen EnumSet direkt in einen int-Wert umzuwandeln. ...
    (de.comp.lang.java)
  • Re: HashMap.put error in Xcode
    ... "Any class that defines a hashCode() method ... To answer why I was using a HashMap in the first place, ... BitSet being on or off. ... professional Java programmer, so if I can continue using a free ...
    (comp.lang.java.programmer)
  • Re: String containing algorithm
    ... >Plus, while Java represents characters internally in UTF-16, there are ... With a java.util.BitSet you can track presence with 8K ... The advantage of BitSet is the speed of direct addressing. ... http://mindprod.com Java custom programming, consulting and coaching. ...
    (comp.lang.java.programmer)
  • Printing of high-resolution bitmaps
    ... Recently I tried to print bitmap with resolution of printer and discovered the next problems: ... When I print it and check spooling info for printer I see>30 Mb is being spooled. ... In other words 50 times more then original size of bitmap. ... Similar problem exists in Java by the way. ...
    (microsoft.public.dotnet.framework.drawing)