org.purl.sword.base
Class QualityValue

java.lang.Object
  extended by org.purl.sword.base.QualityValue

public class QualityValue
extends Object

A representation of a quality value. The quality value must be between 0 and 1, with no more than three digits after the decimal place.

Author:
Stuart Lewis

Constructor Summary
QualityValue()
          Create a quality value defaulting to 1
QualityValue(float q)
          Create a quality value
 
Method Summary
 float getQualityValue()
          Get the quality value
 void setQualityValue(float q)
          Set the quality value.
 String toString()
          Get a String representation of this quality value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QualityValue

public QualityValue()
             throws NumberFormatException
Create a quality value defaulting to 1

Throws:
NumberFormatException - thrown if the quality value is invalid according to the SWORD specification

QualityValue

public QualityValue(float q)
             throws NumberFormatException
Create a quality value

Parameters:
q - The quality value
Throws:
NumberFormatException - thrown if the quality value is invalid according to the SWORD specification
Method Detail

setQualityValue

public void setQualityValue(float q)
                     throws NumberFormatException
Set the quality value.

Parameters:
q - The quality value
Throws:
NumberFormatException - thrown if the quality value is invalid according to the SWORD specification

getQualityValue

public float getQualityValue()
Get the quality value

Returns:
the quality value

toString

public String toString()
Get a String representation of this quality value

Overrides:
toString in class Object
Returns:
The String representation of the quality value


Copyright © 2010 DuraSpace. All Rights Reserved.