I have a SortedSet defined this way:
SortedSet<RatedMessage> messageCollection = new TreeSet<RatedMessage>(new Comp());
and I have an array of RatedMessage[]
I had to use the array as the set misses the serialization feature, ... |
I have this before the process:
protected void onPostExecute(SortedSet<RatedMessage> result) {
List<Object> list=Arrays.asList(result.toArray());
lancon.putExtra("results", list.toArray()); // as serializable
}
then in the other part I have
Object o=this.getIntent().getSerializableExtra("results");
//at this ...
|
I've written a class called PuzzleBoard that represents an nxn board. I will be keeping several PuzzleBoard objects in a HashSet, so I have to overwrite the 'int hashCode()' method.
Below are ... |
I am having trouble adding an item to my array set, it should be ordered in ascending order and for some reason I just get to add it and it does ... |
I have:
public byte[] bytes = new byte[5]; //BitComp Class
public BitSet bits = new BitSet(40);
and the getters and setters in class named BitComp. The following class ... |
I have a HashSet of Character and I am trying to do:
Collections.addAll(mySet, test.toCharArray());
mySet.addAll(test.toCharArray());
why is it saying it is not applicable? How do I ... |
I've got following array:
private static Optreden[] optredens = {
new Optreden("Editors", "Main Stage", 16, 0, 4),
...
|
|
I had a HashSet and i stored the content of it in a String using .toString(). Is there any simple way to get the String back into a HashSet?
I saved some ... |
The Java Bitset class is dynamic and its size changes accordinly with the bits ON in it. But Byte array can hold specific number of bits and it is easy to ... |
Originally posted by Rob Prime: 1) You are adding the exact same instance of the string array to the set. Because it is a set, there will always be only one element. 2) See Ernest's comment; this also solves issue 1. 3) You can use Arrays.toString(...) to nicely print an array. Ok, I was in a hurry yesterday so I'll try ... |
Gurus I am pondering weather to use TreeSet vs the Collections.sort / Array.sort for sorting Strings. Basically I have a list of Strings, i need to perform the following operations on these Strings 1) Able to list Strings starting with a Prefix 2) Able to list Strings Lexically greater than a String Any help would be greatly appreciated! Thanks a bunch ... |
Hi there, I have a custom java object with the attribute - (String name) used in the equals/hashCode method for determining the uniqueness. Accordingly I build a Hashset of unique objects of the Custom class. This hashset is a collection of the unique custom objects. What I want to grab is String array of only the unique identifier (i.e. attribute name). ... |
Hello ALL I have got 2 method: 1st - Returns Set which contains an array 2nd - Takes returned value from 1st method as HashSet argument. Then I need to find consecutive numbers like 1,2 in order to find the numbers I need to first loop through the HashSet, but there is no length, so how do I do it ... |
|
|
|
|