|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITokenizer
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.
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 |
---|
boolean hasMoreTokens()
boolean
String nextToken()
String
ITokenizer toSynchronizedTokenizer()
|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001, 2008 IBM Corporation and others. All Rights Reserved.