blog
Class POP

java.lang.Object
  extended by blog.POP

public class POP
extends java.lang.Object

Represents a potential object pattern (POP), which includes the type of object to be generated and a tuple of origin functions.


Constructor Summary
POP(Type type, java.util.List originFuncList, DependencyModel numberst)
          Creates a new potential object pattern for the given type and the given tuple of origin functions, with the given dependency model.
 
Method Summary
 boolean checkTypesAndScope(Model model)
          Checks types and scopes in this POP and its number statement.
 Type[] getArgTypes()
           
 DependencyModel getDepModel()
           
 LogicalVar[] getGenObjVars()
          Returns the logical variables that stand for the generating objects in this POP's dependency model.
 int getOriginFuncIndex(OriginFunction f)
          Returns the index of f in this POP's origin function list, or -1 if it is not in the list.
 java.util.BitSet getOriginFuncSet()
          Returns a BitSet where the ith bit is true if this POP uses the ith origin function in the list of origin functions for its type.
 OriginFunction[] originFuncs()
           
 void printNumberStatement(java.io.PrintStream s)
          Prints the number statement for this POP to the given stream.
 NumberVar rv()
          Returns a basic random variable for this POP with no generating objects.
 NumberVar rv(java.lang.Object genObj)
          Returns a basic random variable for this POP with the given single generating object.
 NumberVar rv(java.lang.Object genObj1, java.lang.Object genObj2)
          Returns a basic random variable for this POP with the given two generating objects.
 NumberVar rvWithArgs(java.lang.Object[] genObjs)
          Returns a basic random variable for this POP with the given array of generating objects.
 void setDepModel(DependencyModel depModel)
           
 void setGenObjVars(java.util.List vars)
          Sets the variables that will stand for the generating objects in this POP's dependency model.
 java.lang.String toString()
          Returns a string of the form #Type(f1, ..., fK) where Type is the type of object generated and f1, ..., fK are the origin functions.
 Type type()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

POP

public POP(Type type,
           java.util.List originFuncList,
           DependencyModel numberst)
Creates a new potential object pattern for the given type and the given tuple of origin functions, with the given dependency model.

Parameters:
type - the type of object generated
originFuncList - List of OriginFunction objects
numberst - dependency model for this POP
Method Detail

type

public final Type type()

originFuncs

public final OriginFunction[] originFuncs()

getArgTypes

public Type[] getArgTypes()

getGenObjVars

public LogicalVar[] getGenObjVars()
Returns the logical variables that stand for the generating objects in this POP's dependency model.


setGenObjVars

public void setGenObjVars(java.util.List vars)
Sets the variables that will stand for the generating objects in this POP's dependency model.

Parameters:
vars - List of String objects representing the variables

getDepModel

public DependencyModel getDepModel()

setDepModel

public void setDepModel(DependencyModel depModel)

getOriginFuncIndex

public int getOriginFuncIndex(OriginFunction f)
Returns the index of f in this POP's origin function list, or -1 if it is not in the list.


getOriginFuncSet

public java.util.BitSet getOriginFuncSet()
Returns a BitSet where the ith bit is true if this POP uses the ith origin function in the list of origin functions for its type.


rv

public NumberVar rv()
Returns a basic random variable for this POP with no generating objects.


rv

public NumberVar rv(java.lang.Object genObj)
Returns a basic random variable for this POP with the given single generating object.


rv

public NumberVar rv(java.lang.Object genObj1,
                    java.lang.Object genObj2)
Returns a basic random variable for this POP with the given two generating objects.


rvWithArgs

public NumberVar rvWithArgs(java.lang.Object[] genObjs)
Returns a basic random variable for this POP with the given array of generating objects.


printNumberStatement

public void printNumberStatement(java.io.PrintStream s)
Prints the number statement for this POP to the given stream.


checkTypesAndScope

public boolean checkTypesAndScope(Model model)
Checks types and scopes in this POP and its number statement. Returns true if everything is correct; otherwise prints error messages to standard error and returns false.


toString

public java.lang.String toString()
Returns a string of the form #Type(f1, ..., fK) where Type is the type of object generated and f1, ..., fK are the origin functions.

Overrides:
toString in class java.lang.Object