Initial commit
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package com.ubt.jimu.controller.data.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.ubt.jimu.controller.data.widget.AccumulatorData;
|
||||
|
||||
@XStreamAlias("XLSliderConfig")
|
||||
/* loaded from: classes.dex */
|
||||
public class AccumulatorConfig extends WidgetConfig<AccumulatorData> {
|
||||
private int launchAngle;
|
||||
private int servoID;
|
||||
private int startAngle;
|
||||
|
||||
public AccumulatorConfig() {
|
||||
this.startAngle = WidgetConfig.MIN_ANGLE;
|
||||
this.launchAngle = 118;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof AccumulatorConfig)) {
|
||||
return false;
|
||||
}
|
||||
AccumulatorConfig accumulatorConfig = (AccumulatorConfig) obj;
|
||||
return this.servoID == accumulatorConfig.servoID && this.startAngle == accumulatorConfig.startAngle && this.launchAngle == accumulatorConfig.launchAngle;
|
||||
}
|
||||
|
||||
public int getLaunchAngle() {
|
||||
return this.launchAngle;
|
||||
}
|
||||
|
||||
public int getServoID() {
|
||||
return this.servoID;
|
||||
}
|
||||
|
||||
public int getStartAngle() {
|
||||
return this.startAngle;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (((this.servoID * 31) + this.startAngle) * 31) + this.launchAngle;
|
||||
}
|
||||
|
||||
public void setLaunchAngle(int i) {
|
||||
this.launchAngle = i;
|
||||
}
|
||||
|
||||
public void setServoID(int i) {
|
||||
this.servoID = i;
|
||||
}
|
||||
|
||||
public void setStartAngle(int i) {
|
||||
this.startAngle = i;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public String toString() {
|
||||
return "AccumulatorConfig{servoID=" + this.servoID + ", startAngle=" + this.startAngle + ", launchAngle=" + this.launchAngle + "} " + super.toString();
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public AccumulatorData encapData() {
|
||||
AccumulatorData accumulatorData = new AccumulatorData();
|
||||
accumulatorData.setConfig(this);
|
||||
return accumulatorData;
|
||||
}
|
||||
|
||||
public AccumulatorConfig(String str, int i, int i2, int i3) {
|
||||
super(str);
|
||||
this.startAngle = WidgetConfig.MIN_ANGLE;
|
||||
this.launchAngle = 118;
|
||||
this.servoID = i;
|
||||
this.startAngle = i2;
|
||||
this.launchAngle = i3;
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package com.ubt.jimu.controller.data.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.ubt.jimu.controller.data.widget.HSliderWidgetData;
|
||||
|
||||
@XStreamAlias("HSliderConfig")
|
||||
/* loaded from: classes.dex */
|
||||
public class HSliderConfig extends WidgetConfig<HSliderWidgetData> {
|
||||
private int maxAngle;
|
||||
private int minAngle;
|
||||
private int servoID;
|
||||
|
||||
public HSliderConfig() {
|
||||
this.minAngle = WidgetConfig.MIN_ANGLE;
|
||||
this.maxAngle = 118;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof HSliderConfig)) {
|
||||
return false;
|
||||
}
|
||||
HSliderConfig hSliderConfig = (HSliderConfig) obj;
|
||||
return this.servoID == hSliderConfig.servoID && this.minAngle == hSliderConfig.minAngle && this.maxAngle == hSliderConfig.maxAngle;
|
||||
}
|
||||
|
||||
public int getMaxAngle() {
|
||||
return this.maxAngle;
|
||||
}
|
||||
|
||||
public int getMinAngle() {
|
||||
return this.minAngle;
|
||||
}
|
||||
|
||||
public int getServoID() {
|
||||
return this.servoID;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (((this.servoID * 31) + this.minAngle) * 31) + this.maxAngle;
|
||||
}
|
||||
|
||||
public void setMaxAngle(int i) {
|
||||
this.maxAngle = i;
|
||||
}
|
||||
|
||||
public void setMinAngle(int i) {
|
||||
this.minAngle = i;
|
||||
}
|
||||
|
||||
public void setServoID(int i) {
|
||||
this.servoID = i;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" servoID=" + this.servoID);
|
||||
sb.append(" minAngle=" + this.minAngle);
|
||||
sb.append(" maxAngle=" + this.maxAngle);
|
||||
return super.toString() + sb.toString();
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public HSliderWidgetData encapData() {
|
||||
HSliderWidgetData hSliderWidgetData = new HSliderWidgetData();
|
||||
hSliderWidgetData.setConfig(this);
|
||||
return hSliderWidgetData;
|
||||
}
|
||||
|
||||
public HSliderConfig(String str, int i, int i2, int i3) {
|
||||
super(str);
|
||||
this.minAngle = WidgetConfig.MIN_ANGLE;
|
||||
this.maxAngle = 118;
|
||||
this.servoID = i;
|
||||
this.minAngle = i2;
|
||||
this.maxAngle = i3;
|
||||
}
|
||||
}
|
293
sources/com/ubt/jimu/controller/data/config/JockstickConfig.java
Normal file
293
sources/com/ubt/jimu/controller/data/config/JockstickConfig.java
Normal file
@@ -0,0 +1,293 @@
|
||||
package com.ubt.jimu.controller.data.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import com.ubt.jimu.base.data.CtrlMotionType;
|
||||
import com.ubt.jimu.controller.data.widget.JockstickData;
|
||||
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@XStreamAlias("JockstickConfig")
|
||||
/* loaded from: classes.dex */
|
||||
public class JockstickConfig extends WidgetConfig<JockstickData> {
|
||||
private int index;
|
||||
|
||||
@XStreamOmitField
|
||||
private Map<Integer, Wheel> mTempWheelMap;
|
||||
private CtrlMotionType motionType;
|
||||
private JockType type;
|
||||
|
||||
@XStreamImplicit(itemFieldName = JockstickDataConverter.WHEEL)
|
||||
private List<Wheel> wheelList;
|
||||
|
||||
public enum JockType {
|
||||
twoServo,
|
||||
treeServo,
|
||||
fourServo,
|
||||
sixServo,
|
||||
none
|
||||
}
|
||||
|
||||
public JockstickConfig() {
|
||||
this.type = JockType.twoServo;
|
||||
this.motionType = CtrlMotionType.servo;
|
||||
}
|
||||
|
||||
static /* synthetic */ int a(Wheel wheel, Wheel wheel2) {
|
||||
if (wheel == null && wheel2 == null) {
|
||||
return 0;
|
||||
}
|
||||
if (wheel == null) {
|
||||
return -1;
|
||||
}
|
||||
if (wheel2 == null) {
|
||||
return 1;
|
||||
}
|
||||
return wheel.getPosition() - wheel2.getPosition();
|
||||
}
|
||||
|
||||
private boolean checkValid(int i) {
|
||||
List<Wheel> list = this.wheelList;
|
||||
if (list == null || list.size() < i) {
|
||||
return false;
|
||||
}
|
||||
for (Wheel wheel : this.wheelList) {
|
||||
if (wheel == null || wheel.getId() <= 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void copyList2Map(List<Wheel> list, Map<Integer, Wheel> map) {
|
||||
for (Wheel wheel : list) {
|
||||
if (wheel != null) {
|
||||
map.put(Integer.valueOf(wheel.getPosition()), wheel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void sortWheelList(List<Wheel> list) {
|
||||
Collections.sort(list, new Comparator() { // from class: com.ubt.jimu.controller.data.config.a
|
||||
@Override // java.util.Comparator
|
||||
public final int compare(Object obj, Object obj2) {
|
||||
return JockstickConfig.a((Wheel) obj, (Wheel) obj2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void checkEngineExist(int i) {
|
||||
List<Wheel> list;
|
||||
if (i == 0 || (list = this.wheelList) == null || list.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
for (Wheel wheel : new ArrayList(this.wheelList)) {
|
||||
if (wheel != null && wheel.getId() == i) {
|
||||
this.wheelList.remove(wheel);
|
||||
this.mTempWheelMap.remove(Integer.valueOf(wheel.getPosition()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public JockstickConfig cloneJockstickConfig() {
|
||||
JockstickConfig jockstickConfig = new JockstickConfig();
|
||||
List<Wheel> list = this.wheelList;
|
||||
if (list != null && list.size() > 0) {
|
||||
ArrayList arrayList = new ArrayList(this.wheelList.size());
|
||||
Iterator<Wheel> it = this.wheelList.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(it.next());
|
||||
}
|
||||
jockstickConfig.setWheelList(arrayList);
|
||||
}
|
||||
jockstickConfig.setType(this.type);
|
||||
jockstickConfig.setMotionType(this.motionType);
|
||||
jockstickConfig.setIndex(this.index);
|
||||
return jockstickConfig;
|
||||
}
|
||||
|
||||
public void emptyWheelList() {
|
||||
List<Wheel> list = this.wheelList;
|
||||
if (list != null) {
|
||||
list.clear();
|
||||
}
|
||||
Map<Integer, Wheel> map = this.mTempWheelMap;
|
||||
if (map != null) {
|
||||
map.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof JockstickConfig)) {
|
||||
return false;
|
||||
}
|
||||
JockstickConfig jockstickConfig = (JockstickConfig) obj;
|
||||
if (this.type != jockstickConfig.type || this.motionType != jockstickConfig.motionType) {
|
||||
return false;
|
||||
}
|
||||
List<Wheel> list = this.wheelList;
|
||||
if (list == null) {
|
||||
return jockstickConfig.wheelList == null;
|
||||
}
|
||||
sortWheelList(list);
|
||||
List<Wheel> list2 = jockstickConfig.wheelList;
|
||||
if (list2 == null) {
|
||||
return false;
|
||||
}
|
||||
sortWheelList(list2);
|
||||
return this.wheelList.equals(jockstickConfig.wheelList);
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return this.index;
|
||||
}
|
||||
|
||||
public CtrlMotionType getMotionType() {
|
||||
return this.motionType;
|
||||
}
|
||||
|
||||
public List<Integer> getServoList() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
List<Wheel> list = this.wheelList;
|
||||
if (list != null && list.size() > 0) {
|
||||
for (Wheel wheel : this.wheelList) {
|
||||
if (wheel != null && wheel.getId() > 0) {
|
||||
arrayList.add(Integer.valueOf(wheel.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public JockType getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public Wheel getWheel(int i) {
|
||||
Map<Integer, Wheel> map;
|
||||
List<Wheel> list;
|
||||
if (this.mTempWheelMap == null && (list = this.wheelList) != null && list.size() > 0) {
|
||||
this.mTempWheelMap = new HashMap(this.wheelList.size());
|
||||
copyList2Map(this.wheelList, this.mTempWheelMap);
|
||||
}
|
||||
if (i <= 0 || (map = this.mTempWheelMap) == null) {
|
||||
return null;
|
||||
}
|
||||
return map.get(Integer.valueOf(i));
|
||||
}
|
||||
|
||||
public List<Wheel> getWheelList() {
|
||||
return this.wheelList;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
JockType jockType = this.type;
|
||||
int hashCode = (jockType != null ? jockType.hashCode() : 0) * 31;
|
||||
CtrlMotionType ctrlMotionType = this.motionType;
|
||||
int hashCode2 = (hashCode + (ctrlMotionType != null ? ctrlMotionType.hashCode() : 0)) * 31;
|
||||
List<Wheel> list = this.wheelList;
|
||||
return hashCode2 + (list != null ? list.hashCode() : 0);
|
||||
}
|
||||
|
||||
public boolean isOK() {
|
||||
JockType jockType = this.type;
|
||||
if (jockType == JockType.none) {
|
||||
return false;
|
||||
}
|
||||
if (jockType == JockType.twoServo) {
|
||||
return checkValid(2);
|
||||
}
|
||||
if (jockType == JockType.fourServo) {
|
||||
return checkValid(4);
|
||||
}
|
||||
if (jockType == JockType.sixServo) {
|
||||
return checkValid(6);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void putWheel(int i, Wheel wheel) {
|
||||
if (this.mTempWheelMap == null) {
|
||||
this.mTempWheelMap = new HashMap();
|
||||
}
|
||||
if (this.wheelList == null) {
|
||||
this.wheelList = new ArrayList();
|
||||
}
|
||||
if (i > 0) {
|
||||
this.mTempWheelMap.put(Integer.valueOf(i), wheel);
|
||||
List<Wheel> list = this.wheelList;
|
||||
if (list != null && list.size() > 0) {
|
||||
for (Wheel wheel2 : new ArrayList(this.wheelList)) {
|
||||
if (wheel2.getId() == wheel.getId() || wheel2.getPosition() == i) {
|
||||
this.wheelList.remove(wheel2);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.wheelList.add(wheel);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIndex(int i) {
|
||||
this.index = i;
|
||||
}
|
||||
|
||||
public void setMotionType(CtrlMotionType ctrlMotionType) {
|
||||
this.motionType = ctrlMotionType;
|
||||
}
|
||||
|
||||
public void setType(JockType jockType) {
|
||||
this.type = jockType;
|
||||
}
|
||||
|
||||
public void setWheelList(List<Wheel> list) {
|
||||
this.wheelList = list;
|
||||
if (list == null || list.size() <= 0) {
|
||||
Map<Integer, Wheel> map = this.mTempWheelMap;
|
||||
if (map != null) {
|
||||
map.clear();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.mTempWheelMap == null) {
|
||||
this.mTempWheelMap = new HashMap(list.size());
|
||||
for (Wheel wheel : list) {
|
||||
if (wheel != null) {
|
||||
this.mTempWheelMap.put(Integer.valueOf(wheel.getPosition()), wheel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public String toString() {
|
||||
return "JockstickConfig{type=" + this.type + ", motionType=" + this.motionType + ", index=" + this.index + ", wheelList=" + this.wheelList + "} " + super.toString();
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public JockstickData encapData() {
|
||||
JockstickData jockstickData = new JockstickData();
|
||||
jockstickData.setConfig(this);
|
||||
return jockstickData;
|
||||
}
|
||||
|
||||
public JockstickConfig(String str, JockType jockType, CtrlMotionType ctrlMotionType) {
|
||||
super(str);
|
||||
this.type = JockType.twoServo;
|
||||
this.motionType = CtrlMotionType.servo;
|
||||
this.motionType = ctrlMotionType;
|
||||
this.type = jockType;
|
||||
}
|
||||
}
|
@@ -0,0 +1,84 @@
|
||||
package com.ubt.jimu.controller.data.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.ubt.jimu.base.data.CtrlMotionType;
|
||||
import com.ubt.jimu.controller.data.widget.SliderWidgetData;
|
||||
|
||||
@XStreamAlias("SliderConfig")
|
||||
/* loaded from: classes.dex */
|
||||
public class SliderConfig extends WidgetConfig<SliderWidgetData> {
|
||||
private boolean directionDisclock;
|
||||
private CtrlMotionType motionType;
|
||||
private int servoID;
|
||||
|
||||
public SliderConfig() {
|
||||
this.motionType = CtrlMotionType.servo;
|
||||
this.directionDisclock = false;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof SliderConfig)) {
|
||||
return false;
|
||||
}
|
||||
SliderConfig sliderConfig = (SliderConfig) obj;
|
||||
return this.servoID == sliderConfig.servoID && this.directionDisclock == sliderConfig.directionDisclock && this.motionType == sliderConfig.motionType;
|
||||
}
|
||||
|
||||
public CtrlMotionType getMotionType() {
|
||||
return this.motionType;
|
||||
}
|
||||
|
||||
public int getServoID() {
|
||||
return this.servoID;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int i = this.servoID * 31;
|
||||
CtrlMotionType ctrlMotionType = this.motionType;
|
||||
return ((i + (ctrlMotionType != null ? ctrlMotionType.hashCode() : 0)) * 31) + (this.directionDisclock ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean isDirectionDisclock() {
|
||||
return this.directionDisclock;
|
||||
}
|
||||
|
||||
public void setDirectionDisclock(boolean z) {
|
||||
this.directionDisclock = z;
|
||||
}
|
||||
|
||||
public void setMotionType(CtrlMotionType ctrlMotionType) {
|
||||
this.motionType = ctrlMotionType;
|
||||
}
|
||||
|
||||
public void setServoID(int i) {
|
||||
this.servoID = i;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" servoID= " + getServoID());
|
||||
sb.append(" motionType= " + getMotionType());
|
||||
sb.append(" directionDisclock= " + isDirectionDisclock());
|
||||
return super.toString() + sb.toString();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.controller.data.config.WidgetConfig
|
||||
public SliderWidgetData encapData() {
|
||||
SliderWidgetData sliderWidgetData = new SliderWidgetData();
|
||||
sliderWidgetData.setConfig(this);
|
||||
return sliderWidgetData;
|
||||
}
|
||||
|
||||
public SliderConfig(String str, CtrlMotionType ctrlMotionType, int i, boolean z) {
|
||||
super(str);
|
||||
this.motionType = CtrlMotionType.servo;
|
||||
this.directionDisclock = false;
|
||||
this.servoID = i;
|
||||
this.motionType = ctrlMotionType;
|
||||
this.directionDisclock = z;
|
||||
}
|
||||
}
|
73
sources/com/ubt/jimu/controller/data/config/Wheel.java
Normal file
73
sources/com/ubt/jimu/controller/data/config/Wheel.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.ubt.jimu.controller.data.config;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
|
||||
|
||||
@XStreamAlias(JockstickDataConverter.WHEEL)
|
||||
/* loaded from: classes.dex */
|
||||
public class Wheel {
|
||||
|
||||
@XStreamAsAttribute
|
||||
private int id;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private int position;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private boolean reverse;
|
||||
|
||||
public Wheel() {
|
||||
this.reverse = false;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof Wheel)) {
|
||||
return false;
|
||||
}
|
||||
Wheel wheel = (Wheel) obj;
|
||||
return this.id == wheel.id && this.position == wheel.position && this.reverse == wheel.reverse;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return this.position;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (((this.id * 31) + this.position) * 31) + (this.reverse ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean isReverse() {
|
||||
return this.reverse;
|
||||
}
|
||||
|
||||
public void setId(int i) {
|
||||
this.id = i;
|
||||
}
|
||||
|
||||
public void setPosition(int i) {
|
||||
this.position = i;
|
||||
}
|
||||
|
||||
public void setReverse(boolean z) {
|
||||
this.reverse = z;
|
||||
}
|
||||
|
||||
public Wheel(int i, int i2) {
|
||||
this.reverse = false;
|
||||
this.id = i;
|
||||
this.position = i2;
|
||||
}
|
||||
|
||||
public Wheel(int i, int i2, boolean z) {
|
||||
this(i, i2);
|
||||
this.reverse = z;
|
||||
}
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package com.ubt.jimu.controller.data.config;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.ubt.jimu.controller.data.widget.MoveBaseData;
|
||||
import com.ubt.jimu.controller.util.IDGenerator;
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class WidgetConfig<D extends MoveBaseData> implements Serializable {
|
||||
public static final int CUSTOM = 2;
|
||||
public static final int MAX_ANGLE = 118;
|
||||
public static final int MIN_ANGLE = -118;
|
||||
public static final int OFFICIAL = 1;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private String configID;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private int configType = 2;
|
||||
|
||||
@XStreamAsAttribute
|
||||
private long updateTime;
|
||||
|
||||
public WidgetConfig() {
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
this.configID = IDGenerator.a(currentTimeMillis);
|
||||
this.updateTime = currentTimeMillis;
|
||||
}
|
||||
|
||||
public abstract D encapData();
|
||||
|
||||
public String getConfigID() {
|
||||
return this.configID;
|
||||
}
|
||||
|
||||
public int getConfigType() {
|
||||
return this.configType;
|
||||
}
|
||||
|
||||
public long getUpdateTime() {
|
||||
return this.updateTime;
|
||||
}
|
||||
|
||||
public void setConfigID(String str) {
|
||||
this.configID = str;
|
||||
}
|
||||
|
||||
public void setConfigType(int i) {
|
||||
this.configType = i;
|
||||
}
|
||||
|
||||
public void setUpdateTime(long j) {
|
||||
this.updateTime = j;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" configID=" + this.configID);
|
||||
sb.append(" configType=" + this.configType);
|
||||
sb.append(" updateTime=" + this.updateTime);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public WidgetConfig(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
init();
|
||||
} else {
|
||||
this.configID = str;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user