de.dante.extex.interpreter.type.pair
Class Pair

java.lang.Object
  extended byde.dante.extex.interpreter.type.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: 1.5 $
Author:
Michael Niedermair
See Also:
Serialized Form

Constructor Summary
Pair()
          Creates a new object.
Pair(Context context, TokenSource source)
          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(Real x,
            Real y)
Creates a new object.

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

Pair

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

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

Pair

public Pair(Context context,
            TokenSource source)
     throws InterpreterException
Creates a new object. Scan the TokenSource for a Pair.

Parameters:
context - the context
source - the token source
Throws:
InterpreterException - ...

Pair

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

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

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

setX

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

Parameters:
x - the new x-value

setY

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

Parameters:
y - the new y-value

setX

public void setX(double 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

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

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

add

public void add(double x,
                double y)
add

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

toString

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

Returns:
the value as String