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).
-
WireElement()
- Constructs WireElement without initial wires.
-
WireElement(int, int)
- Constructs WireElement with two initial wire directions.
-
WireElement(WireElement)
- Constructs empty WireElement.
-
getCurrent(int, double)
- Main function for calculations.
-
getInfo(int)
-
Returns information for this element, such as voltage, current etc.
-
getProperties()
- This method is called to get values of element.
-
paint(Graphics, int, Dimension, boolean, boolean)
-
Paints the element on the given graphic context.
-
parseString(String)
- This method is called to load new values to element from string.
-
setProperties(String[])
- This method is called to set new values to element.
WireElement
public WireElement()
- Constructs WireElement without initial wires.
WireElement
public WireElement(WireElement e)
- Constructs empty WireElement.
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).
getCurrent
public Polynom getCurrent(int dir,
double timeStep)
- Main function for calculations.
- Overrides:
- getCurrent in class Element
getProperties
public Object[] getProperties()
- This method is called to get values of element. Six Objects for each parameter:
- Name of parameter
- Value
- Minimal valid order
- Maximal valid order
- Current order
- Units
- Returns:
- array of Objects.
- Overrides:
- getProperties in class Element
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
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
getInfo
public String[] getInfo(int angle)
- Returns information for this element, such as voltage, current etc.
- Overrides:
- getInfo in class Element
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