1 19 20 package com.maverick.crypto.asn1; 21 22 28 public class OIDTokenizer 29 { 30 private String oid; 31 private int index; 32 33 public OIDTokenizer( 34 String oid) 35 { 36 this.oid = oid; 37 this.index = 0; 38 } 39 40 public boolean hasMoreTokens() 41 { 42 return (index != -1); 43 } 44 45 public String nextToken() 46 { 47 if (index == -1) 48 { 49 return null; 50 } 51 52 String token; 53 int end = oid.indexOf('.', index); 54 55 if (end == -1) 56 { 57 token = oid.substring(index); 58 index = -1; 59 return token; 60 } 61 62 token = oid.substring(index, end); 63 64 index = end + 1; 65 return token; 66 } 67 } 68 | Popular Tags |