Package edu.odu.cs.cs350
Class Recommender
- java.lang.Object
-
- edu.odu.cs.cs350.Recommender
-
- All Implemented Interfaces:
RecommenderInterface
public class Recommender extends java.lang.Object implements RecommenderInterface
Taking as input a list of tokens which represents a string of tokens taken from all files that the Input processed. It will process these tokens, and produce a list of recommended refactorings, ordered from greatest to least opportunity value. Additionally, after finding a refactoring recommendation, but before adding the recommendation to the list of recommendations, it will compute the opportunity value of that recommendation.- See Also:
RecommenderInterface,TestRecomender
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxRefactoringSize()Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.intgetMinRefactoringSize()Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.java.util.List<? extends RefactoringInterface>getRefactorings()If no refactorings have been created, create them.java.util.List<? extends TokenInterface>getTokens()voidsetMaxRefactoringSize()Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.voidsetMaxRefactoringSize(int input)Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.voidsetMinRefactoringSize()Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.voidsetMinRefactoringSize(int input)Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.voidsetRefactorings(java.util.List<? extends RefactoringInterface> input)Sets recommender's list of refactorings to a pre-existing refactoring list.voidsetTokens(java.util.List<? extends TokenInterface> input)Sets the list of tokens from which recommendations are generated to the input list parameter.
-
-
-
Method Detail
-
getTokens
public java.util.List<? extends TokenInterface> getTokens()
- Specified by:
getTokensin interfaceRecommenderInterface- Returns:
- the list of tokens from which the recommendations are generated.
-
setTokens
public void setTokens(java.util.List<? extends TokenInterface> input)
Sets the list of tokens from which recommendations are generated to the input list parameter.- Specified by:
setTokensin interfaceRecommenderInterface- Parameters:
input- a list of token objects.
-
getRefactorings
public java.util.List<? extends RefactoringInterface> getRefactorings()
If no refactorings have been created, create them.- Specified by:
getRefactoringsin interfaceRecommenderInterface- Returns:
- a complete list of all refactoring recommendations.
-
setRefactorings
public void setRefactorings(java.util.List<? extends RefactoringInterface> input)
Sets recommender's list of refactorings to a pre-existing refactoring list.- Specified by:
setRefactoringsin interfaceRecommenderInterface- Parameters:
input- a list of Refactoring recommendations.
-
getMinRefactoringSize
public int getMinRefactoringSize()
Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.- Specified by:
getMinRefactoringSizein interfaceRecommenderInterface- Returns:
- the minimum number of tokens that can make up a refactoring.
-
setMinRefactoringSize
public void setMinRefactoringSize(int input)
Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.- Specified by:
setMinRefactoringSizein interfaceRecommenderInterface- Parameters:
input- the minimum number of tokens that can make up a refactoring.
-
setMinRefactoringSize
public void setMinRefactoringSize()
Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive. If no input was provided, sets the min to 0 if Recommender's list of tokens is empty, or to 3% of the size of the token list.- Specified by:
setMinRefactoringSizein interfaceRecommenderInterface
-
getMaxRefactoringSize
public int getMaxRefactoringSize()
Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.- Specified by:
getMaxRefactoringSizein interfaceRecommenderInterface- Returns:
- the maximum number of tokens that can make up a refactoring.
-
setMaxRefactoringSize
public void setMaxRefactoringSize(int input)
Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive.- Specified by:
setMaxRefactoringSizein interfaceRecommenderInterface- Parameters:
input- the maximum number of tokens that can make up a refactoring.
-
setMaxRefactoringSize
public void setMaxRefactoringSize()
Recommended refactorings should be greater than minRefactoringSize but less than maxRefactoringSize, inclusive. If no input was provided, sets the max to 0 if Recommender's list of tokens is empty, or to 75% of the size of the token list.- Specified by:
setMaxRefactoringSizein interfaceRecommenderInterface
-
-