|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.nite.search.rewriter.DefaultDeclarationOrderingScheme
public class DefaultDeclarationOrderingScheme
This implementation of DeclarationOrderingScheme uses corpus statistics concerning the frequency of declared types to calculate scores for declarations.
NOTE: We should probably create an abstract class CorpusDeclarationOrderingScheme for general schemes based on corpus statistics, which this implements.
| Constructor Summary | |
|---|---|
DefaultDeclarationOrderingScheme(SearchableCorpus corpus)
Create a DeclarationOrderingScheme with a reference to a corpus whose properties are used in calculating the ordering. |
|
| Method Summary | |
|---|---|
int |
calculateVariableScore(java.util.List types)
Calculate a score for the given list of variable types. |
java.util.List |
getOrdering(java.util.List declarableVariables)
Orders variable declarations based on their scores, from low score to high. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDeclarationOrderingScheme(SearchableCorpus corpus)
corpus - the SearchableCorpus to use in calculating scores| Method Detail |
|---|
public java.util.List getOrdering(java.util.List declarableVariables)
getOrdering in interface DeclarationOrderingSchemedeclarableVariables - a list of names mapped to type Lists
public int calculateVariableScore(java.util.List types)
calculateVariableScore in interface DeclarationOrderingSchemetypes - a List of types to which a variable is bound
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||