public class Charge extends ExperimentObject
Modifier and Type | Field and Description |
---|---|
static int |
MINUS
Static int to modele a negative charge.
|
static int |
NEUTRAL
Static int to modele a neutral component.
|
static int |
PLUS
Static int to modele a positive charge.
|
int |
sign
Sign of the charge according to the static fields.
|
int |
value
Value of the charge.
|
Constructor and Description |
---|
Charge(int sign,
int value)
Constructor for a charge.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getChargeAsFormattedString()
Returns the charge as a string of + or -.
|
int |
hashCode() |
String |
toString()
Returns a string representing the charge.
|
addUrParam, getParameterKey, getUrParam
public static final int PLUS
public static final int MINUS
public static final int NEUTRAL
public int sign
public int value
public Charge(int sign, int value)
sign
- sign of the charge as specified in static fieldsvalue
- value of the chargepublic String toString()
public String getChargeAsFormattedString()
Copyright © 2016. All rights reserved.