From 1cd78891ef11a7ff640f2fa6203d6345445bc3fd Mon Sep 17 00:00:00 2001 From: longerian Date: Fri, 23 Mar 2018 19:20:33 +0800 Subject: [PATCH] add tangram op --- .../tmall/wireless/tangram/TangramEngine.java | 9 +++ .../wireless/tangram/eventbus/BusSupport.java | 16 ++--- .../wireless/tangram/eventbus/Event.java | 8 +-- .../wireless/tangram/eventbus/EventPool.java | 2 +- .../wireless/tangram/op/AppendGroupOp.java | 40 +++++++++++ .../wireless/tangram/op/AppendGroupsOp.java | 42 +++++++++++ .../wireless/tangram/op/InsertCellListOp.java | 42 +++++++++++ .../wireless/tangram/op/InsertCellOp.java | 42 +++++++++++ .../wireless/tangram/op/InsertGroupOp.java | 40 +++++++++++ .../wireless/tangram/op/InsertGroupsOp.java | 42 +++++++++++ .../wireless/tangram/op/RemoveCellOp.java | 40 +++++++++++ .../tangram/op/RemoveCellPositionOp.java | 38 ++++++++++ .../wireless/tangram/op/RemoveGroupIdxOp.java | 40 +++++++++++ .../wireless/tangram/op/RemoveGroupOp.java | 40 +++++++++++ .../wireless/tangram/op/ReplaceCellOp.java | 40 +++++++++++ .../tangram/op/ReplaceGroupContentOp.java | 43 ++++++++++++ .../wireless/tangram/op/ReplaceGroupOp.java | 43 ++++++++++++ .../tmall/wireless/tangram/op/TangramOp1.java | 70 +++++++++++++++++++ .../tmall/wireless/tangram/op/TangramOp2.java | 46 ++++++++++++ .../wireless/tangram/op/UpdateCellOp.java | 40 +++++++++++ 20 files changed, 710 insertions(+), 13 deletions(-) create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupsOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellListOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupsOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellPositionOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupIdxOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceCellOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupContentOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupOp.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp1.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp2.java create mode 100644 tangram/src/main/java/com/tmall/wireless/tangram/op/UpdateCellOp.java diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/TangramEngine.java b/tangram/src/main/java/com/tmall/wireless/tangram/TangramEngine.java index 01c8518..e22e4f7 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/TangramEngine.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/TangramEngine.java @@ -790,6 +790,15 @@ public class TangramEngine extends BaseTangramEngine } + public Consumer asReplaceCardConsumer() { + return new Consumer() { + @Override + public void accept(Object o) throws Exception { + + } + }; + } + /** * Make engine as a consumer to accept data to append at the end of list diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java index ae8c1a0..1e79797 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java @@ -91,7 +91,7 @@ public class BusSupport implements IDispatcherDelegate { /** * Post an event to the bus, called by event sender - * @param event Event object + * @param event TangramOp1 object * @return Return true if the event is successfully enqueued into the event queue. */ public boolean post(@NonNull Event event) { @@ -100,7 +100,7 @@ public class BusSupport implements IDispatcherDelegate { /** * Post a list of events to the bus, called by event sender - * @param eventList Event object list + * @param eventList TangramOp1 object list * @return Return true if the events are successfully enqueued into the event queue. */ public boolean post(@NonNull List eventList) { @@ -109,7 +109,7 @@ public class BusSupport implements IDispatcherDelegate { /** * Dispatch event to a subscriber, you should not call this method directly. - * @param event Event object + * @param event TangramOp1 object */ @Override public synchronized void dispatch(@NonNull Event event) { @@ -138,12 +138,12 @@ public class BusSupport implements IDispatcherDelegate { /** * - * @param type Event type to identify an event. - * @param sourceId Event sender's unique id. If sourceId is empty, the event would be dispatched to any + * @param type TangramOp1 type to identify an event. + * @param sourceId TangramOp1 sender's unique id. If sourceId is empty, the event would be dispatched to any * subscribers which is registered to receive events with 'type'. Otherwise, the event would be * dispatched to any subscribers which is registered to receive events with 'type' and this 'sourceId'. - * @param args Event args, may be null. - * @param eventContext Event context, see {@link EventContext}, may by null. + * @param args TangramOp1 args, may be null. + * @param eventContext TangramOp1 context, see {@link EventContext}, may by null. * @return An event object from recycler pool. It is suggested to use this method to obtain an event object. The * returned object's field is filled provided params. */ @@ -162,7 +162,7 @@ public class BusSupport implements IDispatcherDelegate { * @param type The event type subcriber is interested. * @param producer The event source id subscriber is interested. * @param subscriber Original subscriber object. - * @param action The name of callback method with parameter 'Event'. If empty, the subscribe must provide a handler method named 'execute'. See {@link ReflectedActionFinder} + * @param action The name of callback method with parameter 'TangramOp1'. If empty, the subscribe must provide a handler method named 'execute'. See {@link ReflectedActionFinder} * @return An EventHandlerWrapper wrapping a subscriber and used to registered into event bus. */ public static EventHandlerWrapper wrapEventHandler(@NonNull String type, String producer, @NonNull Object subscriber, diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java index 13f23e9..6ac9c8a 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/Event.java @@ -32,17 +32,17 @@ import android.support.v4.util.ArrayMap; public class Event { /** - * Event type + * TangramOp1 type */ public String type; /** - * Event producer's Id + * TangramOp1 producer's Id */ public String sourceId; /** - * Event args + * TangramOp1 args */ public ArrayMap args; @@ -68,7 +68,7 @@ public class Event { @Override public String toString() { - return "Event{" + + return "TangramOp1{" + "args=" + args + ", sourceId='" + sourceId + '\'' + ", type=" + type + diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/EventPool.java b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/EventPool.java index 653da6e..2104504 100644 --- a/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/EventPool.java +++ b/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/EventPool.java @@ -30,7 +30,7 @@ import android.support.v4.util.Pools; /** * Created by longerian on 16/4/26. * - * Event pool to recycle consumed event. + * TangramOp1 pool to recycle consumed event. */ class EventPool { diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupOp.java new file mode 100644 index 0000000..f524179 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class AppendGroupOp extends TangramOp1 { + public AppendGroupOp(Card arg1) { + super(OP_TYPE.APPEND_GROUP, arg1); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupsOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupsOp.java new file mode 100644 index 0000000..f1f8f56 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/AppendGroupsOp.java @@ -0,0 +1,42 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import java.util.List; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class AppendGroupsOp extends TangramOp1> { + public AppendGroupsOp(List arg1) { + super(OP_TYPE.APPEND_GROUP_LIST, arg1); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellListOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellListOp.java new file mode 100644 index 0000000..e28c60d --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellListOp.java @@ -0,0 +1,42 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import java.util.List; + +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class InsertCellListOp extends TangramOp2> { + public InsertCellListOp(Integer arg1, List arg2) { + super(OP_TYPE.INSERT_CELL_LIST, arg1, arg2); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellOp.java new file mode 100644 index 0000000..62169fc --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertCellOp.java @@ -0,0 +1,42 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class InsertCellOp extends TangramOp2 { + + public InsertCellOp(int arg1, BaseCell arg2) { + super(OP_TYPE.INSERT_CELL, arg1, arg2); + } + +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupOp.java new file mode 100644 index 0000000..df99e12 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class InsertGroupOp extends TangramOp2 { + public InsertGroupOp(Integer arg1, Card arg2) { + super(OP_TYPE.INSERT_GROUP, arg1, arg2); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupsOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupsOp.java new file mode 100644 index 0000000..af7502a --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/InsertGroupsOp.java @@ -0,0 +1,42 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import java.util.List; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class InsertGroupsOp extends TangramOp2> { + public InsertGroupsOp(Integer arg1, List arg2) { + super(OP_TYPE.INSERT_GROUP_LIST, arg1, arg2); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellOp.java new file mode 100644 index 0000000..54ba662 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class RemoveCellOp extends TangramOp1 { + public RemoveCellOp(BaseCell arg1) { + super(OP_TYPE.REMOVE_CELL, arg1); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellPositionOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellPositionOp.java new file mode 100644 index 0000000..e1a0e21 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveCellPositionOp.java @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class RemoveCellPositionOp extends TangramOp1 { + public RemoveCellPositionOp(Integer arg1) { + super(OP_TYPE.REMOVE_CELL_POSITION, arg1); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupIdxOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupIdxOp.java new file mode 100644 index 0000000..c08e786 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupIdxOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class RemoveGroupIdxOp extends TangramOp1 { + public RemoveGroupIdxOp(Integer arg1) { + super(OP_TYPE.REMOVE_GROUP_IDX, arg1); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupOp.java new file mode 100644 index 0000000..d3b5b80 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/RemoveGroupOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class RemoveGroupOp extends TangramOp1 { + public RemoveGroupOp(Card arg1) { + super(OP_TYPE.REMOVE_GROUP, arg1); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceCellOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceCellOp.java new file mode 100644 index 0000000..9b8ebab --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceCellOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class ReplaceCellOp extends TangramOp2 { + public ReplaceCellOp(BaseCell arg1, BaseCell arg2) { + super(OP_TYPE.REPLACE_CELL, arg1, arg2); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupContentOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupContentOp.java new file mode 100644 index 0000000..ad7e240 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupContentOp.java @@ -0,0 +1,43 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import java.util.List; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class ReplaceGroupContentOp extends TangramOp2> { + public ReplaceGroupContentOp(Card arg1, List arg2) { + super(OP_TYPE.REPLACE_GROUP_CONTENT, arg1, arg2); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupOp.java new file mode 100644 index 0000000..c9e1b00 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/ReplaceGroupOp.java @@ -0,0 +1,43 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import java.util.List; + +import com.tmall.wireless.tangram.dataparser.concrete.Card; +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class ReplaceGroupOp extends TangramOp2 { + public ReplaceGroupOp(Card arg1, Card arg2) { + super(OP_TYPE.REPLACE_GROUP, arg1, arg2); + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp1.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp1.java new file mode 100644 index 0000000..812c311 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp1.java @@ -0,0 +1,70 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class TangramOp1 { + + public TangramOp1(int type, V1 arg1) { + mType = type; + this.arg1 = arg1; + } + + public static class OP_TYPE { + public static final int INSERT_CELL = 0; + public static final int INSERT_CELL_LIST = 1; + public static final int INSERT_GROUP = 2; + public static final int INSERT_GROUP_LIST = 3; + public static final int APPEND_GROUP = 4; + public static final int APPEND_GROUP_LIST = 5; + public static final int REMOVE_CELL_POSITION = 6; + public static final int REMOVE_CELL = 7; + public static final int REMOVE_GROUP_IDX = 8; + public static final int REMOVE_GROUP = 9; + public static final int REPLACE_CELL = 10; + public static final int REPLACE_GROUP_CONTENT = 11; + public static final int REPLACE_GROUP = 12; + public static final int UPDATE_CELL = 13; + } + + private final int mType; + + private final V1 arg1; + + public int getType() { + return mType; + } + + public V1 getArg1() { + return arg1; + } + +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp2.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp2.java new file mode 100644 index 0000000..8dd40d1 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/TangramOp2.java @@ -0,0 +1,46 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class TangramOp2 extends TangramOp1 { + + private final V2 arg2; + + public TangramOp2(int type, V1 arg1, V2 arg2) { + super(type, arg1); + this.arg2 = arg2; + } + + public V2 getArg2() { + return arg2; + } +} diff --git a/tangram/src/main/java/com/tmall/wireless/tangram/op/UpdateCellOp.java b/tangram/src/main/java/com/tmall/wireless/tangram/op/UpdateCellOp.java new file mode 100644 index 0000000..1172c84 --- /dev/null +++ b/tangram/src/main/java/com/tmall/wireless/tangram/op/UpdateCellOp.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2018 Alibaba Group + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.tmall.wireless.tangram.op; + +import com.tmall.wireless.tangram.structure.BaseCell; + +/** + * Created by longerian on 2018/3/23. + * + * @author longerian + * @date 2018/03/23 + */ + +public class UpdateCellOp extends TangramOp1 { + public UpdateCellOp(BaseCell arg1) { + super(OP_TYPE.UPDATE_CELL, arg1); + } +}