org.extex.interpreter.primitives.register.pair
Class Pair

java.lang.Object
  extended by org.extex.interpreter.primitives.register.pair.Pair
All Implemented Interfaces:
java.io.Serializable

public class Pair
extends java.lang.Object
implements java.io.Serializable

Pair (tow real-values).

[x-real] [y-real]

Version:
$Revision: 7274 $
Author:
Michael Niedermair
See Also:
Serialized Form

Constructor Summary
Pair()
          Creates a new object.
Pair(Context context, TokenSource source, Typesetter typesetter)
          Creates a new object.
Pair(double x, double y)
          Creates a new object.
Pair(Real x, Real y)
          Creates a new object.
Pair(java.lang.String s)
          Creates a new object.
 
Method Summary
 void add(double x, double y)
          add
 void add(Pair val)
          add
 void add(Real x, Real y)
          add
 Real getX()
          Getter for the x-value
 Real getY()
          Getter for the y-value
 void setX(double x)
          Setter for the x-value.
 void setX(Real x)
          Setter for the x-value.
 void setY(double y)
          Setter for the y-value.
 void setY(Real y)
          Setter for the y-value.
 java.lang.String toString()
          Return the value as String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair()
Creates a new object.


Pair

public Pair(Context context,
            TokenSource source,
            Typesetter typesetter)
     throws HelpingException,
            ConfigurationException,
            TypesetterException
Creates a new object. Scan the TokenSource for a Pair.

Parameters:
context - the context
source - the token source
typesetter - the typesetter
Throws:
HelpingException - in case of an error
ConfigurationException - in case of an configuration error
TypesetterException - in case of an error in the typesetter

Pair

public Pair(double x,
            double y)
Creates a new object.

Parameters:
x - the x-value
y - the y-value

Pair

public Pair(Real x,
            Real y)
Creates a new object.

Parameters:
x - the x-value
y - the y-value

Pair

public Pair(java.lang.String s)
     throws HelpingException
Creates a new object.

If the string equals null or empty, the value is set to zero

Parameters:
s - the value as String
Throws:
HelpingException - if a NumberFormatException is throws
Method Detail

add

public void add(double x,
                double y)
add

Parameters:
x - the x-value to add
y - the x-value to add

add

public void add(Pair val)
add

Parameters:
val - the value to add

add

public void add(Real x,
                Real y)
add

Parameters:
x - the x-value to add
y - the x-value to add

getX

public Real getX()
Getter for the x-value

Returns:
the x-value

getY

public Real getY()
Getter for the y-value

Returns:
the y-value

setX

public void setX(double x)
Setter for the x-value.

Parameters:
x - the new x-value

setX

public void setX(Real x)
Setter for the x-value.

Parameters:
x - the new x-value

setY

public void setY(double y)
Setter for the y-value.

Parameters:
y - the new y-value

setY

public void setY(Real y)
Setter for the y-value.

Parameters:
y - the new y-value

toString

public java.lang.String toString()
Return the value as String

Overrides:
toString in class java.lang.Object
Returns:
the value as String