数据类型之间的转换(eg:String—Integer -int)

本文通过示例展示了Java中整数类型的各种转换方法,包括int到Integer、Integer到int、String到Integer及反之的转换过程。此外,还介绍了如何使用Integer类的静态方法进行转换。
package test_basic;
public class TestInteger2 {
public static void main(String[] args) {
/*System.out.println(Integer.MAX_VALUE);
System.out.println(Integer.MIN_VALUE);*/

//各种数据类型之间的转换
//int ---- Integer
//int--->Integer
int a=12;
Integer i1 = new Integer(a);
System.out.println(i1);

Integer i2=Integer.valueOf(a);//静态方法
System.out.println(i2);
//Integer---->int
int a2 = i2.intValue();
System.out.println(a2);

//String --- Integer
//String--->Integer
String str="123";
Integer i3 = new Integer(str);
System.out.println(i3);
Integer i4 = Integer.valueOf(str);
System.out.println(i4);

//Integer--->String
String s1=i4.toString();
System.out.println(s1);
String s2=i4+"";
System.out.println(s2);

//int  ----  String
//int--->String
int a3=123;
String s3=a3+"";
System.out.println(s3);

//String--->int
String s4="1234 ";
int a4=Integer.parseInt(s4);
System.out.println(a4);
}
}
GetSupportedMetadata Description: This method provides a computer readable description of the metadata that the selected analytics modules can generate. The type parameter allows to select a single analytics module. By default the output shall relate to all analytics modules that exist in the device. The response shall provide a sample XML frame. The sample frame shall include all potentially generated elements by the selected analytics modules. Note that this e.g. does not need to include all possible class type enumerations. SOAP action: http://www.onvif.org/ver20/analytics/wsdl/GetSupportedMetadata Input: [GetSupportedMetadata] Type - optional; [QName] Optional reference to an AnalyticsModule Type returned from GetSupportedAnalyticsModules. Output: [GetSupportedMetadataResponse] AnalyticsModule - optional, unbounded; [MetadataInfo] Type - required; [QName] Reference to an AnalyticsModule Type. SampleFrame [Frame] Sample frame content starting with the tt:Frame node. UtcTime - required; [dateTime] Colorspace [string] Default color space of Color definitions in frame. Valid values are "RGB" and "YCbCr". Defaults to "YCbCr". Source [string] Optional name of the analytics module that generated this frame. PTZStatus - optional; [PTZStatus] Transformation - optional; [Transformation] Object - optional, unbounded; [Object] ObjectId [integer] UUID [string] Object unique identifier. Parent [integer] Object ID of the parent object. eg: License plate object has Vehicle object as parent. ParentUUID [string] Object UUID of the parent object. eg: License plate object has Vehicle object as parent. Appearance - optional; [Appearance] Transformation - optional; [Transformation] Shape - optional; [ShapeDescriptor] BoundingBox [Rectangle] CenterOfGravity [Vector] Polygon - optional, unbounded; [Polygon] Extension - optional; [ShapeDescriptorExtension] Color - optional; [ColorDescriptor] Class - optional; [ClassDescriptor] ClassCandidate - optional, unbounded; [ClassCandidate] Type [ClassType] - enum { 'Animal', 'Face', 'Human', 'Vehical', 'Other' } Likelihood [float] Extension - optional; [ClassDescriptorExtension] OtherTypes - unbounded; [OtherType] Type [string] Object Class Type Likelihood [float] A likelihood/probability that the corresponding object belongs to this class. The sum of the likelihoods shall NOT exceed 1 Type - optional, unbounded; [StringLikelihood] For well-defined values see tt:ObjectType. Other type definitions like tt:VehicleType may be applied as well. Extension - optional; [AppearanceExtension] GeoLocation - optional; [GeoLocation] VehicleInfo - optional, unbounded; [VehicleInfo] Type [StringLikelihood] Brand - optional; [StringLikelihood] Model - optional; [StringLikelihood] Color - optional; [ColorDescriptor] LicensePlateInfo - optional; [LicensePlateInfo] PlateNumber [StringLikelihood] A string of vehicle license plate number. PlateType - optional; [StringLikelihood] A description of the vehicle license plate, e.g., "Normal", "Police", "Diplomat" CountryCode - optional; [StringLikelihood] Describe the country of the license plate, in order to avoid the same license plate number. IssuingEntity - optional; [StringLikelihood] State province or authority that issue the license plate. HumanFace - optional; [HumanFace] HumanBody - optional; [HumanBody] ImageRef - optional; [anyURI] Image - optional; [base64Binary] BarcodeInfo - optional; [BarcodeInfo] Data [StringLikelihood] Information encoded in barcode Type - optional; [StringLikelihood] Acceptable values are defined in tt:BarcodeType PPM - optional; [float] Refers to the pixels per module SphericalCoordinate - optional; [SphericalCoordinate] Label - optional, unbounded; [LabelInfo] Likelihood [float] Authority [string] ID Behaviour - optional; [Behaviour] Removed - optional; Idle - optional; Extension - optional; [BehaviourExtension] Speed - optional; [float] Direction - optional; [GeoOrientation] Direction the object is moving. Yaw describes the horizontal direction in the range [-180..180] where 0 is towards the right of the device and 90 is away from the device. Pitch describes the vertical direction in the range [-90..90] where 90 is upwards. Extension - optional; [ObjectExtension] ObjectTree - optional; [ObjectTree] Rename - optional, unbounded; [Rename] from [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. to [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. Split - optional, unbounded; [Split] from [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. to - unbounded; [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. Merge - optional, unbounded; [Merge] from - unbounded; [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. to [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. Delete - optional, unbounded; [ObjectId] ObjectId [integer] UUID [string] Object unique identifier. Extension - optional; [ObjectTreeExtension] Extension - optional; [FrameExtension] MotionInCells - optional; [MotionInCells] Columns - required; [integer] Number of columns of the cell grid (x dimension) Rows - required; [integer] Number of rows of the cell grid (y dimension) Cells - required; [base64Binary] A “1” denotes a cell where motion is detected and a “0” an empty cell. The first cell is in the upper left corner. Then the cell order goes first from left to right and then from up to down. If the number of cells is not a multiple of 8 the last byte is filled with zeros. The information is run length encoded according to Packbit coding in ISO 12369 (TIFF, Revision 6.0). Extension - optional; [FrameExtension2] SceneImageRef - optional; [anyURI] SceneImage - optional; [base64Binary]根据这个说明完善一下int __tan__GetSupportedMetadata(struct soap *soap, struct _tan__GetSupportedMetadata *req, struct _tan__GetSupportedMetadataResponse *res)这个函数,目前只需要输出车辆数据
最新发布
10-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值