Class ComplexityEvaluator.ComplexityBundle
java.lang.Object
solvers.queueingnet.treeAlgorithms.ComplexityEvaluator.ComplexityBundle
- Enclosing class:
ComplexityEvaluator
Internal class for storing and comparing time and space complexities.
- Author:
- Ben Homer, 2014.
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe space complexity.intThe time complexity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds this ComplexityBundle (time and space) to another and returns the result.booleanDetermines if the local ComplexityBundle has better time and space complexity than another specified ComplexityBundle.booleanDetermines if the local ComplexityBundle has better space complexity than another specified ComplexityBundle.booleanDetermines if the local ComplexityBundle has better time complexity than another specified ComplexityBundle.
-
Field Details
-
timeComplexity
public int timeComplexityThe time complexity. -
spaceComplexity
public int spaceComplexityThe space complexity.
-
-
Constructor Details
-
ComplexityBundle
public ComplexityBundle(int timeComplexity, int spaceComplexity) Constructor.- Parameters:
timeComplexity- The time complexity.spaceComplexity- The space complexity.
-
-
Method Details
-
add
Adds this ComplexityBundle (time and space) to another and returns the result.- Parameters:
c- The ComplexityBundle the add the local space and time complexities to.- Returns:
- The combined ComplexityBundle.
-
hasBetterTimeComplexity
Determines if the local ComplexityBundle has better time complexity than another specified ComplexityBundle.- Parameters:
c- The ComplexityBundle to check against.- Returns:
- A boolean indication whether the local ComplexityBundle has better time complexity than the other specified ComplexityBundle.
-
hasBetterSpaceComplexity
Determines if the local ComplexityBundle has better space complexity than another specified ComplexityBundle.- Parameters:
c- The ComplexityBundle to check against.- Returns:
- A boolean indication whether the local ComplexityBundle has better space complexity than the other specified ComplexityBundle.
-
hasBetterCombinedComplexity
Determines if the local ComplexityBundle has better time and space complexity than another specified ComplexityBundle.- Parameters:
c- The ComplexityBundle to check against.- Returns:
- A boolean indication whether the local ComplexityBundle has better time and space complexity than the other specified ComplexityBundle.
-