org.geotools.resources
Class WKTElement

java.lang.Object
  extended byorg.geotools.resources.WKTElement

Deprecated. Rempaced by Element.

public final class WKTElement
extends java.lang.Object

An element in a Well Know Text (WKT). A WKTElement is made of String, Number and other WKTElement. For example:

 PRIMEM["Greenwich", 0.0, AUTHORITY["some authority", "Greenwich"]]
 
Each WKTElement object can contains an arbitrary amount of other elements. The result is a tree, which can be printed with print(java.io.PrintWriter, int). Elements can be pull in a first in, first out order.

Version:
$Id: WKTElement.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Remi Eve, Martin Desruisseaux

Field Summary
 java.lang.String keyword
          Deprecated. Keyword of this entity.
 
Method Summary
 void close()
          Deprecated. Close this element.
 java.text.ParseException parseFailed(java.lang.Exception cause, java.lang.String message)
          Deprecated. Returns a ParseException with the specified cause.
 java.lang.Object peek()
          Deprecated. Returns the next element, or null if there is no more element.
 void print(java.io.PrintWriter out, int level)
          Deprecated. Print this WKTElement as a tree.
 double pullDouble(java.lang.String key)
          Deprecated. Removes the next Number from the list and returns it.
 WKTElement pullElement(java.lang.String key)
          Deprecated. Removes the next WKTElement from the list and returns it.
 int pullInteger(java.lang.String key)
          Deprecated. Removes the next Number from the list and returns it as an integer.
 WKTElement pullOptionalElement(java.lang.String key)
          Deprecated. Removes the next WKTElement from the list and returns it.
 java.lang.String pullString(java.lang.String key)
          Deprecated. Removes the next String from the list and returns it.
 WKTElement pullVoidElement(java.lang.String key)
          Deprecated. Removes and returns the next WKTElement with no bracket.
 java.lang.String toString()
          Deprecated. Returns the keyword.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

keyword

public final java.lang.String keyword
Deprecated. 
Keyword of this entity. For example: "PRIMEM".

Method Detail

parseFailed

public java.text.ParseException parseFailed(java.lang.Exception cause,
                                            java.lang.String message)
Deprecated. 
Returns a ParseException with the specified cause. A localized string "Error in <keyword>" will be prepend to the message. The error index will be the starting index of this WKTElement.

Parameters:
cause - The cause of the failure, or null if none.
message - The message explaining the cause of the failure, or null for reusing the same message than cause.
Returns:
The exception to be thrown.

pullDouble

public double pullDouble(java.lang.String key)
                  throws java.text.ParseException
Deprecated. 
Removes the next Number from the list and returns it.

Parameters:
key - The parameter name. Used for formatting an error message if no number are found.
Returns:
The next Number on the list as a double.
Throws:
java.text.ParseException - if no more number is available.

pullInteger

public int pullInteger(java.lang.String key)
                throws java.text.ParseException
Deprecated. 
Removes the next Number from the list and returns it as an integer.

Parameters:
key - The parameter name. Used for formatting an error message if no number are found.
Returns:
The next Number on the list as an int.
Throws:
java.text.ParseException - if no more number is available, or the number is not an integer.

pullString

public java.lang.String pullString(java.lang.String key)
                            throws java.text.ParseException
Deprecated. 
Removes the next String from the list and returns it.

Parameters:
key - The parameter name. Used for formatting an error message if no number are found.
Returns:
The next String on the list.
Throws:
java.text.ParseException - if no more string is available.

pullElement

public WKTElement pullElement(java.lang.String key)
                       throws java.text.ParseException
Deprecated. 
Removes the next WKTElement from the list and returns it.

Parameters:
key - The element name (e.g. "PRIMEM").
Returns:
The next WKTElement on the list.
Throws:
java.text.ParseException - if no more element is available.

pullOptionalElement

public WKTElement pullOptionalElement(java.lang.String key)
Deprecated. 
Removes the next WKTElement from the list and returns it.

Parameters:
key - The element name (e.g. "PRIMEM").
Returns:
The next WKTElement on the list, or null if no more element is available.

pullVoidElement

public WKTElement pullVoidElement(java.lang.String key)
                           throws java.text.ParseException
Deprecated. 
Removes and returns the next WKTElement with no bracket. The key is used only for only for formatting an error message.

Parameters:
key - The parameter name. Used only for formatting an error message.
Returns:
The next WKTElement in the list, with no bracket.
Throws:
java.text.ParseException - if no more void element is available.

peek

public java.lang.Object peek()
Deprecated. 
Returns the next element, or null if there is no more element. The element is not removed from the list.


close

public void close()
           throws java.text.ParseException
Deprecated. 
Close this element.

Throws:
java.text.ParseException - If the list still contains some unprocessed elements.

toString

public java.lang.String toString()
Deprecated. 
Returns the keyword. This overriding is needed for correct formatting of the error message in close().


print

public void print(java.io.PrintWriter out,
                  int level)
Deprecated. 
Print this WKTElement as a tree. This method is used for debugging purpose only.

Parameters:
out - The output stream.
level - The indentation level (usually 0).


Copyright © GeoTools. All Rights Reserved.