@CodeReview(reviewer="Kevin R. Dixon",date="2009-07-06",changesNeeded=false,comments={"Made clone() call super.clone().","Fixed the brittleness in the copy constructor.","Looks fine."}) @CodeReview(reviewer="Justin Basilico",date="2006-10-05",changesNeeded=false,comments="Class looks fine. Compared against the code it is based on from Numerical Recipies in C and it looks fine.") public class LineBracket extends AbstractCloneableSerializable
Constructor and Description |
---|
LineBracket()
Creates a new instance of LineBracket
|
LineBracket(InputOutputSlopeTriplet lowerBound,
InputOutputSlopeTriplet upperBound,
InputOutputSlopeTriplet otherPoint)
Creates a new instance of LineBracket
|
LineBracket(LineBracket other)
Copy Constructor
|
Modifier and Type | Method and Description |
---|---|
LineBracket |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
InputOutputSlopeTriplet |
getLowerBound()
Getter for lowerBound
|
InputOutputSlopeTriplet |
getOtherPoint()
Getter for otherPoint
|
InputOutputSlopeTriplet |
getUpperBound()
Getter for upperBound
|
void |
setLowerBound(InputOutputSlopeTriplet lowerBound)
Setter for lowerBound
|
void |
setOtherPoint(InputOutputSlopeTriplet otherPoint)
Setter for otherPoint
|
void |
setUpperBound(InputOutputSlopeTriplet upperBound)
Setter for upperBound
|
java.lang.String |
toString() |
public LineBracket()
public LineBracket(InputOutputSlopeTriplet lowerBound, InputOutputSlopeTriplet upperBound, InputOutputSlopeTriplet otherPoint)
lowerBound
- Lower bound of the bracket.upperBound
- Upper bound of the bracket.otherPoint
- Another (optional) point associated with the bracket.public LineBracket(LineBracket other)
other
- LineBracket to copypublic LineBracket clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public java.lang.String toString()
toString
in class java.lang.Object
public InputOutputSlopeTriplet getLowerBound()
public void setLowerBound(InputOutputSlopeTriplet lowerBound)
lowerBound
- Lower bound of the bracket.public InputOutputSlopeTriplet getUpperBound()
public void setUpperBound(InputOutputSlopeTriplet upperBound)
upperBound
- Upper bound of the bracket.public InputOutputSlopeTriplet getOtherPoint()
public void setOtherPoint(InputOutputSlopeTriplet otherPoint)
otherPoint
- Another (optional) point associated with the bracket.