Class AbstractGraduations
- java.lang.Object
-
- org.scilab.forge.scirenderer.ruler.graduations.AbstractGraduations
-
- All Implemented Interfaces:
Graduations
- Direct Known Subclasses:
LinearGraduations
,LogarithmicGraduations
public abstract class AbstractGraduations extends java.lang.Object implements Graduations
- Author:
- Pierre Lando
-
-
Constructor Summary
Constructors Constructor Description AbstractGraduations(double lowerBound, boolean lowerBoundIncluded, double upperBound, boolean upperBoundIncluded)
Root constructor.AbstractGraduations(double lowerBound, double upperBound)
Root constructor.AbstractGraduations(Graduations parentGraduations)
Constructor from parent graduations.AbstractGraduations(Graduations parentGraduations, double lowerBound, boolean lowerBoundIncluded, double upperBound, boolean upperBoundIncluded)
Child constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contain(double value)
Return true if the interval contain the given value.boolean
containRelative(double value)
Equivalent to contain but for interval [0, upper-lower] (to avoid rounding error in computations)java.text.DecimalFormat
getFormat()
Return an adapted number format.double
getLowerBound()
Return the lower bound.Graduations
getParentGraduations()
Return the parent graduation.java.util.List<java.lang.Double>
getSubGraduations(int N)
Get the list of subgraduations corresponding to N subticks between two main consecutives ticksdouble
getUpperBound()
Return the upper bound.boolean
isLowerBoundIncluded()
Return true if the lower bound is included.boolean
isUpperBoundIncluded()
Return true if the lower bound is included.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scilab.forge.scirenderer.ruler.graduations.Graduations
getAllValues, getAlternative, getMore, getNewValues, getSubDensity, getSubGraduations
-
-
-
-
Constructor Detail
-
AbstractGraduations
public AbstractGraduations(Graduations parentGraduations)
Constructor from parent graduations. This constructor copy information from givenGraduations
and set it as is parent.- Parameters:
parentGraduations
- the parent graduations to copy.
-
AbstractGraduations
public AbstractGraduations(double lowerBound, boolean lowerBoundIncluded, double upperBound, boolean upperBoundIncluded)
Root constructor. Graduations made this way don't have a parent.- Parameters:
lowerBound
- the actual lower bounds.lowerBoundIncluded
- the actual lower bounds included status.upperBound
- the actual upper bounds.upperBoundIncluded
- the actual upper bounds included status.
-
AbstractGraduations
public AbstractGraduations(double lowerBound, double upperBound)
Root constructor. Graduations made this way don't have a parent. There bounds are included.- Parameters:
lowerBound
- the actual lower bounds included status.upperBound
- the actual upper bounds included status.
-
AbstractGraduations
public AbstractGraduations(Graduations parentGraduations, double lowerBound, boolean lowerBoundIncluded, double upperBound, boolean upperBoundIncluded)
Child constructor.- Parameters:
parentGraduations
- the parent graduation.lowerBound
- the actual lower bounds.lowerBoundIncluded
- the actual lower bounds included status.upperBound
- the actual upper bounds.upperBoundIncluded
- the actual upper bounds included status.
-
-
Method Detail
-
getLowerBound
public final double getLowerBound()
Description copied from interface:Graduations
Return the lower bound.- Specified by:
getLowerBound
in interfaceGraduations
- Returns:
- the lower bound.
-
isLowerBoundIncluded
public final boolean isLowerBoundIncluded()
Description copied from interface:Graduations
Return true if the lower bound is included.- Specified by:
isLowerBoundIncluded
in interfaceGraduations
- Returns:
- true if the lower bound is included.
-
getUpperBound
public final double getUpperBound()
Description copied from interface:Graduations
Return the upper bound.- Specified by:
getUpperBound
in interfaceGraduations
- Returns:
- the upper bound.
-
isUpperBoundIncluded
public final boolean isUpperBoundIncluded()
Description copied from interface:Graduations
Return true if the lower bound is included.- Specified by:
isUpperBoundIncluded
in interfaceGraduations
- Returns:
- true if the lower bound is included.
-
getParentGraduations
public final Graduations getParentGraduations()
Description copied from interface:Graduations
Return the parent graduation.- Specified by:
getParentGraduations
in interfaceGraduations
- Returns:
- the parent graduation.
-
contain
public final boolean contain(double value)
Description copied from interface:Graduations
Return true if the interval contain the given value.- Specified by:
contain
in interfaceGraduations
- Parameters:
value
- the given value.- Returns:
- true if the interval contain the given value.
-
containRelative
public final boolean containRelative(double value)
Equivalent to contain but for interval [0, upper-lower] (to avoid rounding error in computations)
-
getFormat
public final java.text.DecimalFormat getFormat()
Description copied from interface:Graduations
Return an adapted number format.- Specified by:
getFormat
in interfaceGraduations
- Returns:
- an adapted number format.
-
getSubGraduations
public java.util.List<java.lang.Double> getSubGraduations(int N)
Description copied from interface:Graduations
Get the list of subgraduations corresponding to N subticks between two main consecutives ticks- Specified by:
getSubGraduations
in interfaceGraduations
- Parameters:
N
- the number of graduations- Returns:
- the corresponding list
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-