fr.imag.adele.util.location
Class LocationUtil

java.lang.Object
  extended byfr.imag.adele.util.location.LocationUtil

public class LocationUtil
extends Object

this class provides methods to format location, coordinates and map server links for following formats: (Plain)Text, Html, Xml, JavaScript
TODO:

Version:
0.1, 29 march 2003
Author:
Didier Donsez (Didier.Donsez@ieee.org)

Constructor Summary
LocationUtil()
           
 
Method Summary
static String formatDate(long date)
           
static String getMethodLocationMeaning(int methodLocation)
          gets the Method Location Meaning
static Element toElement(Document doc, Coordinates coordinates)
          formats the location in XML (DOM)
static Element toElement(Document doc, Location location)
          formats the location in XML (DOM)
static StringBuffer toHtml(StringBuffer sb, Coordinates coordinates)
          formats the coordinates in HTML
static StringBuffer toHtml(StringBuffer sb, Location location)
          formats the location in HTML
static StringBuffer toJavaScript(StringBuffer sb, Coordinates coordinates)
          formats the coordinates in JavaScript
static StringBuffer toJavaScript(StringBuffer sb, Location location)
          formats the location in JavaScript
static StringBuffer toText(StringBuffer sb, Coordinates coordinates)
          formats the coordinates in PlainText
static StringBuffer toText(StringBuffer sb, Location location)
          formats the location in PlainText
static StringBuffer toXml(StringBuffer sb, Coordinates coordinates)
          formats the coordinates in XML
static StringBuffer toXml(StringBuffer sb, Location location)
          formats the location in XML (textual)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationUtil

public LocationUtil()
Method Detail

toText

public static StringBuffer toText(StringBuffer sb,
                                  Location location)
formats the location in PlainText

Parameters:
sb - a String Buffer to append (could be null)
location - the location
Returns:
sb (created if sb is null)

toHtml

public static StringBuffer toHtml(StringBuffer sb,
                                  Location location)
formats the location in HTML

Parameters:
sb - a String Buffer to append (could be null)
location - the location
Returns:
sb (created if sb is null)

toXml

public static StringBuffer toXml(StringBuffer sb,
                                 Location location)
formats the location in XML (textual)

Parameters:
sb - a String Buffer to append (could be null)
location - the location
Returns:
sb (created if sb is null)

toElement

public static Element toElement(Document doc,
                                Location location)
formats the location in XML (DOM)

Parameters:
doc - the document
location - the location
Returns:
the element created

toJavaScript

public static StringBuffer toJavaScript(StringBuffer sb,
                                        Location location)
formats the location in JavaScript

Parameters:
sb - a String Buffer to append (could be null)
location - the location
Returns:
sb (created if sb is null)

toText

public static StringBuffer toText(StringBuffer sb,
                                  Coordinates coordinates)
formats the coordinates in PlainText

Parameters:
sb - a String Buffer to append (could be null)
coordinates - the coordinates
Returns:
sb (created if sb is null)

toHtml

public static StringBuffer toHtml(StringBuffer sb,
                                  Coordinates coordinates)
formats the coordinates in HTML

Parameters:
sb - a String Buffer to append (could be null)
coordinates - the coordinates
Returns:
sb (created if sb is null)

toXml

public static StringBuffer toXml(StringBuffer sb,
                                 Coordinates coordinates)
formats the coordinates in XML

Parameters:
sb - a String Buffer to append (could be null)
coordinates - the coordinates
Returns:
sb (created if sb is null)

toElement

public static Element toElement(Document doc,
                                Coordinates coordinates)
formats the location in XML (DOM)

Parameters:
doc - the document
Returns:
the element created

toJavaScript

public static StringBuffer toJavaScript(StringBuffer sb,
                                        Coordinates coordinates)
formats the coordinates in JavaScript

Parameters:
sb - a String Buffer to append (could be null)
coordinates - the coordinates
Returns:
sb (created if sb is null)

getMethodLocationMeaning

public static String getMethodLocationMeaning(int methodLocation)
gets the Method Location Meaning

Parameters:
methodLocation - the code of the Method Location
Returns:
the textual meaning

formatDate

public static String formatDate(long date)