Class Charge
java.lang.Object
com.compomics.util.experiment.biology.ions.Charge
public class Charge extends Object
This class contains convenience methods for the handling of charges.
- Author:
- Marc Vaudel, Harald Barsnes
-
Constructor Summary
Constructors Constructor Description Charge()
Empty default constructor. -
Method Summary
Modifier and Type Method Description static String
getChargeAsFormattedString(int value)
Returns the charge as a string of + or -.static String
toString(int value)
Returns a string representing the charge.
-
Constructor Details
-
Charge
public Charge()Empty default constructor.
-
-
Method Details
-
toString
Returns a string representing the charge. For example 2+.- Parameters:
value
- the value of the charge- Returns:
- charge as a string
-
getChargeAsFormattedString
Returns the charge as a string of + or -. One for each charge. A charge of +1 however returns the empty string.- Parameters:
value
- the value of the charge- Returns:
- the charge as a string of +
-