de.dante.extex.interpreter.primitives.conditional
Class Ifdim

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.conditional.AbstractIf
          extended byde.dante.extex.interpreter.primitives.conditional.Ifdim
All Implemented Interfaces:
Code, ExpandableCode, Localizable, java.io.Serializable

public class Ifdim
extends AbstractIf

This class provides an implementation for the primitive \ifdim.

The Primitive \ifdim

The primitive \ifdim provides a conditional which compares two dimen values. The comparison for equality, greater, and less are possible.

Syntax

The formal description of this primitive is the following:
    ⟨ifdim⟩
      → \ifdim ⟨dimen⟩ ⟨op⟩ ⟨dimen⟩ ⟨true text⟩ \fi
      | \ifdim ⟨dimen⟩ ⟨op⟩ ⟨dimen⟩ ⟨true text⟩ \else ⟨false text⟩ \fi

    ⟨op⟩
      → [<]
      | [=]
      | [>]  

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
Ifdim(java.lang.String name)
          Creates a new object.
 
Method Summary
protected  boolean conditional(Context context, TokenSource source, Typesetter typesetter)
          This method computes the boolean value of the conditional.
 
Methods inherited from class de.dante.extex.interpreter.primitives.conditional.AbstractIf
execute, expand, getMyLocalizer, isIf, skipToElseOrFi
 
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode
enableLocalization, getLocalizer, getName, isOuter, printable, printableControlSequence, readResolve, setName, toString
 
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

Ifdim

public Ifdim(java.lang.String name)
Creates a new object.

Parameters:
name - the name for debugging
Method Detail

conditional

protected boolean conditional(Context context,
                              TokenSource source,
                              Typesetter typesetter)
                       throws InterpreterException
Description copied from class: AbstractIf
This method computes the boolean value of the conditional. If the result is true then the then branch is expanded and the else branch is skipped. Otherwise the then branch is skipped and the else branch is expanded.

Specified by:
conditional in class AbstractIf
Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
Returns:
the boolean value
Throws:
InterpreterException - in case of en error
See Also:
AbstractIf.conditional( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.typesetter.Typesetter)