viper.descriptors.attributes
Class Attribute_number.NumberValue

java.lang.Object
  extended byjava.lang.Number
      extended byviper.descriptors.attributes.Attribute_number.NumberValue
All Implemented Interfaces:
AttributeValue, java.lang.Comparable, Measurable, java.io.Serializable
Enclosing class:
Attribute_number

protected abstract static class Attribute_number.NumberValue
extends java.lang.Number
implements AttributeValue, java.lang.Comparable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class viper.descriptors.attributes.Measurable
Measurable.Difference
 
Constructor Summary
protected Attribute_number.NumberValue()
           
 
Method Summary
 Measurable.Difference getDifference(Measurable beta, Measurable blackout, Measurable ignore, CanonicalFileDescriptor cfd)
          Not optimized version.
 Measurable.Difference getDifference(Measurable beta, Measurable blackout, Measurable ignore, CanonicalFileDescriptor cfd, Measurable.Difference old)
          For performance reasons, takes an optional (could be null) Measurable.Difference to replace the data from.
 boolean validate(AttributeValue v)
          Checks to make sure that the value can be set.
 
Methods inherited from class java.lang.Number
byteValue, doubleValue, floatValue, intValue, longValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface viper.descriptors.attributes.AttributeValue
setValue, setValue, toXML
 
Methods inherited from interface viper.descriptors.attributes.Measurable
getType
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Attribute_number.NumberValue

protected Attribute_number.NumberValue()
Method Detail

getDifference

public Measurable.Difference getDifference(Measurable beta,
                                           Measurable blackout,
                                           Measurable ignore,
                                           CanonicalFileDescriptor cfd)
Description copied from interface: Measurable
Not optimized version. Usually will just call getDifference (..., null).

Specified by:
getDifference in interface Measurable
Parameters:
beta - the value to subtract/get the difference from
blackout - the bad region
ignore - the ignored region
cfd - the media's information
Returns:
the difference between this and beta, given the constraints
See Also:
Measurable.getDifference(Measurable, Measurable, Measurable, CanonicalFileDescriptor, Measurable.Difference)

getDifference

public Measurable.Difference getDifference(Measurable beta,
                                           Measurable blackout,
                                           Measurable ignore,
                                           CanonicalFileDescriptor cfd,
                                           Measurable.Difference old)
Description copied from interface: Measurable
For performance reasons, takes an optional (could be null) Measurable.Difference to replace the data from. Calling getDistance (alpha, beta, blackout, ignore) should have the same effect as getDistance (alpha.getDifference (beta, blackout, ignore)) (Except for if alpha is null... then it will use Distances.DefaultDifference

Specified by:
getDifference in interface Measurable
Parameters:
beta - the difference to get against
blackout - the measurable to count as bad
ignore - the measurable region to ignore
cfd - the media file descriptor
old - an old difference to copy into, if possible, like the array passed to list.toArray()
Returns:
the difference between this and beta

validate

public boolean validate(AttributeValue v)
Checks to make sure that the value can be set.

Specified by:
validate in interface AttributeValue
Parameters:
v - the value to validate
Returns:
true iff the value is a valid attribute value for this attribute's type