jpayne@68: package icecream; jpayne@68: jpayne@68: import shared.Parse; jpayne@68: jpayne@68: public class PBHeader { jpayne@68: jpayne@68: public PBHeader(String s){ jpayne@68: setFrom(s); jpayne@68: } jpayne@68: jpayne@68: //m64021_190821_100154/102/32038_35649 jpayne@68: //m64021_190821_100154 is run id jpayne@68: //102 is zmw id jpayne@68: //32038_35649 are movie coordinates jpayne@68: //This function allows extra stuff like whitespace after the end of the formal header. jpayne@68: public void setFrom(final String header){ jpayne@68: original=header; jpayne@68: int slash1=header.indexOf('/'); jpayne@68: assert(slash1>=0) : "Misformatted PBHeader: "+header; jpayne@68: int slash2=header.indexOf('/', slash1+1); jpayne@68: assert(slash2>=0) : "Misformatted PBHeader: "+header; jpayne@68: int under3=header.indexOf('_', slash2+1); jpayne@68: assert(under3>=0) : "Misformatted PBHeader: "+header; jpayne@68: int terminator=under3+1; jpayne@68: while(terminator=0) : "Misformatted PBHeader: "+header; jpayne@68: int slash2=header.indexOf('/', slash1+1); jpayne@68: assert(slash2>=0) : "Misformatted PBHeader: "+header; jpayne@68: int zmwID=Parse.parseInt(header, slash1+1, slash2); jpayne@68: return zmwID; jpayne@68: } jpayne@68: jpayne@68: public String original; jpayne@68: public String runID; jpayne@68: public int zmwID; jpayne@68: public int start; jpayne@68: public int stop; jpayne@68: jpayne@68: }