Android Open Source - TATupload Property






From Project

Back to project page TATupload.

License

The source code is released under:

GNU General Public License

If you think the Android project TATupload listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package uk.org.sucu.tatupload.parse;
//w  w  w.java  2s.co m
import java.util.ArrayList;

public class Property {

  private String primary;
  private ArrayList<String> alternatives;

  //Constructors
  public Property(String p){
    primary = p;
    alternatives = new ArrayList<String>();
  }
  public Property(String p, ArrayList<String> alt){
    primary = p;
    alternatives = alt;
  }

  //Accessors
  public String getPrimary(){
    return primary;
  }
  public ArrayList<String> getAlternatives(){
    return alternatives;
  }

  public void changePrimary(String replacement){
    primary = replacement;
  }
  public void removeAlternate(String toRemove){
    alternatives.remove(toRemove);
  }
  public void addAlternate(String toAdd){
    if(!alternatives.contains(toAdd)){
      alternatives.add(toAdd);
    }
  }

  //passed string exactly matches the property (or an alternate)
  public boolean isMatchedBy(String toCheck){
    if (primary.equals(toCheck)){
      return true;
    }
    for(String s : alternatives){
      if(s.equals(toCheck)){
        return true;
      }
    }
    return false;
  }

  //passed string contains the property (or an alternate)
  public boolean isContainedBy(String container){
    if(container.contains(primary)){
      return true;
    }
    for(String s: alternatives){
      if(container.contains(s)){
        return true;
      }
    }
    return false;
  }

}




Java Source Code List

org.apache.pig.impl.util.ObjectSerializer.java
uk.org.sucu.tatupload.BrowserAccessor.java
uk.org.sucu.tatupload.MessageArrayAdapter.java
uk.org.sucu.tatupload.NetCaller.java
uk.org.sucu.tatupload.Notifications.java
uk.org.sucu.tatupload.ParameterArrayAdapter.java
uk.org.sucu.tatupload.ResolveInfoArrayAdapter.java
uk.org.sucu.tatupload.Settings.java
uk.org.sucu.tatupload.TabContent.java
uk.org.sucu.tatupload.TabManager.java
uk.org.sucu.tatupload.TatUploadApplication.java
uk.org.sucu.tatupload.activity.MainActivity.java
uk.org.sucu.tatupload.activity.OptionActivity.java
uk.org.sucu.tatupload.activity.ParameterViewActivity.java
uk.org.sucu.tatupload.activity.SmsReviewActivity.java
uk.org.sucu.tatupload.activity.TutorialActivity.java
uk.org.sucu.tatupload.message.SmsList.java
uk.org.sucu.tatupload.message.SmsReceiver.java
uk.org.sucu.tatupload.message.Text.java
uk.org.sucu.tatupload.parse.Parameters.java
uk.org.sucu.tatupload.parse.Parser.java
uk.org.sucu.tatupload.parse.Property.java