42 * 43 * @author Amit Kapoor 44 * @author Hemma Prafullchandra 45 * @author Andreas Sterbenz 46 */ 47 public class GeneralSubtrees implements Cloneable { 48 49 private final List<GeneralSubtree> trees; 50 51 // Private variables 52 private static final int NAME_DIFF_TYPE = GeneralNameInterface.NAME_DIFF_TYPE; 53 private static final int NAME_MATCH = GeneralNameInterface.NAME_MATCH; 54 private static final int NAME_NARROWS = GeneralNameInterface.NAME_NARROWS; 55 private static final int NAME_WIDENS = GeneralNameInterface.NAME_WIDENS; 56 private static final int NAME_SAME_TYPE = GeneralNameInterface.NAME_SAME_TYPE; 57 58 /** 59 * The default constructor for the class. 60 */ 61 public GeneralSubtrees() { 62 trees = new ArrayList<GeneralSubtree>(); 63 } 64 65 private GeneralSubtrees(GeneralSubtrees source) { 66 trees = new ArrayList<GeneralSubtree>(source.trees); 67 } 68 69 /** 70 * Create the object from the passed DER encoded form. 71 * 72 * @param val the DER encoded form of the same. 73 */ 74 public GeneralSubtrees(DerValue val) throws IOException { 75 this(); 76 if (val.tag != DerValue.tag_Sequence) { 77 throw new IOException("Invalid encoding of GeneralSubtrees."); 78 } 79 while (val.data.available() != 0) { 80 DerValue opt = val.data.getDerValue(); 81 GeneralSubtree tree = new GeneralSubtree(opt); 82 add(tree); 83 } 84 } 85 86 public GeneralSubtree get(int index) { | 42 * 43 * @author Amit Kapoor 44 * @author Hemma Prafullchandra 45 * @author Andreas Sterbenz 46 */ 47 public class GeneralSubtrees implements Cloneable { 48 49 private final List<GeneralSubtree> trees; 50 51 // Private variables 52 private static final int NAME_DIFF_TYPE = GeneralNameInterface.NAME_DIFF_TYPE; 53 private static final int NAME_MATCH = GeneralNameInterface.NAME_MATCH; 54 private static final int NAME_NARROWS = GeneralNameInterface.NAME_NARROWS; 55 private static final int NAME_WIDENS = GeneralNameInterface.NAME_WIDENS; 56 private static final int NAME_SAME_TYPE = GeneralNameInterface.NAME_SAME_TYPE; 57 58 /** 59 * The default constructor for the class. 60 */ 61 public GeneralSubtrees() { 62 trees = new ArrayList<>(); 63 } 64 65 private GeneralSubtrees(GeneralSubtrees source) { 66 trees = new ArrayList<>(source.trees); 67 } 68 69 /** 70 * Create the object from the passed DER encoded form. 71 * 72 * @param val the DER encoded form of the same. 73 */ 74 public GeneralSubtrees(DerValue val) throws IOException { 75 this(); 76 if (val.tag != DerValue.tag_Sequence) { 77 throw new IOException("Invalid encoding of GeneralSubtrees."); 78 } 79 while (val.data.available() != 0) { 80 DerValue opt = val.data.getDerValue(); 81 GeneralSubtree tree = new GeneralSubtree(opt); 82 add(tree); 83 } 84 } 85 86 public GeneralSubtree get(int index) { |