fr.paris.lutece.plugins.address.util
Class LibraryAddressUtils

java.lang.Object
  extended by fr.paris.lutece.plugins.address.util.LibraryAddressUtils

public final class LibraryAddressUtils
extends Object

Utils methods for library address


Field Summary
static String CONSTANT_CLOSE_PARENTHESIS
           
static String CONSTANT_COMA
           
static String CONSTANT_MULTI_SPACE
           
static String CONSTANT_ONE_SPACE
           
static String CONSTANT_OPEN_PARENTHESIS
           
static String VALID_GEOMETRY_REGEX
           
 
Method Summary
static void fillAddressGeolocation(Adresse adresse, String strGeometry)
          Fills the address with x and y geolocation using strGeometry.
static boolean isTerminateByApostrophe(String strTypeVoie)
          Test strTypeVoie is termitate by a value of list strListValuesTerminator
static String normalizeAddress(Adresse adresse)
          String representation of the adresse
static int parseInt(String strValue)
          Parse a long
static int parseInt(String strValue, int nDefaultValue)
          Parse a long
static long parseLong(String strValue)
          Parse a long
static long parseLong(String strValue, long nDefaultValue)
          Parse a long
static String removeMultiSpace(String strChaine)
          Replace a sequence of space by one space
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_COMA

public static final String CONSTANT_COMA
See Also:
Constant Field Values

CONSTANT_MULTI_SPACE

public static final String CONSTANT_MULTI_SPACE
See Also:
Constant Field Values

CONSTANT_ONE_SPACE

public static final String CONSTANT_ONE_SPACE
See Also:
Constant Field Values

CONSTANT_OPEN_PARENTHESIS

public static final String CONSTANT_OPEN_PARENTHESIS
See Also:
Constant Field Values

CONSTANT_CLOSE_PARENTHESIS

public static final String CONSTANT_CLOSE_PARENTHESIS
See Also:
Constant Field Values

VALID_GEOMETRY_REGEX

public static final String VALID_GEOMETRY_REGEX
See Also:
Constant Field Values
Method Detail

removeMultiSpace

public static String removeMultiSpace(String strChaine)
Replace a sequence of space by one space

Parameters:
strChaine - the chaine
Returns:
the chaine with one space beetween words

isTerminateByApostrophe

public static boolean isTerminateByApostrophe(String strTypeVoie)
Test strTypeVoie is termitate by a value of list strListValuesTerminator

Parameters:
strTypeVoie - the type voie to test
Returns:
true if a value of strTypeVoie is terminate by a value of list strListValuesTerminator

parseLong

public static long parseLong(String strValue)
Parse a long

Parameters:
strValue - the value to parse
Returns:
the long value of strValue, -1 otherwise.

parseLong

public static long parseLong(String strValue,
                             long nDefaultValue)
Parse a long

Parameters:
strValue - the value to parse
nDefaultValue - the default value
Returns:
the long value of strValue, nDefaultValue otherwise.

parseInt

public static int parseInt(String strValue)
Parse a long

Parameters:
strValue - the value to parse
Returns:
the int value of strValue, -1 otherwise.

parseInt

public static int parseInt(String strValue,
                           int nDefaultValue)
Parse a long

Parameters:
strValue - the value to parse
nDefaultValue - the default value
Returns:
the int value of strValue, nDefaultValue otherwise.

fillAddressGeolocation

public static void fillAddressGeolocation(Adresse adresse,
                                          String strGeometry)
Fills the address with x and y geolocation using strGeometry. POINT (123.456789 987.654321) will give x = 123.456789 and y = 987.654321. Set x and y to 0 if x or y is not a number.

Parameters:
adresse - the address to fill
strGeometry - the geometry string

normalizeAddress

public static String normalizeAddress(Adresse adresse)
String representation of the adresse

Parameters:
adresse - the adresse
Returns:
the string


Copyright © 2014 Mairie de Paris. All Rights Reserved.