harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: [classlib][luni] Enhance the functionalities provided by BitSet
Date Thu, 03 Aug 2006 10:09:57 GMT
Spark Shen wrote:
> Richard Liang 写道:
>>
>>
>> Spark Shen wrote:
>>> Hi All:
>>>
>>> IMHO, EnumSet provides a set view of enum types. According to its 
>>> spec, "Enum sets are represented internally as bit vectors".
>>> To avoid to re-invent the wheel, it could be more reasonable to 
>>> utilize java.util.BitSet class to support the implementation of 
>>> EnumSet.
>>>
>> Agree :-)
>>
>>> While current API methods provided by BitSet is not enough, I need 
>>> to extend the function provided by BitSet. There are 2 options:
>>> 1. Implement these extension methods in BitSet directly as package 
>>> private methods
>>> 2. Construct a package private utility class in 
>>> org.apache.harmony.luni.util package, and implement extensions in 
>>> this implementation class.
>>>
>>> I prefer the first option, since there is not many classes need 
>>> these extension. If no objections, I will adopt the first schema.
>>>
>> IMHO, it depends on the relationship between the extended functions 
>> and the whole class. Would you please provide more detail 
>> information? Thanks a lot.
> 1. It can be simply detected that on RI, EnumSet.noneOf() or 
> EnumSet.allOf() method will return a concrete EnumSet. This concrete 
> EnumSet provides its own iterator.
> All these iterator related methods are not implemented in BitSet right 
> now.
>
> 2. To support the implementation of EnumSet, more utility methods used 
> to set/unset bits may need to be added.
>
> All these requirements are EnumSet specific, do they need to be 
> implemented in a separate class.
If so (the iterator or so has no value for other classes), I agree to 
use a specific subclass of BitSet for EnumSet's requirement.
>
> Best regards
>>
>> Richard.
>>> Best regards.
>>>
>>
>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message