Back to project page LearnByHeart.
The source code is released under:
Apache License
If you think the Android project LearnByHeart 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.mps.learn.pb.model; /*from www. j a va2 s . c o m*/ import com.mps.learn.pb.PhraseManager; public class PhraseModel { private long id; private int imageId; private String title; private String usagePunjabi; private String usageEnglish; private String resourceUrl; public final static String TYPE_LOCAL_URL = "local"; public final static String DELIMITER = "-"; private long updated; private final String TAG_ENGLISH = "(en) "; private final String TAG_PUNJABI = "(pb) "; public PhraseModel(){ } public PhraseModel(String title, String usagePunjabi, String usageEnglish, String resourceUrl) { this.setTitle(title); this.setUsagePunjabi(usagePunjabi); this.setUsageEnglish(usageEnglish); this.setResourceUrl(resourceUrl); } public int getImageId() { return imageId; } public void setImageId(int imageId) { this.imageId = imageId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getUsagePunjabi() { return usagePunjabi; } public void setUsagePunjabi(String usagePunjabi) { this.usagePunjabi = TAG_PUNJABI + usagePunjabi; } public String getUsageEnglish() { return usageEnglish; } public void setUsageEnglish(String usageEnglish) { this.usageEnglish = TAG_ENGLISH + usageEnglish; } @Override public String toString() { return title + "\n" + usagePunjabi + "\n" + usageEnglish; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getResourceUrl() { if(resourceUrl.contains(TYPE_LOCAL_URL) ){ String[] args = resourceUrl.split(DELIMITER); if(args.length == 2){ this.setImageId(PhraseManager.PHRASE_IMAGES_MAP.get(args[1])); resourceUrl = TYPE_LOCAL_URL; } } return resourceUrl; } public void setResourceUrl(String resourceUrl) { this.resourceUrl = resourceUrl; } public long getUpdated() { return updated; } public void setUpdated(long updated) { this.updated = updated; } }