twaver
Class Size

java.lang.Object
  extended by twaver.Size
All Implemented Interfaces:
IStruct, ISerializable
Direct Known Subclasses:
Rect

public class Size
extends java.lang.Object
implements IStruct, ISerializable

用于描述对象的尺寸或者大小,包含宽度和高度两个参数,默认宽高为0


Field Summary
 float height
          高度
 float width
          宽度
 
Constructor Summary
Size()
          用于描述对象的尺寸或者大小,包含宽度和高度两个参数,默认宽高为0
Size(double width, double height)
          指定宽高
Size(Size size)
           
 
Method Summary
 Size clone()
          拷贝一份新的数据,避免对原始数据的更改
 void deserialize(java.lang.String string)
          反序列化属性,根据字符串生成对象的属性
 boolean equals(java.lang.Object o)
           
 boolean isEmpty()
          宽度或者高度为0时,表示该对象没有面积,为空
 java.lang.String serialize()
          序列化该对象
 void setHeight(float height)
          设置高度
 void setWidth(float width)
          设置宽度
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public float width
宽度


height

public float height
高度

Constructor Detail

Size

public Size()
用于描述对象的尺寸或者大小,包含宽度和高度两个参数,默认宽高为0


Size

public Size(double width,
            double height)
指定宽高

Parameters:
width - 宽度
height - 高度

Size

public Size(Size size)
Method Detail

isEmpty

public boolean isEmpty()
宽度或者高度为0时,表示该对象没有面积,为空

Returns:
是否为空

setWidth

public void setWidth(float width)
设置宽度

Parameters:
width - 宽度

setHeight

public void setHeight(float height)
设置高度

Parameters:
height - 高度

clone

public Size clone()
Description copied from interface: IStruct
拷贝一份新的数据,避免对原始数据的更改

Specified by:
clone in interface IStruct
Overrides:
clone in class java.lang.Object
Returns:
新拷贝的数据

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

serialize

public java.lang.String serialize()
Description copied from interface: ISerializable
序列化该对象

Specified by:
serialize in interface ISerializable
Returns:
字符串

deserialize

public void deserialize(java.lang.String string)
Description copied from interface: ISerializable
反序列化属性,根据字符串生成对象的属性

Specified by:
deserialize in interface ISerializable
Parameters:
string - 字符串

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object