• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.robolectric.res;
2 
3 import java.util.List;
4 
5 public class PluralRules extends TypedResource<List<Plural>> {
PluralRules(List<Plural> data, ResType resType, XmlContext xmlContext)6   public PluralRules(List<Plural> data, ResType resType, XmlContext xmlContext) {
7     super(data, resType, xmlContext);
8   }
9 
find(int quantity)10   public Plural find(int quantity) {
11     for (Plural p : getData()) {
12       if (p.num == quantity && p.usedInEnglish) return p;
13     }
14     for (Plural p : getData()) {
15       if (p.num == -1) return p;
16     }
17     return null;
18   }
19 }
20