de.dante.extex.interpreter.type.muskip
Class Muskip

java.lang.Object
  extended byde.dante.extex.interpreter.type.muskip.Mudimen
      extended byde.dante.extex.interpreter.type.muskip.Muskip
All Implemented Interfaces:
java.io.Serializable

public class Muskip
extends Mudimen
implements java.io.Serializable

This class provides a skip value with a variable length of order 0. The actual length is a multiple of math units (mu).

Version:
$Revision: 1.29 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Muskip()
          Creates a new object.
Muskip(boolean kill)
          Creates a new object.
Muskip(FixedDimen theLength)
          Creates a new object.
Muskip(FixedGlueComponent theLength, FixedGlueComponent theStretch, FixedGlueComponent theShrink)
          Creates a new object.
Muskip(long theLength)
          Creates a new object.
Muskip(Muskip x)
          Creates a new object.
 
Method Summary
 void add(Muskip ms)
          Add another muglue to this one.
 GlueComponent getShrink()
          Getter for shrink.
 GlueComponent getStretch()
          Getter for stretch.
 boolean isKill()
          Getter for kill.
 boolean isZero()
          Check that the muskip has natural length zero and no stretch and shrink component.
 void multiply(long nom, long denom)
          Multiply all components by an integer fraction.
static Muskip parse(Context context, TokenSource source, Typesetter typesetter)
          Creates a new object and fills it from a token stream.
 void setKill(boolean kill)
          Setter for kill.
 java.lang.String toString()
          Return the string representation of the instance.
 void toString(java.lang.StringBuffer sb)
          Append the string representation of the instance to a string buffer.
 Tokens toToks(TokenFactory factory)
          Determine the printable representation of the object.
 
Methods inherited from class de.dante.extex.interpreter.type.muskip.Mudimen
add, getLength, parseMudimen, scanMu, toToks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

Muskip

public Muskip()
Creates a new object. All components are 0.


Muskip

public Muskip(boolean kill)
Creates a new object. All components are 0.

Parameters:
kill - the kill indicator

Muskip

public Muskip(FixedDimen theLength)
Creates a new object. Strechablity and shrinkability are 0.

Parameters:
theLength - the natural length

Muskip

public Muskip(long theLength)
Creates a new object. Strechablity and shrinkability are 0.

Parameters:
theLength - the natural length

Muskip

public Muskip(FixedGlueComponent theLength,
              FixedGlueComponent theStretch,
              FixedGlueComponent theShrink)
Creates a new object.

Parameters:
theLength - the natural length
theStretch - the stretchability
theShrink - the shrinkability

Muskip

public Muskip(Muskip x)
Creates a new object.

Parameters:
x - the other muskip
Method Detail

parse

public static Muskip parse(Context context,
                           TokenSource source,
                           Typesetter typesetter)
                    throws InterpreterException
Creates a new object and fills it from a token stream.

Parameters:
context - the processor context
source - the source for new tokens
typesetter - the typesetter
Returns:
the value parsed
Throws:
InterpreterException - in case of an error

add

public void add(Muskip ms)
Add another muglue to this one. The addition is performed independently on the components.

Parameters:
ms - the muglue to add

getShrink

public GlueComponent getShrink()
Getter for shrink.

Returns:
the shrink

getStretch

public GlueComponent getStretch()
Getter for stretch.

Returns:
the stretch

isKill

public boolean isKill()
Getter for kill.

Returns:
the kill

isZero

public boolean isZero()
Check that the muskip has natural length zero and no stretch and shrink component.

Overrides:
isZero in class Mudimen
Returns:
true iff the register is zero

multiply

public void multiply(long nom,
                     long denom)
Multiply all components by an integer fraction.

Overrides:
multiply in class Mudimen
Parameters:
nom - nominator
denom - denominator

setKill

public void setKill(boolean kill)
Setter for kill.

Parameters:
kill - the kill to set

toString

public java.lang.String toString()
Return the string representation of the instance.

Overrides:
toString in class Mudimen
Returns:
the string representation of this glue
See Also:
"TeX – The Program [???]"

toString

public void toString(java.lang.StringBuffer sb)
Append the string representation of the instance to a string buffer.

Overrides:
toString in class Mudimen
Parameters:
sb - the target string buffer

toToks

public Tokens toToks(TokenFactory factory)
              throws GeneralException
Determine the printable representation of the object. The value returned is exactly the string which would be produced by TeX to print the muskip register.

Parameters:
factory - the factory to get the tokens from
Returns:
the string representation of this glue
Throws:
GeneralException - in case of an error
See Also:
"TeX – The Program [178,177]"