    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.pics.parser.Rating

    java.lang.Object
       |
       +----w3c.pics.parser.Rating

public class Rating
extends Object
implements Serializable

A class representing a single PICS rating for use as part of a label. A Rating can either be a single value or a range of values.

##

Rating(double)
  Creates a new single-value Rating.
Rating(double, double)
  Creates a new range-valued Rating.

##

isRange()
  Returns a boolean indicating if this Rating is a range or not.
toCommaDelimString()
  Writes the rating out separated by a comma, if necessary.
toDsigString()
  Writes the rating in DSig1.0 label format.
toString()
  Writes the rating out in PICS format.

##

Rating

     public Rating(double a)

  Creates a new single-value Rating.

  Parameters:
    a - The value for the Rating.

Rating

     public Rating(double a,
                   double b)

  Creates a new range-valued Rating.

  Parameters:
    a - The minimum value of the range.
    b - The maximum value of the range.

##

toString

     public String toString()

  Writes the rating out in PICS format.

  Returns:
    A String of the rating in the PICS format.
  Overrides:
    toString in class Object

toDsigString

     public String toDsigString()

  Writes the rating in DSig1.0 label format.

  Returns:
    A String of the rating in DSig1.0 label format.

isRange

     public boolean isRange()

  Returns a boolean indicating if this Rating is a range or not.

  Returns:
    A boolean, true if this Rating is a range, false if this rating is a single value.

toCommaDelimString

     public String toCommaDelimString()

  Writes the rating out separated by a comma, if necessary.

  Returns:
    e.g. "a, b" or "a"

    All Packages  Class Hierarchy  This Package  Previous  Next  Index