Code example for StringTokenizer

Methods: hasMoreElements, nextElement

0
		String state = null;
		String id = null;
		String address = null;
		String namespace1 = null;
		StringTokenizer st = new StringTokenizer(Agd.getValue().toString());
		StringTokenizer st1 = new StringTokenizer(Aid.getValue().toString());
		// ad=m.createIndividual(fm.getAcl().getContent().getActions().get(0).getArguments().get(0)); 
		// ad1=m.createIndividual(fm.getAcl().getContent().getActions().get(0).getArguments().get(1)); 
		onto = m.getOntClass("AgentDescription");
		onto1 = m.getOntClass("AgentIdentifier");
 
		while (st.hasMoreElements()) {
			namespace = st.nextElement().toString();
			id = st.nextElement().toString();
			name = st.nextElement().toString();
			ownership = st.nextElement().toString();
			state = st.nextElement().toString();
			break; 
		} 
 
		while (st1.hasMoreElements()) {
			namespace1 = st1.nextElement().toString();
			id = st1.nextElement().toString();
			name = st1.nextElement().toString();
			address = st1.nextElement().toString();
			break; 
		} 
 
		ad = m.createIndividual(namespace, onto);
		ad.addProperty(m.getDatatypeProperty(xmlbase + "id"), id);