viper.descriptors.attributes
Interface Measurable

All Known Subinterfaces:
AttributeValue, ExtendedAttributeValue
All Known Implementing Classes:
Attribute_circle.CircleValue, Attribute_ellipse.EllipseValue, Attribute_number.NumberValue, viper.descriptors.attributes.Attribute_polygon.AbstractPolygonValue, FrameSpan

public interface Measurable

An interface for a data type that knows its own metric objects.


Nested Class Summary
static interface Measurable.Difference
          For attributes that have several different distance metrics, it is often convenient to save some calculations; this interface is for keeping the computed data around for a bit.
 
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.
 java.lang.String getType()
          Gets the type name.
 

Method Detail

getType

public java.lang.String getType()
Gets the type name.

Returns:
the viper attribute type name for the measurable object.

getDifference

public Measurable.Difference getDifference(Measurable beta,
                                           Measurable blackout,
                                           Measurable ignore,
                                           CanonicalFileDescriptor cfd,
                                           Measurable.Difference old)
                                    throws IgnoredValueException
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

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
Throws:
IgnoredValueException - if everything is ignored

getDifference

public Measurable.Difference getDifference(Measurable beta,
                                           Measurable blackout,
                                           Measurable ignore,
                                           CanonicalFileDescriptor cfd)
                                    throws IgnoredValueException
Not optimized version. Usually will just call getDifference (..., null).

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
Throws:
IgnoredValueException - if this and beta are totally ignored
See Also:
getDifference(Measurable, Measurable, Measurable, CanonicalFileDescriptor, Measurable.Difference)