jwo.vfc.hub
Class HubUtils

java.lang.Object
  |
  +--jwo.vfc.hub.HubUtils

public class HubUtils
extends Object

A collection of static text utilities for text processing.

Version:
1.2.3, 13th November, 1999
Author:
Jo Wood.

Field Summary
static float VERSION
          Current version of the hub client and requests.
 
Constructor Summary
HubUtils()
           
 
Method Summary
static String getNatGrid(int easting, int northing)
          Converts national grid reference (eg 338500, 510500) to letter and digit reference (eg NY 38500 10500).
static Point getNatGrid(String letters, int easting, int northing)
          Converts national grid from letters and digits (eg NY 38500 10500) to all digits (eg 338500, 510500).
static String replace(String text, String oldWord, String newWord)
          Replaces all occurrances of oldWord with newWord in a given string.
static String replace(String text, String oldWord, String newWord, boolean caseSensitive)
          Replaces all occurrances of oldWord with newWord in a given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final float VERSION
Current version of the hub client and requests.

See Also:
Constant Field Values
Constructor Detail

HubUtils

public HubUtils()
Method Detail

replace

public static String replace(String text,
                             String oldWord,
                             String newWord)
Replaces all occurrances of oldWord with newWord in a given string. Search is case sensitive.

Parameters:
text - Text to search and replace.
oldWord - Old word to search for.
newWord - New word to replace oldWord with.
Returns:
Modified text.

replace

public static String replace(String text,
                             String oldWord,
                             String newWord,
                             boolean caseSensitive)
Replaces all occurrances of oldWord with newWord in a given string. The case sensitivity of the search can be defined.

Parameters:
text - Text to search and replace.
oldWord - Old word to search for.
newWord - New word to replace oldWord with.
caseSensitive - Determines of search should be case sensitive.
Returns:
Modified text.

getNatGrid

public static Point getNatGrid(String letters,
                               int easting,
                               int northing)
Converts national grid from letters and digits (eg NY 38500 10500) to all digits (eg 338500, 510500).

Parameters:
letters - - National Grid 100km square as 2 letters
easting - - easting part of coordinate
northing - - northing part of coordinate.
Returns:
Coordinate pair represented by given grid reference.

getNatGrid

public static String getNatGrid(int easting,
                                int northing)
Converts national grid reference (eg 338500, 510500) to letter and digit reference (eg NY 38500 10500).

Parameters:
easting - - easting part of coordinate
northing - - northing part of coordinate.
Returns:
Coordinate pair represented by given grid reference.