Back to project page yellowpages-android-tdd.
The source code is released under:
MIT License
If you think the Android project yellowpages-android-tdd listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.tddrampup.singletons; /*from w w w. ja va 2s .c o m*/ import com.tddrampup.models.Listing; import java.util.ArrayList; import java.util.List; /** * Created by WX009-PC on 2/19/14. */ public class Listings { private static Listings mInstance = null; private List<Listing> mListings; private Listing mListing; private Listings() { mListings = new ArrayList<Listing>(); mListing = new Listing(); } public static Listings getInstance(){ if(mInstance == null) { mInstance = new Listings(); } return mInstance; } public List<Listing> getListings(){ return this.mListings; } public void setListings(List<Listing> value){ mListings = value; } public Listing getListing(String id){ for (Listing item: mListings){ if (item.getId().toString().equals(id)){ return item; } } return null; } }