Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework.interfaces
Interface ITokenizer

All Superinterfaces:
Enumeration

public interface ITokenizer
extends Enumeration

The ITokenizer interface defines the API for an optimized String tokenizer class. An instance of ITokenizer can be created using the FactoryUtility singleton.

 String value = ...
 FactoryUtility utility = FactoryUtility.getInstance();
 ITokenizer tokenizer = utility.createTokenizer(value);
 
This API is designed such that it should be easy to use, especially if you are familiar with the Enumeration interface or the StringTokenizer class.
 while (tokenizer.hasMoreTokens() == true) {
   String token = tokenizer.nextToken();
   ...
 }
 
The need for this abstraction was identified after measuring the performance of an OSGi application built using SAT and identifying that using the standard Java class StringTokenizer was taking an excessive amount of time.

See Also:
FactoryUtility

Method Summary
 boolean hasMoreTokens()
          Query whether there are more tokens.
 String nextToken()
          Get the next token.
 ITokenizer toSynchronizedTokenizer()
          Answers a thread-safe version of the tokenizer.
 
Methods inherited from interface java.util.Enumeration
hasMoreElements, nextElement
 

Method Detail

hasMoreTokens

boolean hasMoreTokens()
Query whether there are more tokens.

Returns:
boolean

nextToken

String nextToken()
Get the next token.

Returns:
String

toSynchronizedTokenizer

ITokenizer toSynchronizedTokenizer()
Answers a thread-safe version of the tokenizer.

Returns:
A tokenizer.

Service Activator Toolkit
Version 1.1.0 (20081206)