Sha256: 7f8511f58d1b688ada81870f98fc2e8801b81ab8a657dab2487e272d7f6e665e

Contents?: true

Size: 775 Bytes

Versions: 48

Compression:

Stored size: 775 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++;
		}
		
		return m_str.substring(start,m_position);
	}
	
	public void eatDelimeters() {
		while (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

48 entries across 48 versions & 1 rubygems

Version Path
rhodes-2.3.0 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.3.0.beta.3 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.3.0.beta.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.3.0.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.6 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.6.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.5 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.5.beta.3 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.5.beta.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.5.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.4.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.3 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.3.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.2.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.1.beta.2 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.1.beta.1 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.0 platform/bb/RubyVM/src/com/rho/Tokenizer.java
rhodes-2.2.0.beta.3 platform/bb/RubyVM/src/com/rho/Tokenizer.java