com.esri.arcgis.geoprocessing
Class GPParseString

java.lang.Object
  extended by com.esri.arcgis.geoprocessing.GPParseString
All Implemented Interfaces:
IGPParseString, IGPParseString2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class GPParseString
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGPParseString, IGPParseString2

Helper class used to parse strings based upon a token separator.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
GPParseString()
          Constructs a GPParseString using ArcGIS Engine.
GPParseString(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
GPParseString theGPParseString = (GPParseString) obj;
 
Method Summary
 String checkToken(String inChar, boolean[] pInQuote, boolean[] pTokenDone)
          Builds a string, one character at a time, returning whether that character is quoted and whether that character is the end of delimited token.
 String doubleToString(double value)
          Returns the double value as string.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void initialize(String string, String separator)
          Initializes the geoprocessing parse string object with the string to be parsed and the string used to separate tokens.
 boolean isNextTokenQuoted()
          Returns whether the next token to be parsed is enclosed in quotation marks.
 boolean needsQuote(String text)
          Returns if the string needs to be quoted.
 boolean nextBoolean()
          Returns the next token parsed from the string as a boolean.
 double nextDouble()
          Returns the next token parsed from the string as a double.
 int nextLong()
          Returns the next token parsed from the string as a long.
 String nextSimpleToken()
          Returns the next simple token parsed from the string.
 String nextToken()
          Returns the next token parsed from the string.
 String quoteString(String text)
          Quotes the string if it needs to be quoted.
 String remainingText()
          Returns the remaining string.
 double stringToDouble(String text)
          Returns the string as a doulbe value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

GPParseString

public GPParseString()
              throws IOException,
                     UnknownHostException
Constructs a GPParseString using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

GPParseString

public GPParseString(Object obj)
              throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
GPParseString theGPParseString = (GPParseString) obj;

Construct a GPParseString using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to GPParseString.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

initialize

public void initialize(String string,
                       String separator)
                throws IOException,
                       AutomationException
Initializes the geoprocessing parse string object with the string to be parsed and the string used to separate tokens.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
initialize in interface IGPParseString
Specified by:
initialize in interface IGPParseString2
Parameters:
string - The string (in)
separator - The separator (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextToken

public String nextToken()
                 throws IOException,
                        AutomationException
Returns the next token parsed from the string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
nextToken in interface IGPParseString
Specified by:
nextToken in interface IGPParseString2
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextSimpleToken

public String nextSimpleToken()
                       throws IOException,
                              AutomationException
Returns the next simple token parsed from the string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
nextSimpleToken in interface IGPParseString
Specified by:
nextSimpleToken in interface IGPParseString2
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isNextTokenQuoted

public boolean isNextTokenQuoted()
                          throws IOException,
                                 AutomationException
Returns whether the next token to be parsed is enclosed in quotation marks.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
isNextTokenQuoted in interface IGPParseString
Specified by:
isNextTokenQuoted in interface IGPParseString2
Returns:
The quoted
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

checkToken

public String checkToken(String inChar,
                         boolean[] pInQuote,
                         boolean[] pTokenDone)
                  throws IOException,
                         AutomationException
Builds a string, one character at a time, returning whether that character is quoted and whether that character is the end of delimited token.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
checkToken in interface IGPParseString
Specified by:
checkToken in interface IGPParseString2
Parameters:
inChar - The inChar (in)
pInQuote - The pInQuote (out: use single element array)
pTokenDone - The pTokenDone (out: use single element array)
Returns:
The pToken
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

remainingText

public String remainingText()
                     throws IOException,
                            AutomationException
Returns the remaining string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
remainingText in interface IGPParseString2
Returns:
The text
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextDouble

public double nextDouble()
                  throws IOException,
                         AutomationException
Returns the next token parsed from the string as a double.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
nextDouble in interface IGPParseString2
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextLong

public int nextLong()
             throws IOException,
                    AutomationException
Returns the next token parsed from the string as a long.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
nextLong in interface IGPParseString2
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextBoolean

public boolean nextBoolean()
                    throws IOException,
                           AutomationException
Returns the next token parsed from the string as a boolean.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
nextBoolean in interface IGPParseString2
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

needsQuote

public boolean needsQuote(String text)
                   throws IOException,
                          AutomationException
Returns if the string needs to be quoted.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
needsQuote in interface IGPParseString2
Parameters:
text - The text (in)
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

quoteString

public String quoteString(String text)
                   throws IOException,
                          AutomationException
Quotes the string if it needs to be quoted.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
quoteString in interface IGPParseString2
Parameters:
text - The text (in)
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stringToDouble

public double stringToDouble(String text)
                      throws IOException,
                             AutomationException
Returns the string as a doulbe value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
stringToDouble in interface IGPParseString2
Parameters:
text - The text (in)
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

doubleToString

public String doubleToString(double value)
                      throws IOException,
                             AutomationException
Returns the double value as string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
doubleToString in interface IGPParseString2
Parameters:
value - The value (in)
Returns:
The token
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.