|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.core.glue.Glue
public class Glue
This class provides the basic data type of a stretchable and shrinkable quantity of length.
| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Fields inherited from interface org.extex.core.glue.FixedGlue |
|---|
NORMAL_ORDER, S_S, ZERO |
| Constructor Summary | |
|---|---|
Glue()
Creates a new object with a zero length. |
|
Glue(FixedDimen theLength)
Creates a new object with a fixed length. |
|
Glue(FixedDimen theLength,
FixedDimen theStretch,
FixedDimen theShrink)
Creates a new object from the three components. |
|
Glue(FixedDimen theLength,
FixedGlueComponent theStretch,
FixedGlueComponent theShrink)
Creates a new object from the three components. |
|
Glue(FixedGlue glue)
Creates a new object as copy of another glue. |
|
Glue(long theLength)
Creates a new object from a fixed length. |
|
| Method Summary | |
|---|---|
void |
add(FixedDimen g)
Add a dimen to this one glue. |
void |
add(FixedGlue g)
Add another glue to this one. |
Glue |
copy()
Make a copy of this object. |
boolean |
eq(FixedGlue glue)
Test that the given Glue is equal to a given one. |
boolean |
ge(FixedDimen x)
Compare this value with a given glue and return true iff
the current length is greater or equal than the given length. |
FixedDimen |
getLength()
Getter for the length. |
FixedGlueComponent |
getShrink()
Getter for shrink. |
FixedGlueComponent |
getStretch()
Getter for stretch. |
boolean |
gt(FixedDimen x)
Compare this value with a given glue and return true iff
the current length is greater than the given length. |
boolean |
le(FixedDimen x)
Compare this value with a given glue and return true iff
the current length is less or equal than the given length. |
boolean |
lt(FixedDimen x)
Compare this value with a given glue and return true iff
the current length is less than the given length. |
void |
multiply(long nom,
long denom)
Multiply the normal size by an integer fraction. |
void |
multiplyAll(long nom,
long denom)
Multiply all components by an integer fraction. |
void |
multiplyShrink(long nom,
long denom)
Multiply the shrink component by an integer fraction. |
void |
multiplyStretch(long nom,
long denom)
Multiply the stretch component by an integer fraction. |
boolean |
ne(FixedGlue glue)
Test that the given Glue is different from a given one. |
void |
negateLength()
Negate the value. |
void |
set(FixedDimen theLength)
Set the glue value to a non-stretchable and non-shrinkable length. |
void |
set(FixedGlue theLength)
Set the glue value. |
void |
setLength(FixedDimen x)
Setter for the length component |
void |
setShrink(FixedDimen x)
Setter for the shrink component |
void |
setStretch(FixedDimen x)
Setter for the stretch component |
void |
subtract(FixedDimen g)
Subtract a Glue component from this glue. |
void |
subtract(FixedGlue g)
Subtract another glue to this one. |
java.lang.String |
toString()
Determine the printable representation of the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public Glue()
public Glue(FixedDimen theLength)
theLength - the natural lengthpublic Glue(FixedGlue glue)
null then the new glue is initialized to the glue with
length 0 and no strechability and shrinkability.
glue - the glue to clone
public Glue(FixedDimen theLength,
FixedGlueComponent theStretch,
FixedGlueComponent theShrink)
theLength - the natural lengththeStretch - the stretch specificationtheShrink - the shrink specification
public Glue(FixedDimen theLength,
FixedDimen theStretch,
FixedDimen theShrink)
theLength - the natural lengththeStretch - the stretch specificationtheShrink - the shrink specificationpublic Glue(long theLength)
theLength - the natural length in scaled point| Method Detail |
|---|
public void add(FixedGlue g)
g - the glue to addpublic void add(FixedDimen g)
g - the glue to addpublic Glue copy()
copy in interface FixedGluepublic boolean eq(FixedGlue glue)
eq in interface FixedGlueglue - the glue to compare with
true iff they are the sameFixedGlue.eq( org.extex.core.glue.FixedGlue)public boolean ge(FixedDimen x)
true iff
the current length is greater or equal than the given length.
x - the value to compare to
true iff the current length is greater or equal
than the given onepublic FixedDimen getLength()
getLength in interface FixedGlueFixedGlue.getLength()public FixedGlueComponent getShrink()
getShrink in interface FixedGlueFixedGlue.getShrink()public FixedGlueComponent getStretch()
getStretch in interface FixedGlueFixedGlue.getStretch()public boolean gt(FixedDimen x)
true iff
the current length is greater than the given length.
x - the value to compare to
true iff the current length is greater than the
given onepublic boolean le(FixedDimen x)
true iff
the current length is less or equal than the given length.
x - the value to compare to
true iff the current length is less or equal than
the given onepublic boolean lt(FixedDimen x)
true iff
the current length is less than the given length.
x - the value to compare to
true iff the current length is less than the given
one
public void multiply(long nom,
long denom)
length = length * nom / denom
nom - nominatordenom - denominator
public void multiplyAll(long nom,
long denom)
nom - nominatordenom - denominator
public void multiplyShrink(long nom,
long denom)
shrink = shrink * nom / denom
nom - nominatordenom - denominator
public void multiplyStretch(long nom,
long denom)
stretch = stretch * nom / denom
nom - nominatordenom - denominatorpublic boolean ne(FixedGlue glue)
ne in interface FixedGlueglue - the glue to compare with
true iff they are differentFixedGlue.ne( org.extex.core.glue.FixedGlue)public void negateLength()
public void set(FixedDimen theLength)
theLength - the new lengthpublic void set(FixedGlue theLength)
theLength - the new lengthpublic void setLength(FixedDimen x)
x - the new length componentpublic void setShrink(FixedDimen x)
x - the new shrink componentpublic void setStretch(FixedDimen x)
x - the new stretch componentpublic void subtract(FixedGlue g)
g - the glue to addpublic void subtract(FixedDimen g)
g - the glue to subtractpublic java.lang.String toString()
toString in interface FixedGluetoString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||