viper.descriptors.attributes
Class Attribute_number

java.lang.Object
  extended byviper.descriptors.attributes.AbstractAttribute
      extended byviper.descriptors.attributes.Attribute
          extended byviper.descriptors.attributes.Attribute_number
All Implemented Interfaces:
java.lang.Cloneable, Filterable
Direct Known Subclasses:
Attribute_dvalue, Attribute_fvalue

public class Attribute_number
extends Attribute
implements java.lang.Cloneable

This attribute represents a number type, so that integers and doubles can be compared.


Nested Class Summary
protected static class Attribute_number.NumberValue
           
 
Nested classes inherited from class viper.filters.Filterable
Filterable.Rule
 
Field Summary
 
Fields inherited from class viper.descriptors.attributes.Attribute
composition, compositionTolerance, compositionType, errors, value
 
Constructor Summary
Attribute_number()
          Empty constructor for static values.
Attribute_number(Attribute old)
          Copies the old attribute.
Attribute_number(boolean mobile)
          Attributes for OBJECT type should use this constructor, with mobile set to true.
 
Method Summary
 Filterable.Rule convertRule(java.lang.String unparsedRule, java.util.List unparsedValues, ErrorWriter err)
          This converts a rule into the proper format for the data type.
 java.lang.String getType()
          Returns the Attribute type, eg lvalue or bbox.
 boolean isValidRule(java.lang.String ruleName)
          Tell if a name is a valid rule or not
 
Methods inherited from class viper.descriptors.attributes.Attribute
clone, compareTo, compose, crop, getCompositionType, getExtraConfig, getStaticValue, getValue, getValues, getValueToString, getXMLFormat, getXMLFormat, isCompositionType, isType, nullXML, nullXML, parseExtraConfig, passes, possibleValueOf, possibleValueOf, setCompositionType, setDefaultValue, setDefaultValue, setExtraConfig, setFrameSpan, setName, setOutputWidth, setStaticValue, setValue, setValue, setValue, setValue, setValue, toString
 
Methods inherited from class viper.descriptors.attributes.AbstractAttribute
getArchetype, getDefault, getExtraConfigInXML, getExtraConfigString, getName, isDynamic, loadAttributeType, named, named, parseAnInt, resetDefault, setArchetype, setArchetype, setArchetype, setDynamic
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute_number

public Attribute_number()
Empty constructor for static values.


Attribute_number

public Attribute_number(boolean mobile)
Attributes for OBJECT type should use this constructor, with mobile set to true. Other Descriptor types can use this with mobile set to false.

Parameters:
mobile - Descriptor that holds this Attribute is of type OBJECT

Attribute_number

public Attribute_number(Attribute old)
Copies the old attribute.

Parameters:
old - the old attribute
Method Detail

getType

public java.lang.String getType()
Description copied from class: AbstractAttribute
Returns the Attribute type, eg lvalue or bbox.

Overrides:
getType in class Attribute
Returns:
"number"

isValidRule

public boolean isValidRule(java.lang.String ruleName)
Description copied from interface: Filterable
Tell if a name is a valid rule or not

Specified by:
isValidRule in interface Filterable
Overrides:
isValidRule in class Attribute
Returns:
true when it is "==" or "!="

convertRule

public Filterable.Rule convertRule(java.lang.String unparsedRule,
                                   java.util.List unparsedValues,
                                   ErrorWriter err)
                            throws BadDataException
Description copied from class: Attribute
This converts a rule into the proper format for the data type. Each subclass of this class must implement this function if they want to be able to use the rule-based filtering system.

Specified by:
convertRule in interface Filterable
Overrides:
convertRule in class Attribute
Parameters:
unparsedRule - the rule to convert
unparsedValues - the values
err - the error stream
Returns:
the rule for this attribute
Throws:
BadDataException - if there is an error in the rule or values