scale.annot
Class Support

java.lang.Object
  extended by scale.annot.Support

public class Support
extends java.lang.Object

This class represents the support level for an annotation.

$Id: Support.java,v 1.24 2007-08-13 12:32:02 burrill Exp $

Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

A particular support for annotations.

The belief values and combination rule are specified using enumerations, which are as follows:

This table lists some sample situations and the appropriate settings for the belief and combination rule fields. The combination rule should always be the default, unless otherwise specified.
Situation User belief System belief Combining rule
User creates annotation possible neutral default
Annotation derived from source language construct neutral true default
Annotation from an accurate analysis neutral true default
Annotation from a conservative analysis neutral probable default
User overrides annotation created by system neutral unchanged user
System choses to drop a user annotation unchanged neutral system

See Also:
Annotation

Nested Class Summary
static class Support.Belief
          Annotations retain a measure of belief in the accuracy of the annotation.
static class Support.Rule
          The combining rule specifies how the user and system belief values will be combined.
 
Field Summary
static Support systemTrue
          System belief is true.
 
Method Summary
 Support combine(Support a)
          Combine two supports.
static Support create(boolean isUser, Support.Belief belief)
           
static Support create(Support.Belief user, Support.Belief system, Support.Rule rule)
          Re-use an existing instance of a particular support.
 Support.Rule getRule()
          Return the rule used in the support.
 Support.Belief getSystemBelief()
          Return the user system used in the support.
 Support.Belief getUserBelief()
          Return the user belief used in the support.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

systemTrue

public static final Support systemTrue
System belief is true.

Method Detail

create

public static Support create(Support.Belief user,
                             Support.Belief system,
                             Support.Rule rule)
Re-use an existing instance of a particular support. If no equivalent support exists, create a new one.


create

public static Support create(boolean isUser,
                             Support.Belief belief)

combine

public Support combine(Support a)
Combine two supports.

Returns:
the new Support

getRule

public final Support.Rule getRule()
Return the rule used in the support.


getUserBelief

public final Support.Belief getUserBelief()
Return the user belief used in the support.


getSystemBelief

public final Support.Belief getSystemBelief()
Return the user system used in the support.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object