Home | History | Annotate | Download | only in res
      1 package org.robolectric.res;
      2 
      3 public class Plural {
      4   final String quantity, string;
      5   final int num;
      6 
      7   Plural(String quantity, String string) {
      8     this.quantity = quantity;
      9     this.string = string;
     10     if ("zero".equals(quantity)) {
     11       num = 0;
     12     } else if ("one".equals(quantity)) {
     13       num = 1;
     14     } else if ("two".equals(quantity)) {
     15       num = 2;
     16     } else if ("other".equals(quantity)) {
     17       num = -1;
     18     } else {
     19       num = -1;
     20     }
     21   }
     22 
     23   public String getString() {
     24     return string;
     25   }
     26 
     27   @Override
     28   public String toString() {
     29     return quantity + "(" + num + "): " + string;
     30   }
     31 }
     32