uk.org.ogsadai.client.dbcreate
Class DataCreator
java.lang.Object
|
+--uk.org.ogsadai.client.dbcreate.DataCreator
- public class DataCreator
- extends java.lang.Object
This class generates the data used in the test databases.
- Author:
- The OGSA-DAI Project Team
Field Summary |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private static java.lang.String[] |
FIRST_NAMES
|
private static java.lang.String[] |
LAST_NAMES
|
private java.util.Random |
mRandom
Generates random numbers. |
private static java.lang.String[] |
ROADS
|
private static int |
SEED
Seed value for random number generator - do not modify. |
private static java.lang.String[] |
TOWNS
|
Method Summary |
private static java.lang.String |
chooseFromArray(java.lang.String[] stringArray, int i)
Picks a value from a String array depending on value of i |
private int |
chooseNumber()
Returns a randomly generated int between 0 and 9. |
java.lang.String |
generateAddress()
Returns a randomly generated address. |
java.lang.String |
generateName(int i)
Returns a name corresponding to the specified index in the test data. |
java.lang.String |
generatePhone()
Returns a randomly generated phone number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COPYRIGHT_NOTICE
private static final java.lang.String COPYRIGHT_NOTICE
-
- See Also:
- Constant Field Values
SEED
private static final int SEED
-
Seed value for random number generator - do not modify.
- See Also:
- Constant Field Values
mRandom
private final java.util.Random mRandom
-
Generates random numbers.
FIRST_NAMES
private static final java.lang.String[] FIRST_NAMES
-
LAST_NAMES
private static final java.lang.String[] LAST_NAMES
-
TOWNS
private static final java.lang.String[] TOWNS
-
ROADS
private static final java.lang.String[] ROADS
-
DataCreator
public DataCreator()
generatePhone
public java.lang.String generatePhone()
-
Returns a randomly generated phone number.
-
- Returns:
- a
String
containing the phone number.
generateName
public java.lang.String generateName(int i)
-
Returns a name corresponding to the specified index in the test data.
-
- Parameters:
i
- index within test data
- Returns:
- a
String
containing a name.
generateAddress
public java.lang.String generateAddress()
-
Returns a randomly generated address.
-
- Returns:
- a
String
containing the address.
chooseFromArray
private static java.lang.String chooseFromArray(java.lang.String[] stringArray,
int i)
-
Picks a value from a String array depending on value of i
-
- Parameters:
stringArray
-
i
-
- Returns:
- the ith element of the array.
chooseNumber
private int chooseNumber()
-
Returns a randomly generated int between 0 and 9.
-