473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to sort an ArrayList of object depending on a field object

momotaro
357 Contributor
Hi,

having this class:
Expand|Select|Wrap|Line Numbers
  1. public class Field {
  2.  
  3.     private boolean isPersisted = true;
  4.     private String name;
  5.     private String type;
  6.     private String elements;
  7. ...
  8.     }
I have constructed an ArrayList of Field then I want to put objects with isPersisted set to false to the tail of my list

thank's in advance.
Aug 3 '11 #1
2 1938
momotaro
357 Contributor
would be great if you show me how to use treeSets
Aug 3 '11 #2
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
You can use Comparator available in Java.
Create a comparator class for field object and try comparing.

Regards
Dheeraj Joshi
Aug 3 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3152
by: Lorenzo Bolognini | last post by:
Hi all, why is the DefinedSize of the Field object of type adInteger returning the value 4 and the same property on a adVarWChar type field (Text in MS Access) is returning the max length of the...
2
1575
by: Danny | last post by:
HI, I am trying to do a group by such as this: "select code, colors from productdb group by code, colors" I need to sort on the key field, but cannot throw in the 'ordre by key', because i...
3
1998
by: Bradley | last post by:
Hi I have an ArrayList populated with some objects. Each object has some properties, and I'd like to find the ArrayList's index where the object's "SerialNumber" property is equal to a certain...
0
1821
by: a | last post by:
I need to create an instance of a custom object 'School.Teacher' and use it in a Profile object. I'm developing a bad case of "Pretzel Logic" thinking about this. Filling the custom object ...
1
2328
by: Nelly | last post by:
Please help! I am trying to sort a query by a field calculated as e.g. / I keep getting an error about subqueries not allowed for this type of expression, but only when I set to sort. I...
5
1465
by: blisspikle | last post by:
I figure that someone good at dotnet can look at this and give me a clue on how to easily organize this code? If there is a unique identifier like "Publisher" with a bunch of "Book" that are...
20
13287
by: Justin Rich | last post by:
so im trying to be good and not leave anything hanging open but i guess ive seen a variety of ways to kill objects.. is there like a recommended way? basically im looking for best practices for...
10
18880
EJaques
by: EJaques | last post by:
(Using Access 2003) I have a an Object OLE field in a table where users can insert Excel sheets, Word Docs, Pdfs etc. I need to create a button on a formulaire that allows the user to browse...
1
1986
by: HELENO | last post by:
Hi, I am designing a report for a world cup fantasy team competition that I have created in Access 97. Each entrant must pick 11 players, who can earn points, and i need the sum of all these...
0
1465
by: Andrew Castro | last post by:
I have a program written in VB that loads an SWF object. The SWF object contains a field, in which I would like to load text to. The field is not focused when the SWF is loaded, either. I do not know...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.