Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-05-2009
Member
 
Join Date: Nov 2008
Posts: 25
ArrayList and type the return

Hello
i have a probleme with my class essentielly with my method look my class
import java.util.ArrayList;
import java.util.Iterator;

Code:
public class Personne {
	ArrayList persones=new ArrayList<Personne>();
	private long id;
	private String nom="";
	public  long getId(){
		return id;
	}
	public String getNom(){
		return nom;
	}
	public long setId(long id){
		return id=id;
	}
	public String setNom(String nom){
		return nom=nom;
	}
//here the problem the return 
	public String getPersone(){
		Iterator iterateur=persones.iterator();
		while(iterateur.hasNext()){
			long id=((Personne)iterateur.next()).getId();
			String nom=((Personne)iterateur.next()).getNom();
			return id+""+nom;
		}
		return null;
	}
public static void main(String arg[]){
	
	Personne p1=new Personne();
	p1.setNom("Amine");
	p1.setId(0xAA3567B2C4FL);
	Personne p2=new Personne();
	p2.setId(0xAA93B10CD00L);
	p2.setNom("Ali");
	}
}
thanks
Reply With Quote
  #2  
Old 09-05-2009
Member
 
Join Date: Jun 2006
Posts: 620
Re: ArrayList and type the return

Service operations can only operate on concrete implementations. This is not a limitation of WCF, this is a limitation (or, feature) of WSDL. So, if you want to accept any type to a generic Load() operation, and specify the type in the call, you'll have to design a contract that receives the type T as a parameter, and returns a List<object> or object[] that is an array of that type. I think you are fixated on the syntax looking like remoting, and generics...when what you really want is a solution that fits with semantics of service design.

Why not this?

List<object> Load(string objectType);
Reply With Quote
  #3  
Old 09-05-2009
Member
 
Join Date: Nov 2008
Posts: 25
Re: ArrayList and type the return

thanks ,
my probleme concerne my methode getPersonne returns the id and name
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "ArrayList and type the return"
Thread Thread Starter Forum Replies Last Post
Content Type | Mime Type for Office 2010 file format and extension ramsun Tips & Tweaks 1 16-08-2010 05:25 PM
Content Type | Mime Type for Office 2007 file format and extension D_chapple Tips & Tweaks 1 16-08-2010 04:44 PM
Implement the return type in java Captain Carrot Software Development 4 25-03-2010 01:34 PM
Incorrect return of ArrayList Gunner 1 Software Development 5 13-02-2010 04:34 AM
Static types can we used as return type ComPaCt Software Development 2 12-06-2009 03:37 PM


All times are GMT +5.5. The time now is 10:12 AM.