public class ModuleDepInfo extends Object implements Serializable
Constructor and Description |
---|
ModuleDepInfo() |
ModuleDepInfo(ModuleDepInfo other)
Copy constructor
|
ModuleDepInfo(ModuleDepInfo other,
String comment)
Creates an instance of this class with the same properties as the
specified instance except that the specified comment string is associated
with each of the terms in the new instance
|
ModuleDepInfo(String pluginName,
BooleanTerm term,
String comment) |
ModuleDepInfo(String pluginName,
BooleanTerm term,
String comment,
boolean isPluginNameDeclared) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ModuleDepInfo other)
Adds the terms and comments from the specified object to this object.
|
ModuleDepInfo |
andWith(ModuleDepInfo other)
logically ands the provided terms with the formula belonging to this
object, updating this object with the result.
|
boolean |
containsTerm(BooleanTerm term)
Returns true if the specified term is logically included by the formula
for this object.
|
boolean |
equals(Object otherObj)
Returns true if this module is equal to the specified module
(ignoring comments)
|
String |
getComment()
Returns the comment string associated with the term that has the
fewest number of vars.
|
Collection<String> |
getHasPluginPrefixes()
Provided for backwards compatibility
|
Collection<String> |
getHasPluginPrefixes(Map<?,?> formulaCache)
A return value of null means that the associated module should be included in the expanded
dependency list unconditionally.
|
int |
hashCode()
Return a hashCode for this object that ignores comments
|
void |
resolveWith(Features features)
Resolves the formula using the variable values provided in
features |
void |
resolveWith(Features features,
boolean coerceUndefinedToFalse)
Resolves the formula using the variable values provided in
features |
ModuleDepInfo |
simplify(Map<?,?> formulaCache)
Simplifies the boolean formula
|
boolean |
subtract(ModuleDepInfo toSub)
Logically subtracts the boolean terms in the specified object from the
boolean formula in this object.
|
String |
toString() |
public ModuleDepInfo()
public ModuleDepInfo(ModuleDepInfo other)
other
- public ModuleDepInfo(ModuleDepInfo other, String comment)
other
- the instance who's properties will be used to initialize this
objectcomment
- the comment to associate with each of the terms in the new
object, or null if the comments of other
should be
preserved in the new object.public ModuleDepInfo(String pluginName, BooleanTerm term, String comment)
pluginName
- The plugin name. May be null if term is null.term
- The has! plugin expression used to refer to the module
associated with this object, or null if the module is referred
to directly.comment
- Optional comment string that can be retrieved using {
getComment()
public ModuleDepInfo(String pluginName, BooleanTerm term, String comment, boolean isPluginNameDeclared)
pluginName
- The plugin name. May be null if term is null.term
- The has! plugin expression used to refer to the module
associated with this object, or null if the module is referred
to directly.comment
- Optional comment string that can be retrieved using {
getComment()
isPluginNameDeclared
- True if the plugin name is declared in a has! plugin
expression referencing this module. Otherwise, the plugin name
is derived though has plugin branching. Derived names are
replaced with declared names when combining instances of this
class using add(ModuleDepInfo)
public Collection<String> getHasPluginPrefixes()
public Collection<String> getHasPluginPrefixes(Map<?,?> formulaCache)
If the list is not empty, then the list elements are the has! plugin prefixes that should be used with this module. One module id per list entry specifying the same module name should be used.
TreeSet
is used to obtain predictable ordering of terms in compound has conditionals,
mostly for unit tests.
formulaCache
- the formula cachepublic boolean containsTerm(BooleanTerm term)
Put another way, this method returns true if adding the specified term to the formula for this object does not change the truth table for the formula.
term
- The term to test for logical inclusionpublic ModuleDepInfo andWith(ModuleDepInfo other)
other
- the ModuleDepInfo
to and with this object.public String getComment()
public boolean add(ModuleDepInfo other)
other
- The object to addpublic boolean subtract(ModuleDepInfo toSub)
A term logically includes another term if it evaluates to the same result for all vars within the term. For example, the term A contains (A*B), but not vice-versa.
toSub
- The object to subtract from this objectpublic void resolveWith(Features features)
features
features
- the variable values to resolve withpublic void resolveWith(Features features, boolean coerceUndefinedToFalse)
features
features
- the variable values to resolve withcoerceUndefinedToFalse
- if true, then undefined features will be treated as falsepublic ModuleDepInfo simplify(Map<?,?> formulaCache)
formulaCache
- the formula cachepublic boolean equals(Object otherObj)
Copyright © 2011-2015 IBM. All Rights Reserved.