All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.pics.db.LabelMaker

java.lang.Object
   |
   +----w3c.pics.db.LabelMaker

public class LabelMaker
extends Object
A class that generates random PICS labels or random pseudo-label files.


Constructor Index

 o LabelMaker(int)
Creates a new LabelMaker, for use in creating random pseudo-label files.
 o LabelMaker(int, String)
Creates a new LabelMaker, for use in creating random pseudo-label files.
 o LabelMaker(int, String, boolean)
Creates a new LabelMaker, for use in creating random PICS labels.
 o LabelMaker(int, String, boolean, boolean, boolean, Vector)
Creates a new LabelMaker, for use in creating random PICS labels.
 o LabelMaker(int, String, boolean, String, String, boolean, boolean)
Creates a new LabelMaker, for use in creating random PICS labels.

Method Index

 o getRatname()
Returns the name of the ratfile associated with this LabelMaker.
 o main(String[])
A procedure to create labels.
 o newLabel(Service, DataStub)
Creates a new PICS label ratings clause
 o newURL()
Returns a random URL.
 o readServiceFile(String, String)
Opens and reads a ratfile, parses it and returns a Service object.
 o writeLabels(int)
Creates random pseudo-labels and writes them to a file.
 o writePicsLabels(Service, int)
Creates random PICS labels, and writes them to a file.
 o writePicsLabels(Service, int, int)
Creates random PICS labels, and writes them to a file.

Constructors

 o LabelMaker
 public LabelMaker(int num)
Creates a new LabelMaker, for use in creating random pseudo-label files.

Parameters:
num - The number of labels to create.
 o LabelMaker
 public LabelMaker(int num,
                   String newfilename)
Creates a new LabelMaker, for use in creating random pseudo-label files.

Parameters:
num - The number of labels to create.
newfilename - The name of the file to create.
 o LabelMaker
 public LabelMaker(int num,
                   String newfilename,
                   boolean useall)
Creates a new LabelMaker, for use in creating random PICS labels.

Parameters:
num - The number of labels to create.
newfilename - The name of the file to create.
useall - A boolean indicating whether or not all Categories must be used in each label.
 o LabelMaker
 public LabelMaker(int num,
                   String newfilename,
                   boolean useall,
                   String defaultrat,
                   String defaultratdir,
                   boolean flabel,
                   boolean mfiles)
Creates a new LabelMaker, for use in creating random PICS labels.

Parameters:
num - The number of labels to create.
newfilename - The name of the file to create.
useall - A boolean indicating whether or not all Categories must be used in each label.
defaultrat - The name of the ratfile to use.
defaultratdir - The name of the directory containing the ratfile.
flabel - A boolean, true if full PICS labels are to be generated, false if minimal PICS labels are to be generated.
mfiles - A boolean, true if each label is to be put in a seperate file, false if all the labels should be placed in one large file. When true, the filenames are based on the name given in newfilename. When false, the file is named newfilename
 o LabelMaker
 public LabelMaker(int num,
                   String newfilename,
                   boolean useall,
                   boolean flabel,
                   boolean mfiles,
                   Vector ratfilelist)
Creates a new LabelMaker, for use in creating random PICS labels.

Parameters:
num - The number of labels to create.
newfilename - The name of the file to create.
useall - A boolean indicating whether or not all Categories must be be used in each label.
flabel - A boolean, true if full PICS labels are to be generated, false if minimal PICS labels are to be generated.
mfiles - A boolean, true if each label is to be put in a seperate file, false if all the labels should be placed in one large file. When true, the filenames are based on the name given in newfilename. When false, the file is named newfilename
ratfilelist - A Vector containing a list of ratfiles that are to be used for creating labels.

Methods

 o getRatname
 public String getRatname()
Returns the name of the ratfile associated with this LabelMaker.

Returns:
A String containing the name of the ratfile.
 o main
 public static void main(String args[])
A procedure to create labels. Takes the following command-line arguments:
  1. -count -- If the -count flag is present, it will read the next argument as an integer, and use it for the number of labels to create.
  2. -ratfile -- If the -ratfile flag is present, it will read the next argument as the full pathname of the ratfile to use.
  3. -fulllabels -- If the -fulllabels flag is present, full PICS labels will be created instead of minimal PICS labels.
  4. -labelfile -- If the -labelfile flag is present, the next argument will be read as the name to use for the created labelfile(s).
  5. -minifiles -- If the -minifiles flag is present, it will create a seperate file for each label, rather than place them all in one big file.
  6. -multirat -- If the -multirat flag is used, the next argument will be read as a comma-seperated list of full pathnames to ratfiles. Any number of ratfiles may be including in this list. When this flag is in use, the LabelMaker will attempt to create an equal number of labels for each ratfile, so that the total number of labels created is equal to the count value. Each ratfile will produce the same number of labels except for the first, which gets the remainder.
  7. -nouseall -- If the -nouseall flag is used then the labels generated will not be forced to use every category from their service when they are created. All labels will use at least one category.

 o writeLabels
 public void writeLabels(int i)
Creates random pseudo-labels and writes them to a file.

Parameters:
i - The number of labels to create.
 o readServiceFile
 public Service readServiceFile(String ratfilename,
                                String dirname)
Opens and reads a ratfile, parses it and returns a Service object.

Parameters:
ratfilename - The name of the ratfile.
dirname - The name of the directory containing the ratfile.
Returns:
A Service object representing the service described by the ratfile.
 o writePicsLabels
 public void writePicsLabels(Service Ser,
                             int count)
Creates random PICS labels, and writes them to a file.

Parameters:
Ser - The service description for these labels.
count - The number of labels to create.
 o writePicsLabels
 public void writePicsLabels(Service Ser,
                             int endcount,
                             int startcount)
Creates random PICS labels, and writes them to a file.

Parameters:
Ser - The service description for these labels.
endcount - The number for the last label.
startcount - The number for the first label.
 o newURL
 public String newURL()
Returns a random URL.

Returns:
A random URL as a String.
 o newLabel
 public String newLabel(Service Ser,
                        DataStub ds)
Creates a new PICS label ratings clause

Parameters:
Ser - The service description for this label.
ds - The DataStub to be used for random numbers.
Returns:
A PICS label ratings clause, as a String.

All Packages  Class Hierarchy  This Package  Previous  Next  Index