edu.cmu.aura.service
Class AttributeReq

java.lang.Object
  |
  +--edu.cmu.aura.service.AttributeReq

public class AttributeReq
extends java.lang.Object

Represents the requirements on a particular attribute of a query. For instance, a client executing a query may use an AttributeReq instance to specify that a given attribute must have a certain confidence, and have been obtained within a given time.


Constructor Summary
AttributeReq()
          Constructs a blank attribute requirement.
AttributeReq(java.lang.String name)
          Constructs an attribute requirement for the given attribute.
 
Method Summary
 boolean accuracyRequired()
          Determines if this AttribReq specifies a required accuracy.
 boolean confRequired()
          Determines if this AttribReq specifies a required confidence.
 java.lang.Object getAccuracyMax()
          Get the maximum required accuracy.
 java.lang.Object getAccuracyMin()
          Get the minimum required accuracy.
 double getConfMax()
          Gets the maximum required confidence.
 double getConfMin()
          Gets the minimum required confidence.
 long getIntervalMax()
          Get the maximum required interval.
 long getIntervalMin()
          Get the minimum required interval.
 java.lang.String getName()
          Gets the name of the attribute that this requirement is for.
 TimeInstant getUpdateTimeAbsMax()
          Get the maximum required updateTime.
 TimeInstant getUpdateTimeAbsMin()
          Get the minimum required updateTime.
 boolean intervalRequired()
          Determines if this AttribReq specifies a required sample interval.
 boolean metBy(DynamicAttribute dynamicAttrib)
          Determins if a given DynamicAttribute meets the requirements specified by the AttributeReq.
 void setAccuracy(java.lang.Comparable minAccuracy, java.lang.Comparable maxAccuracy)
          Sets the required accuracy.
 void setConf(double minConf, double maxConf)
          Sets the required confidence.
 void setInterval(long minInterval, long maxInterval)
          Sets the required sample interval.
 void setUpdateTime(long minUpdateTime, long maxUpdateTime)
          Sets the required updateTime.
 void setUpdateTime(TimeInstant minUpdateTime, TimeInstant maxUpdateTime)
          Sets the required updateTime.
 void setUpdateTimeAbs(TimeInstant minUpdateTimeAbs, TimeInstant maxUpdateTimeAbs)
          Sets the required updateTime.
 java.lang.String toString()
          Return a String version of this AttributeReq.
 boolean updateTimeRequired()
          Determines if this AttribReq specifies a required updateTime.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeReq

public AttributeReq()
Constructs a blank attribute requirement.


AttributeReq

public AttributeReq(java.lang.String name)
Constructs an attribute requirement for the given attribute.

Parameters:
name - name of the attribute to construct the requirement for
Method Detail

getName

public java.lang.String getName()
Gets the name of the attribute that this requirement is for.

Returns:
the name of the attribute that this requirement is for

setConf

public void setConf(double minConf,
                    double maxConf)
Sets the required confidence.

Parameters:
minConf - the minimum required confidence
maxConf - the maximum required confidence

getConfMin

public double getConfMin()
Gets the minimum required confidence.

Returns:
the minimum required confidence

getConfMax

public double getConfMax()
Gets the maximum required confidence.

Returns:
the maximum required confidence

confRequired

public boolean confRequired()
Determines if this AttribReq specifies a required confidence.

Returns:
whether or not this AttribReq specifies a required confidence.

setAccuracy

public void setAccuracy(java.lang.Comparable minAccuracy,
                        java.lang.Comparable maxAccuracy)
Sets the required accuracy. This is measured by min and max values that must be of the same type as the attribute to which this AttributeReq refers.

Parameters:
minAccuracy - the minimum required value
maxAccuracy - the maximum required value

getAccuracyMin

public java.lang.Object getAccuracyMin()
Get the minimum required accuracy.

Returns:
the minimum required accuracy

getAccuracyMax

public java.lang.Object getAccuracyMax()
Get the maximum required accuracy.

Returns:
the maximum required accuracy

accuracyRequired

public boolean accuracyRequired()
Determines if this AttribReq specifies a required accuracy.

Returns:
whether or not this AttribReq specifies a required accuracy.

setUpdateTime

public void setUpdateTime(long minUpdateTime,
                          long maxUpdateTime)
Sets the required updateTime. This is the time that the attribute was last updated.

Parameters:
minUpdateTime - the minimum required updateTime
maxUpdateTime - the maximum required updateTime

setUpdateTime

public void setUpdateTime(TimeInstant minUpdateTime,
                          TimeInstant maxUpdateTime)
Sets the required updateTime. This is the time that the attribute was last updated.

Parameters:
minUpdateTime - the minimum required updateTime
maxUpdateTime - the maximum required updateTime

setUpdateTimeAbs

public void setUpdateTimeAbs(TimeInstant minUpdateTimeAbs,
                             TimeInstant maxUpdateTimeAbs)
Sets the required updateTime. This is the time that the attribute was last updated.


getUpdateTimeAbsMin

public TimeInstant getUpdateTimeAbsMin()
Get the minimum required updateTime.

Returns:
the minimum required updateTime

getUpdateTimeAbsMax

public TimeInstant getUpdateTimeAbsMax()
Get the maximum required updateTime.

Returns:
the maximum required updateTime

updateTimeRequired

public boolean updateTimeRequired()
Determines if this AttribReq specifies a required updateTime.

Returns:
whether or not this AttribReq specifies a required updateTime.

setInterval

public void setInterval(long minInterval,
                        long maxInterval)
Sets the required sample interval. This is the time over which the attribute was measured.


getIntervalMin

public long getIntervalMin()
Get the minimum required interval.

Returns:
the minimum required interval

getIntervalMax

public long getIntervalMax()
Get the maximum required interval.

Returns:
the maximum required interval

intervalRequired

public boolean intervalRequired()
Determines if this AttribReq specifies a required sample interval.

Returns:
whether or not this AttribReq specifies a required sample interval.

metBy

public boolean metBy(DynamicAttribute dynamicAttrib)
Determins if a given DynamicAttribute meets the requirements specified by the AttributeReq.

Returns:
whether or not all requirements are met

toString

public java.lang.String toString()
Return a String version of this AttributeReq.

Overrides:
toString in class java.lang.Object
Returns:
a String version of this AttributeReq