|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gshute.geom.LineGenerator
Objects of class LineGenerator generate random horizontal and vertical lines within the unit rectangle in the plane.
Field Summary | |
protected int |
count
count is the number of lines in this line generator. |
protected double |
expectedIntersections
expectedIntersections determines the expected number of intersections in lineSet. |
protected java.util.Set |
lineSet
lineSet is the current set of lines for this line set generator. |
protected double |
multiplier
lines generated by this LineGenerator have their length scaled by multiplier to control the expected number of intersections in lineSet. |
protected java.util.Random |
rand
rand is the random number generator for this LIneGenerator. |
protected long |
seed
seed is the seed for rand. |
Constructor Summary | |
LineGenerator()
new LineGenerator() returns a new LineGenerator. |
Method Summary | |
protected void |
generateLines()
generateLines() generates count random normalized horizontal and vertical lines within the bounding rectangle of lg and records them in lineSet. |
int |
getCount()
lg.getCount() returns the number of lines in lg. |
double |
getExpectedIntersections()
lg.getExpectedIntersections() returns the expected number of intersections in the lines of lg. |
java.util.Set |
getLines()
lg.getLines() returns the set of lines in lg. |
long |
getSeed()
lg.getSeed() returns the random number generator seed of lg. |
protected java.awt.geom.Line2D |
newHorizontalLine()
newHorizontalLine() returns a new horizontal Line. |
protected java.awt.geom.Line2D |
newVerticalLine()
newVerticalLine() returns a new vertical Line. |
void |
setCount(int n)
lg.setCount(n) sets the number of lines in lg to n. |
void |
setExpectedIntersections(double e)
lg.setExpectedIntersections(e) sets the expected number of intersections in the lines generated by lg. |
void |
setSeed(long s)
lg.setSeed(s) sets the seed of the random number generator of lg to s. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected long seed
protected java.util.Random rand
protected double multiplier
protected double expectedIntersections
protected int count
protected java.util.Set lineSet
Constructor Detail |
public LineGenerator()
Method Detail |
public long getSeed()
public int getCount()
public double getExpectedIntersections()
public java.util.Set getLines()
public void setSeed(long s)
public void setExpectedIntersections(double e)
public void setCount(int n)
protected java.awt.geom.Line2D newHorizontalLine()
protected java.awt.geom.Line2D newVerticalLine()
protected void generateLines()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |