viper.descriptors.attributes
Class Attribute_ellipse.EllipseValue

java.lang.Object
  extended byviper.descriptors.attributes.Attribute_ellipse.EllipseValue
All Implemented Interfaces:
AttributeValue, Measurable
Enclosing class:
Attribute_ellipse

protected static class Attribute_ellipse.EllipseValue
extends java.lang.Object
implements AttributeValue


Nested Class Summary
 
Nested classes inherited from class viper.descriptors.attributes.Measurable
Measurable.Difference
 
Constructor Summary
protected Attribute_ellipse.EllipseValue()
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 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.
 int hashCode()
           
 AttributeValue setValue(org.w3c.dom.Element el)
          Sets the state of the object to the data the xml-dom element represents.
 AttributeValue setValue(java.lang.String S)
          Sets the state of the object to the data the String represents.
 java.lang.String toString()
           
 org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
          Returns an xml element for this object.
 boolean validate(AttributeValue v)
          Checks to make sure that the value can be set.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute_ellipse.EllipseValue

protected Attribute_ellipse.EllipseValue()
Method Detail

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

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

getType

public java.lang.String getType()
Description copied from interface: Measurable
Gets the type name.

Specified by:
getType in interface Measurable
Returns:
the viper attribute type name for the measurable object.

setValue

public AttributeValue setValue(org.w3c.dom.Element el)
Sets the state of the object to the data the xml-dom element represents.

Specified by:
setValue in interface AttributeValue
Parameters:
el - DOM Node to parse
Returns:
the parsed value
Throws:
java.lang.IllegalArgumentException - If the data is ill-formed

setValue

public AttributeValue setValue(java.lang.String S)
Sets the state of the object to the data the String represents. Useful for old GTF format Should be able to run setValue(toString()) and have it come out the same. Should try to use XML format whenever possible.

Specified by:
setValue in interface AttributeValue
Parameters:
S - String representation of this type of value.
Returns:
the parsed value
Throws:
java.lang.IllegalArgumentException - If the data is ill-formed

toXML

public org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
Returns an xml element for this object. It should be in the namespace Attribute.DEFAULT_NAMESPACE_QUALIFIER with a qualified name in the form Attribute.DEFAULT_NAMESPACE_QUALIFIER :type .

Specified by:
toXML in interface AttributeValue
Parameters:
doc - The root for the element.
Returns:
New DOM element for this data.

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 check
Returns:
true iff the type meets with the attribute configuration