API Reference 0.3.24dart_web_toolkit_textIntegerParser

IntegerParser class

A localized parser based on {@link NumberFormat#getDecimalFormat}.

class IntegerParser implements Parser<int> {

 static IntegerParser _INSTANCE;

 /**
  * Returns the instance of the no-op renderer.
  */
 factory IntegerParser.instance() {
   if (_INSTANCE == null) {
     _INSTANCE = new IntegerParser();
   }
   return _INSTANCE;
 }

 IntegerParser();

 int parse(String object) {
   if (object == null || object == "") {
     return null;
   }

   return int.parse(object);
 }
}

Implements

Parser<int>

Constructors

new IntegerParser() #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
IntegerParser();

factory IntegerParser.instance() #

Returns the instance of the no-op renderer.

factory IntegerParser.instance() {
 if (_INSTANCE == null) {
   _INSTANCE = new IntegerParser();
 }
 return _INSTANCE;
}

Methods

int parse(String object) #

int parse(String object) {
 if (object == null || object == "") {
   return null;
 }

 return int.parse(object);
}