public class abc1 {
private String s;
public abc1(String s){this.s=s;}
public static void main(String args[])
{
HashSet<Object> hs=new HashSet<Object>();
abc1 a1= new abc1("abc");
abc1 a2= new abc1("abc");
...
import java.io.*;
import java.util.*;
class StepfordHouses {
private ArrayList<Integer> houses; // A list containing houses
private TreeSet<Integer> ordered; // An ordered treeset of houses
...
I'm migrating some code over to GNU trove for performance reasons.
However, I do have some TreeSets, where I need rather fast update and lookups along with a sorted iteration - the ...
Note that the ordering maintained by a set (whether or not an explicit comparator is provided) must be consistent with equals if it is to correctly implement the Set interface. (See Comparable or Comparator for a precise definition of consistent with equals.) This is so because the Set interface is defined in terms of the equals operation, but a TreeSet instance ...
@ejp: sorry but i don't understand how Set could resolve my problem of using BitSet with more than Integer.MAX bit ? . I can implement one that use long array ( long[] data ) to store the data of BitSet, long type for index, so the max of bit support is about : MAX_ARRAY_LENGTH x sizeof(long) x 8 = 137.438.953.472 (bit) ...
UPDATE: I just remembered a post by Baftos suggesting a custom bitoutputstream class. I could use that together with a ByteArrayOutputStream and double buffer my way through the data, avoiding the use of BitSet altogether. Still, if using BitSet is noticeably advantageous, and just for curiousity's sake I'm still interested in the answer to this question. Edited by: mzatanoskas on Mar ...