Package mobi :: Package mtld :: Package da :: Module data_type
[hide private]
[frames] | no frames]

Source Code for Module mobi.mtld.da.data_type

 1  #!/usr/bin/env python 
 2   
 3  """ 
 4  @copyright: 
 5   Copyright (c) 2014 by mTLD Top Level Domain Limited. All rights reserved.\n 
 6   Portions copyright (c) 2008 by Argo Interactive Limited.\n 
 7   Portions copyright (c) 2008 by Nokia Inc.\n 
 8   Portions copyright (c) 2008 by Telecom Italia Mobile S.p.A.\n 
 9   Portions copyright (c) 2008 by Volantis Systems Limited.\n 
10   Portions copyright (c) 2002-2008 by Andreas Staeding.\n 
11   Portions copyright (c) 2008 by Zandan.\n 
12  @author: dotMobi 
13  """ 
14 15 -class DataType(object):
16 """ 17 Class to represent the data types of the properties. 18 Each returned Property object has a data_type() method. 19 """ 20 21 BOOLEAN = 0 22 BYTE = 1 23 SHORT = 2 24 INTEGER = 3 25 LONG = 4 26 FLOAT = 5 27 DOUBLE = 6 28 STRING = 7 29 UNKNOWN = 8 30 31 __names = { 32 BOOLEAN:'Boolean', 33 BYTE: 'Byte', 34 SHORT: 'Short', 35 INTEGER:'Integer', 36 LONG: 'Long', 37 FLOAT: 'Float', 38 DOUBLE: 'Double', 39 STRING: 'String', 40 UNKNOWN:'Unknown' 41 } 42 43 @staticmethod
44 - def name(data_type_id):
45 if data_type_id in DataType.__names: 46 return DataType.__names[data_type_id] 47 return None
48