Class WireElement

java.lang.Object
   |
   +----Element
           |
           +----WireElement

public class WireElement
extends Element
Wire Element class. Any element which used just as contact and shouldn't be used in calculations should be inherited from this base class (examle: wire or node connector).


Constructor Index

 o WireElement()
Constructs WireElement without initial wires.
 o WireElement(int, int)
Constructs WireElement with two initial wire directions.
 o WireElement(WireElement)
Constructs empty WireElement.

Method Index

 o getCurrent(int, double)
Main function for calculations.
 o getInfo(int)
Returns information for this element, such as voltage, current etc.
 o getProperties()
This method is called to get values of element.
 o paint(Graphics, int, Dimension, boolean, boolean)
Paints the element on the given graphic context.
 o parseString(String)
This method is called to load new values to element from string.
 o setProperties(String[])
This method is called to set new values to element.

Constructors

 o WireElement
 public WireElement()
Constructs WireElement without initial wires.

 o WireElement
 public WireElement(WireElement e)
Constructs empty WireElement.

 o WireElement
 public WireElement(int dir1,
                    int dir2)
Constructs WireElement with two initial wire directions.

Parameters:
dir1 - 1st direction for WireElement (should be NORTH, SOUTH, WEST or EAST).
dir2 - 2nd direction for WireElement (should be NORTH, SOUTH, WEST or EAST).

Methods

 o getCurrent
 public Polynom getCurrent(int dir,
                           double timeStep)
Main function for calculations.

Overrides:
getCurrent in class Element
 o getProperties
 public Object[] getProperties()
This method is called to get values of element. Six Objects for each parameter:

Returns:
array of Objects.
Overrides:
getProperties in class Element
 o setProperties
 public void setProperties(String props[])
This method is called to set new values to element. Two strings for each parameter:

Parameters:
props - array with pairs of Strings.
Overrides:
setProperties in class Element
 o parseString
 public void parseString(String values) throws ParseException
This method is called to load new values to element from string. String should be like "value,order;value,order;etc.".

Parameters:
values - new values for element in string in format given above.
Throws: ParseException
if string format is incorrect.
Overrides:
parseString in class Element
 o getInfo
 public String[] getInfo(int angle)
Returns information for this element, such as voltage, current etc.

Overrides:
getInfo in class Element
 o paint
 public void paint(Graphics g,
                   int angle,
                   Dimension size,
                   boolean isSimulating,
                   boolean animated)
Paints the element on the given graphic context.

Overrides:
paint in class Element