Sha256: 3e419dbcad29768575af18b09479ecf77cad469cbd13a48703f941542d054962

Contents?: true

Size: 882 Bytes

Versions: 28

Compression:

Stored size: 882 Bytes

Contents

package com.rho;

public class Tokenizer {

	String m_str;
	String m_delims;
	int m_length;
	int m_position;
	
	public Tokenizer(String str,String delims) {
		m_delims = delims;
		m_str = str;
		m_length = str.length();
		m_position = 0;
	}
	
	public String nextToken() {
		//eatDelimeters();
		int start = m_position;
		while (m_position<m_length && m_delims.indexOf(m_str.charAt(m_position))==-1) {
			m_position++;
		}
		
		String strToken = m_str.substring(start,m_position);
		eatDelimeters();
		return strToken;
	}
	
	public void eatDelimeters() 
	{
		if ( m_position == m_length )
			m_position++;
		else if (m_position<m_length) {
			char c = m_str.charAt(m_position);
			if (m_delims.indexOf(c)>=0) {
				m_position++;		
			} else {
				return;
			}
			
		}
	}
	
    public boolean hasMoreTokens() {
    	//eatDelimeters();
    	return (m_position <= m_length);
    }
	

}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.2.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.8 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.7 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.6 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.5 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.4 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.3 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.1.beta.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.7 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.6 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.5 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.4 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.3 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-3.0.0.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.4.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.4.1.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java