text
stringlengths
10
2.72M
package com.espendwise.manta.web.controllers; import com.espendwise.manta.service.GroupService; import com.espendwise.manta.spi.AutoClean; import com.espendwise.manta.util.Utility; import com.espendwise.manta.web.forms.GroupForm; import com.espendwise.manta.web.util.IdPathKey; import com.espendwise.manta.web.util.SessionKey; import com.espendwise.manta.web.util.UrlPathAssistent; import com.espendwise.manta.model.view.GroupHeaderView; import org.apache.log4j.Logger; import org.apache.tiles.AttributeContext; import org.apache.tiles.context.TilesRequestContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.context.request.WebRequest; @Scope("request") @Controller("groupPreparer") @AutoClean(value = {SessionKey.GROUP_HEADER}, controller = GroupController.class) public class GroupPreparer extends AdminPortalPreparer { private static final Logger logger = Logger.getLogger(GroupPreparer.class); @Autowired public GroupService groupService; @Override public void execute(TilesRequestContext tilesContext, AttributeContext attributeContext) { logger.debug("execute()=> BEGIN"); super.execute(tilesContext, attributeContext); handleHeader(SessionKey.GROUP_HEADER); logger.debug("execute()=> END."); } public void handleHeader(String modelAttribute) { Object header = webRequest.getAttribute(modelAttribute, WebRequest.SCOPE_SESSION); if (header == null) { header = initHeader(); webRequest.setAttribute(modelAttribute, header, WebRequest.SCOPE_SESSION); } } @ModelAttribute(SessionKey.GROUP_HEADER) public Object initHeader() { Long groupId = UrlPathAssistent.getPathId(IdPathKey.GROUP_ID, webRequest); if (Utility.longNN(groupId ) > 0 ) { GroupForm detailForm = (GroupForm) webRequest.getAttribute(SessionKey.GROUP, WebRequest.SCOPE_REQUEST); return Utility.isSet(detailForm) ? new GroupHeaderView(detailForm.getGroupId(), detailForm.getGroupName(), detailForm.getGroupType()) : groupService.findGroupHeader(groupId); } else { return null; } } }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Distributions; /** * * @author Will_and_Sara */ public class ContinuousDistributionError { private String _ErrorMessage; public String ErrorMessage(){return _ErrorMessage;} public ContinuousDistributionError(String Message){ _ErrorMessage = Message; } }
package com.tencent.mm.plugin.wenote.model; import android.content.Context; import android.content.Intent; import com.tencent.mm.R; import com.tencent.mm.bg.d; import com.tencent.mm.g.a.mw; import com.tencent.mm.model.au; import com.tencent.mm.model.r; import com.tencent.mm.plugin.wenote.model.a.l; import com.tencent.mm.plugin.wenote.model.a.n; import com.tencent.mm.protocal.b.a.c; import com.tencent.mm.protocal.c.vx; import com.tencent.mm.protocal.c.vz; import com.tencent.mm.protocal.c.we; import com.tencent.mm.protocal.c.wn; import com.tencent.mm.sdk.b.a; import com.tencent.mm.sdk.platformtools.ad; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.ui.base.h; import java.util.HashMap; public final class j extends d { private static HashMap<String, l> qox = new HashMap(); private wn bOW = new wn(); private boolean bUY; private String bVJ; private c msX = null; private int qnY = 0; private int qnZ = 0; private String qoa; private Long qov; private boolean qow = false; static /* synthetic */ void a(j jVar) { if (qox.containsKey(jVar.bVJ)) { jVar.qnE = (l) qox.get(jVar.bVJ); return; } jVar.qnE = new l(); jVar.qnE.bJC = jVar.qov.longValue(); jVar.qnE.qoX = jVar.bVJ; if (jVar.msX != null && jVar.msX.dzs != null) { if (jVar.msX.qYa != null) { jVar.qnE.qoZ = jVar.msX.qYa.rBA; jVar.qnE.qoY = jVar.msX.qYa.rBz; jVar.qnE.qpa = jVar.msX.qYb; } jVar.qnE.msv = jVar.msX.dzs; jVar.qnE.bjS = 0; qox.put(jVar.bVJ, jVar.qnE); } } public j() { this.qnG.clear(); com.tencent.mm.plugin.fav.ui.c.aMi(); } public final void a(String str, Long l, boolean z, Context context, int i, int i2, wn wnVar) { this.bVJ = str; this.qov = l; this.bUY = z; this.qnY = i; this.qnZ = i2; this.bOW = wnVar; mw mwVar = new mw(); mwVar.bXL.type = 0; mwVar.bXL.bXN = str; a.sFg.m(mwVar); this.msX = mwVar.bXM.bXV; if (!(this.msX == null || this.msX.dzs == null || this.msX.dzs.size() <= 1)) { mw mwVar2 = new mw(); mwVar2.bXL.type = 9; mwVar2.bXL.bOz = (vx) this.msX.dzs.get(0); mwVar2.bXL.bJC = this.qov.longValue(); a.sFg.m(mwVar2); this.qow = mwVar2.bXM.bXX; } if (this.msX == null || this.msX.qYa == null) { this.qoa = null; } else { this.qoa = this.msX.qYa.rBz + ";" + this.msX.qYa.rBA + ";" + this.msX.qYb; } Intent intent = new Intent(); intent.putExtra("note_open_from_scene", 1); intent.putExtra("edit_status", this.qnN); intent.putExtra("note_msgid", this.qov); intent.putExtra("record_show_share", this.bUY); intent.putExtra("fav_note_xml", this.bVJ); intent.putExtra("fav_note_out_of_date", this.qow); intent.putExtra("fav_note_scroll_to_position", this.qnY); intent.putExtra("fav_note_scroll_to_offset", this.qnZ); intent.putExtra("fav_note_scroll_to_offset", this.qnZ); if (!bi.oW(this.qoa)) { intent.putExtra("fav_note_link_source_info", this.qoa); } intent.putExtra("key_detail_fav_scene", this.bOW.scene); intent.putExtra("key_detail_fav_sub_scene", this.bOW.iVT); intent.putExtra("key_detail_fav_index", this.bOW.index); d.b(context, "wenote", ".ui.nativenote.NoteEditorUI", intent); au.Em().H(new 1(this)); } public final String b(vx vxVar) { mw mwVar = new mw(); mwVar.bXL.type = 1; mwVar.bXL.bOz = vxVar; mwVar.bXL.bJC = this.qov.longValue(); a.sFg.m(mwVar); return mwVar.bXM.bXW; } public final String c(vx vxVar) { mw mwVar = new mw(); mwVar.bXL.type = 1; mwVar.bXL.bOz = vxVar; mwVar.bXL.bJC = this.qov.longValue(); a.sFg.m(mwVar); return mwVar.bXM.bOX; } public final void n(vx vxVar) { mw mwVar = new mw(); mwVar.bXL.type = 8; mwVar.bXL.bOz = vxVar; mwVar.bXL.bJC = this.qov.longValue(); mwVar.bXL.bOX = ""; a.sFg.m(mwVar); } public final void a(vx vxVar, String str) { mw mwVar = new mw(); mwVar.bXL.type = 8; mwVar.bXL.bOz = vxVar; mwVar.bXL.bJC = this.qov.longValue(); mwVar.bXL.bOX = str; a.sFg.m(mwVar); } public final void aX(Context context, String str) { Intent intent = new Intent(); intent.putExtra("message_id", this.qov); intent.putExtra("record_xml", this.bVJ); intent.putExtra("record_data_id", ((n) this.qnI.get(str)).jdM); d.b(ad.getContext(), "record", ".ui.RecordMsgFileUI", intent); } public final void aZ(Context context, String str) { Intent intent = new Intent(); intent.putExtra("message_id", this.qov); intent.putExtra("record_data_id", ((n) this.qnI.get(str)).jdM); intent.putExtra("record_xml", this.bVJ); d.b(ad.getContext(), "record", ".ui.RecordMsgImageUI", intent); } public final void aY(Context context, String str) { vz vzVar; String str2 = null; vx vxVar = ((n) this.qnI.get(str)).qpb; if (vxVar.rAi != null) { we weVar = vxVar.rAi.rAL; vzVar = vxVar.rAi.rAJ; } else { vzVar = null; } if (vzVar != null) { if (bi.oW(vzVar.rBh)) { str2 = r.gT(vzVar.bSS); } else { str2 = r.gT(vzVar.rBh); } } com.tencent.mm.plugin.wenote.model.a.r rVar = (com.tencent.mm.plugin.wenote.model.a.r) this.qnI.get(str); if (rVar == null) { h.bA(ad.getContext(), ad.getContext().getString(R.l.favorite_record_loc_error)); return; } Intent intent = new Intent(); intent.putExtra("map_view_type", 2); intent.putExtra("kwebmap_slat", rVar.lat); intent.putExtra("kwebmap_lng", rVar.lng); intent.putExtra("kPoiName", rVar.kFa); intent.putExtra("Kwebmap_locaion", rVar.dRH); if (rVar.qpq >= 0.0d) { intent.putExtra("kwebmap_scale", rVar.qpq); } intent.putExtra("kisUsername", str2); intent.putExtra("kwebmap_from_to", true); intent.putExtra("KFavLocSigleView", true); intent.putExtra("kFavCanDel", false); intent.putExtra("kFavCanRemark", false); d.b(ad.getContext(), "location", ".ui.RedirectUI", intent); } }
package com.rofour.baseball.dao.order.bean; import java.util.ArrayList; import java.util.Date; import java.util.List; public class OrderManagerBeanExample { /** * This field was generated by MyBatis Generator. * This field corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ protected String orderByClause; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ protected boolean distinct; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ protected List<Criteria> oredCriteria; /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public OrderManagerBeanExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andOrderIdIsNull() { addCriterion("order_id is null"); return (Criteria) this; } public Criteria andOrderIdIsNotNull() { addCriterion("order_id is not null"); return (Criteria) this; } public Criteria andOrderIdEqualTo(Long value) { addCriterion("order_id =", value, "orderId"); return (Criteria) this; } public Criteria andOrderIdNotEqualTo(Long value) { addCriterion("order_id <>", value, "orderId"); return (Criteria) this; } public Criteria andOrderIdGreaterThan(Long value) { addCriterion("order_id >", value, "orderId"); return (Criteria) this; } public Criteria andOrderIdGreaterThanOrEqualTo(Long value) { addCriterion("order_id >=", value, "orderId"); return (Criteria) this; } public Criteria andOrderIdLessThan(Long value) { addCriterion("order_id <", value, "orderId"); return (Criteria) this; } public Criteria andOrderIdLessThanOrEqualTo(Long value) { addCriterion("order_id <=", value, "orderId"); return (Criteria) this; } public Criteria andOrderIdIn(List<Long> values) { addCriterion("order_id in", values, "orderId"); return (Criteria) this; } public Criteria andOrderIdNotIn(List<Long> values) { addCriterion("order_id not in", values, "orderId"); return (Criteria) this; } public Criteria andOrderIdBetween(Long value1, Long value2) { addCriterion("order_id between", value1, value2, "orderId"); return (Criteria) this; } public Criteria andOrderIdNotBetween(Long value1, Long value2) { addCriterion("order_id not between", value1, value2, "orderId"); return (Criteria) this; } public Criteria andSourceIsNull() { addCriterion("source is null"); return (Criteria) this; } public Criteria andSourceIsNotNull() { addCriterion("source is not null"); return (Criteria) this; } public Criteria andSourceEqualTo(String value) { addCriterion("source =", value, "source"); return (Criteria) this; } public Criteria andSourceNotEqualTo(String value) { addCriterion("source <>", value, "source"); return (Criteria) this; } public Criteria andSourceGreaterThan(String value) { addCriterion("source >", value, "source"); return (Criteria) this; } public Criteria andSourceGreaterThanOrEqualTo(String value) { addCriterion("source >=", value, "source"); return (Criteria) this; } public Criteria andSourceLessThan(String value) { addCriterion("source <", value, "source"); return (Criteria) this; } public Criteria andSourceLessThanOrEqualTo(String value) { addCriterion("source <=", value, "source"); return (Criteria) this; } public Criteria andSourceLike(String value) { addCriterion("source like", value, "source"); return (Criteria) this; } public Criteria andSourceNotLike(String value) { addCriterion("source not like", value, "source"); return (Criteria) this; } public Criteria andSourceIn(List<String> values) { addCriterion("source in", values, "source"); return (Criteria) this; } public Criteria andSourceNotIn(List<String> values) { addCriterion("source not in", values, "source"); return (Criteria) this; } public Criteria andSourceBetween(String value1, String value2) { addCriterion("source between", value1, value2, "source"); return (Criteria) this; } public Criteria andSourceNotBetween(String value1, String value2) { addCriterion("source not between", value1, value2, "source"); return (Criteria) this; } public Criteria andChannelIsNull() { addCriterion("channel is null"); return (Criteria) this; } public Criteria andChannelIsNotNull() { addCriterion("channel is not null"); return (Criteria) this; } public Criteria andChannelEqualTo(String value) { addCriterion("channel =", value, "channel"); return (Criteria) this; } public Criteria andChannelNotEqualTo(String value) { addCriterion("channel <>", value, "channel"); return (Criteria) this; } public Criteria andChannelGreaterThan(String value) { addCriterion("channel >", value, "channel"); return (Criteria) this; } public Criteria andChannelGreaterThanOrEqualTo(String value) { addCriterion("channel >=", value, "channel"); return (Criteria) this; } public Criteria andChannelLessThan(String value) { addCriterion("channel <", value, "channel"); return (Criteria) this; } public Criteria andChannelLessThanOrEqualTo(String value) { addCriterion("channel <=", value, "channel"); return (Criteria) this; } public Criteria andChannelLike(String value) { addCriterion("channel like", value, "channel"); return (Criteria) this; } public Criteria andChannelNotLike(String value) { addCriterion("channel not like", value, "channel"); return (Criteria) this; } public Criteria andChannelIn(List<String> values) { addCriterion("channel in", values, "channel"); return (Criteria) this; } public Criteria andChannelNotIn(List<String> values) { addCriterion("channel not in", values, "channel"); return (Criteria) this; } public Criteria andChannelBetween(String value1, String value2) { addCriterion("channel between", value1, value2, "channel"); return (Criteria) this; } public Criteria andChannelNotBetween(String value1, String value2) { addCriterion("channel not between", value1, value2, "channel"); return (Criteria) this; } public Criteria andTypeIsNull() { addCriterion("TYPE is null"); return (Criteria) this; } public Criteria andTypeIsNotNull() { addCriterion("TYPE is not null"); return (Criteria) this; } public Criteria andTypeEqualTo(String value) { addCriterion("TYPE =", value, "type"); return (Criteria) this; } public Criteria andTypeNotEqualTo(String value) { addCriterion("TYPE <>", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThan(String value) { addCriterion("TYPE >", value, "type"); return (Criteria) this; } public Criteria andTypeGreaterThanOrEqualTo(String value) { addCriterion("TYPE >=", value, "type"); return (Criteria) this; } public Criteria andTypeLessThan(String value) { addCriterion("TYPE <", value, "type"); return (Criteria) this; } public Criteria andTypeLessThanOrEqualTo(String value) { addCriterion("TYPE <=", value, "type"); return (Criteria) this; } public Criteria andTypeLike(String value) { addCriterion("TYPE like", value, "type"); return (Criteria) this; } public Criteria andTypeNotLike(String value) { addCriterion("TYPE not like", value, "type"); return (Criteria) this; } public Criteria andTypeIn(List<String> values) { addCriterion("TYPE in", values, "type"); return (Criteria) this; } public Criteria andTypeNotIn(List<String> values) { addCriterion("TYPE not in", values, "type"); return (Criteria) this; } public Criteria andTypeBetween(String value1, String value2) { addCriterion("TYPE between", value1, value2, "type"); return (Criteria) this; } public Criteria andTypeNotBetween(String value1, String value2) { addCriterion("TYPE not between", value1, value2, "type"); return (Criteria) this; } public Criteria andTotalMoneyIsNull() { addCriterion("total_money is null"); return (Criteria) this; } public Criteria andTotalMoneyIsNotNull() { addCriterion("total_money is not null"); return (Criteria) this; } public Criteria andTotalMoneyEqualTo(Long value) { addCriterion("total_money =", value, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyNotEqualTo(Long value) { addCriterion("total_money <>", value, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyGreaterThan(Long value) { addCriterion("total_money >", value, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyGreaterThanOrEqualTo(Long value) { addCriterion("total_money >=", value, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyLessThan(Long value) { addCriterion("total_money <", value, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyLessThanOrEqualTo(Long value) { addCriterion("total_money <=", value, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyIn(List<Long> values) { addCriterion("total_money in", values, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyNotIn(List<Long> values) { addCriterion("total_money not in", values, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyBetween(Long value1, Long value2) { addCriterion("total_money between", value1, value2, "totalMoney"); return (Criteria) this; } public Criteria andTotalMoneyNotBetween(Long value1, Long value2) { addCriterion("total_money not between", value1, value2, "totalMoney"); return (Criteria) this; } public Criteria andRebateMoneyIsNull() { addCriterion("rebate_money is null"); return (Criteria) this; } public Criteria andRebateMoneyIsNotNull() { addCriterion("rebate_money is not null"); return (Criteria) this; } public Criteria andRebateMoneyEqualTo(Long value) { addCriterion("rebate_money =", value, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyNotEqualTo(Long value) { addCriterion("rebate_money <>", value, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyGreaterThan(Long value) { addCriterion("rebate_money >", value, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyGreaterThanOrEqualTo(Long value) { addCriterion("rebate_money >=", value, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyLessThan(Long value) { addCriterion("rebate_money <", value, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyLessThanOrEqualTo(Long value) { addCriterion("rebate_money <=", value, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyIn(List<Long> values) { addCriterion("rebate_money in", values, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyNotIn(List<Long> values) { addCriterion("rebate_money not in", values, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyBetween(Long value1, Long value2) { addCriterion("rebate_money between", value1, value2, "rebateMoney"); return (Criteria) this; } public Criteria andRebateMoneyNotBetween(Long value1, Long value2) { addCriterion("rebate_money not between", value1, value2, "rebateMoney"); return (Criteria) this; } public Criteria andFinalMoneyIsNull() { addCriterion("final_money is null"); return (Criteria) this; } public Criteria andFinalMoneyIsNotNull() { addCriterion("final_money is not null"); return (Criteria) this; } public Criteria andFinalMoneyEqualTo(Long value) { addCriterion("final_money =", value, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyNotEqualTo(Long value) { addCriterion("final_money <>", value, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyGreaterThan(Long value) { addCriterion("final_money >", value, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyGreaterThanOrEqualTo(Long value) { addCriterion("final_money >=", value, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyLessThan(Long value) { addCriterion("final_money <", value, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyLessThanOrEqualTo(Long value) { addCriterion("final_money <=", value, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyIn(List<Long> values) { addCriterion("final_money in", values, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyNotIn(List<Long> values) { addCriterion("final_money not in", values, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyBetween(Long value1, Long value2) { addCriterion("final_money between", value1, value2, "finalMoney"); return (Criteria) this; } public Criteria andFinalMoneyNotBetween(Long value1, Long value2) { addCriterion("final_money not between", value1, value2, "finalMoney"); return (Criteria) this; } public Criteria andStateIsNull() { addCriterion("state is null"); return (Criteria) this; } public Criteria andStateIsNotNull() { addCriterion("state is not null"); return (Criteria) this; } public Criteria andStateEqualTo(Integer value) { addCriterion("state =", value, "state"); return (Criteria) this; } public Criteria andStateNotEqualTo(Integer value) { addCriterion("state <>", value, "state"); return (Criteria) this; } public Criteria andStateGreaterThan(Integer value) { addCriterion("state >", value, "state"); return (Criteria) this; } public Criteria andStateGreaterThanOrEqualTo(Integer value) { addCriterion("state >=", value, "state"); return (Criteria) this; } public Criteria andStateLessThan(Integer value) { addCriterion("state <", value, "state"); return (Criteria) this; } public Criteria andStateLessThanOrEqualTo(Integer value) { addCriterion("state <=", value, "state"); return (Criteria) this; } public Criteria andStateIn(List<Integer> values) { addCriterion("state in", values, "state"); return (Criteria) this; } public Criteria andStateNotIn(List<Integer> values) { addCriterion("state not in", values, "state"); return (Criteria) this; } public Criteria andStateBetween(Integer value1, Integer value2) { addCriterion("state between", value1, value2, "state"); return (Criteria) this; } public Criteria andStateNotBetween(Integer value1, Integer value2) { addCriterion("state not between", value1, value2, "state"); return (Criteria) this; } public Criteria andPayMoneyIsNull() { addCriterion("pay_money is null"); return (Criteria) this; } public Criteria andPayMoneyIsNotNull() { addCriterion("pay_money is not null"); return (Criteria) this; } public Criteria andPayMoneyEqualTo(Long value) { addCriterion("pay_money =", value, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyNotEqualTo(Long value) { addCriterion("pay_money <>", value, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyGreaterThan(Long value) { addCriterion("pay_money >", value, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyGreaterThanOrEqualTo(Long value) { addCriterion("pay_money >=", value, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyLessThan(Long value) { addCriterion("pay_money <", value, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyLessThanOrEqualTo(Long value) { addCriterion("pay_money <=", value, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyIn(List<Long> values) { addCriterion("pay_money in", values, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyNotIn(List<Long> values) { addCriterion("pay_money not in", values, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyBetween(Long value1, Long value2) { addCriterion("pay_money between", value1, value2, "payMoney"); return (Criteria) this; } public Criteria andPayMoneyNotBetween(Long value1, Long value2) { addCriterion("pay_money not between", value1, value2, "payMoney"); return (Criteria) this; } public Criteria andPayStateIsNull() { addCriterion("pay_state is null"); return (Criteria) this; } public Criteria andPayStateIsNotNull() { addCriterion("pay_state is not null"); return (Criteria) this; } public Criteria andPayStateEqualTo(Integer value) { addCriterion("pay_state =", value, "payState"); return (Criteria) this; } public Criteria andPayStateNotEqualTo(Integer value) { addCriterion("pay_state <>", value, "payState"); return (Criteria) this; } public Criteria andPayStateGreaterThan(Integer value) { addCriterion("pay_state >", value, "payState"); return (Criteria) this; } public Criteria andPayStateGreaterThanOrEqualTo(Integer value) { addCriterion("pay_state >=", value, "payState"); return (Criteria) this; } public Criteria andPayStateLessThan(Integer value) { addCriterion("pay_state <", value, "payState"); return (Criteria) this; } public Criteria andPayStateLessThanOrEqualTo(Integer value) { addCriterion("pay_state <=", value, "payState"); return (Criteria) this; } public Criteria andPayStateIn(List<Integer> values) { addCriterion("pay_state in", values, "payState"); return (Criteria) this; } public Criteria andPayStateNotIn(List<Integer> values) { addCriterion("pay_state not in", values, "payState"); return (Criteria) this; } public Criteria andPayStateBetween(Integer value1, Integer value2) { addCriterion("pay_state between", value1, value2, "payState"); return (Criteria) this; } public Criteria andPayStateNotBetween(Integer value1, Integer value2) { addCriterion("pay_state not between", value1, value2, "payState"); return (Criteria) this; } public Criteria andPayTypeIsNull() { addCriterion("pay_type is null"); return (Criteria) this; } public Criteria andPayTypeIsNotNull() { addCriterion("pay_type is not null"); return (Criteria) this; } public Criteria andPayTypeEqualTo(Integer value) { addCriterion("pay_type =", value, "payType"); return (Criteria) this; } public Criteria andPayTypeNotEqualTo(Integer value) { addCriterion("pay_type <>", value, "payType"); return (Criteria) this; } public Criteria andPayTypeGreaterThan(Integer value) { addCriterion("pay_type >", value, "payType"); return (Criteria) this; } public Criteria andPayTypeGreaterThanOrEqualTo(Integer value) { addCriterion("pay_type >=", value, "payType"); return (Criteria) this; } public Criteria andPayTypeLessThan(Integer value) { addCriterion("pay_type <", value, "payType"); return (Criteria) this; } public Criteria andPayTypeLessThanOrEqualTo(Integer value) { addCriterion("pay_type <=", value, "payType"); return (Criteria) this; } public Criteria andPayTypeIn(List<Integer> values) { addCriterion("pay_type in", values, "payType"); return (Criteria) this; } public Criteria andPayTypeNotIn(List<Integer> values) { addCriterion("pay_type not in", values, "payType"); return (Criteria) this; } public Criteria andPayTypeBetween(Integer value1, Integer value2) { addCriterion("pay_type between", value1, value2, "payType"); return (Criteria) this; } public Criteria andPayTypeNotBetween(Integer value1, Integer value2) { addCriterion("pay_type not between", value1, value2, "payType"); return (Criteria) this; } public Criteria andPayIdIsNull() { addCriterion("pay_id is null"); return (Criteria) this; } public Criteria andPayIdIsNotNull() { addCriterion("pay_id is not null"); return (Criteria) this; } public Criteria andPayIdEqualTo(Long value) { addCriterion("pay_id =", value, "payId"); return (Criteria) this; } public Criteria andPayIdNotEqualTo(Long value) { addCriterion("pay_id <>", value, "payId"); return (Criteria) this; } public Criteria andPayIdGreaterThan(Long value) { addCriterion("pay_id >", value, "payId"); return (Criteria) this; } public Criteria andPayIdGreaterThanOrEqualTo(Long value) { addCriterion("pay_id >=", value, "payId"); return (Criteria) this; } public Criteria andPayIdLessThan(Long value) { addCriterion("pay_id <", value, "payId"); return (Criteria) this; } public Criteria andPayIdLessThanOrEqualTo(Long value) { addCriterion("pay_id <=", value, "payId"); return (Criteria) this; } public Criteria andPayIdIn(List<Long> values) { addCriterion("pay_id in", values, "payId"); return (Criteria) this; } public Criteria andPayIdNotIn(List<Long> values) { addCriterion("pay_id not in", values, "payId"); return (Criteria) this; } public Criteria andPayIdBetween(Long value1, Long value2) { addCriterion("pay_id between", value1, value2, "payId"); return (Criteria) this; } public Criteria andPayIdNotBetween(Long value1, Long value2) { addCriterion("pay_id not between", value1, value2, "payId"); return (Criteria) this; } public Criteria andCancelTypeIsNull() { addCriterion("cancel_type is null"); return (Criteria) this; } public Criteria andCancelTypeIsNotNull() { addCriterion("cancel_type is not null"); return (Criteria) this; } public Criteria andCancelTypeEqualTo(Integer value) { addCriterion("cancel_type =", value, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeNotEqualTo(Integer value) { addCriterion("cancel_type <>", value, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeGreaterThan(Integer value) { addCriterion("cancel_type >", value, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeGreaterThanOrEqualTo(Integer value) { addCriterion("cancel_type >=", value, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeLessThan(Integer value) { addCriterion("cancel_type <", value, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeLessThanOrEqualTo(Integer value) { addCriterion("cancel_type <=", value, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeIn(List<Integer> values) { addCriterion("cancel_type in", values, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeNotIn(List<Integer> values) { addCriterion("cancel_type not in", values, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeBetween(Integer value1, Integer value2) { addCriterion("cancel_type between", value1, value2, "cancelType"); return (Criteria) this; } public Criteria andCancelTypeNotBetween(Integer value1, Integer value2) { addCriterion("cancel_type not between", value1, value2, "cancelType"); return (Criteria) this; } public Criteria andConsigneeIsNull() { addCriterion("consignee is null"); return (Criteria) this; } public Criteria andConsigneeIsNotNull() { addCriterion("consignee is not null"); return (Criteria) this; } public Criteria andConsigneeEqualTo(String value) { addCriterion("consignee =", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeNotEqualTo(String value) { addCriterion("consignee <>", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeGreaterThan(String value) { addCriterion("consignee >", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeGreaterThanOrEqualTo(String value) { addCriterion("consignee >=", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeLessThan(String value) { addCriterion("consignee <", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeLessThanOrEqualTo(String value) { addCriterion("consignee <=", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeLike(String value) { addCriterion("consignee like", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeNotLike(String value) { addCriterion("consignee not like", value, "consignee"); return (Criteria) this; } public Criteria andConsigneeIn(List<String> values) { addCriterion("consignee in", values, "consignee"); return (Criteria) this; } public Criteria andConsigneeNotIn(List<String> values) { addCriterion("consignee not in", values, "consignee"); return (Criteria) this; } public Criteria andConsigneeBetween(String value1, String value2) { addCriterion("consignee between", value1, value2, "consignee"); return (Criteria) this; } public Criteria andConsigneeNotBetween(String value1, String value2) { addCriterion("consignee not between", value1, value2, "consignee"); return (Criteria) this; } public Criteria andAddressIsNull() { addCriterion("address is null"); return (Criteria) this; } public Criteria andAddressIsNotNull() { addCriterion("address is not null"); return (Criteria) this; } public Criteria andAddressEqualTo(String value) { addCriterion("address =", value, "address"); return (Criteria) this; } public Criteria andAddressNotEqualTo(String value) { addCriterion("address <>", value, "address"); return (Criteria) this; } public Criteria andAddressGreaterThan(String value) { addCriterion("address >", value, "address"); return (Criteria) this; } public Criteria andAddressGreaterThanOrEqualTo(String value) { addCriterion("address >=", value, "address"); return (Criteria) this; } public Criteria andAddressLessThan(String value) { addCriterion("address <", value, "address"); return (Criteria) this; } public Criteria andAddressLessThanOrEqualTo(String value) { addCriterion("address <=", value, "address"); return (Criteria) this; } public Criteria andAddressLike(String value) { addCriterion("address like", value, "address"); return (Criteria) this; } public Criteria andAddressNotLike(String value) { addCriterion("address not like", value, "address"); return (Criteria) this; } public Criteria andAddressIn(List<String> values) { addCriterion("address in", values, "address"); return (Criteria) this; } public Criteria andAddressNotIn(List<String> values) { addCriterion("address not in", values, "address"); return (Criteria) this; } public Criteria andAddressBetween(String value1, String value2) { addCriterion("address between", value1, value2, "address"); return (Criteria) this; } public Criteria andAddressNotBetween(String value1, String value2) { addCriterion("address not between", value1, value2, "address"); return (Criteria) this; } public Criteria andDeliveryStartDateIsNull() { addCriterion("delivery_start_date is null"); return (Criteria) this; } public Criteria andDeliveryStartDateIsNotNull() { addCriterion("delivery_start_date is not null"); return (Criteria) this; } public Criteria andDeliveryStartDateEqualTo(Date value) { addCriterion("delivery_start_date =", value, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateNotEqualTo(Date value) { addCriterion("delivery_start_date <>", value, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateGreaterThan(Date value) { addCriterion("delivery_start_date >", value, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateGreaterThanOrEqualTo(Date value) { addCriterion("delivery_start_date >=", value, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateLessThan(Date value) { addCriterion("delivery_start_date <", value, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateLessThanOrEqualTo(Date value) { addCriterion("delivery_start_date <=", value, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateIn(List<Date> values) { addCriterion("delivery_start_date in", values, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateNotIn(List<Date> values) { addCriterion("delivery_start_date not in", values, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateBetween(Date value1, Date value2) { addCriterion("delivery_start_date between", value1, value2, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryStartDateNotBetween(Date value1, Date value2) { addCriterion("delivery_start_date not between", value1, value2, "deliveryStartDate"); return (Criteria) this; } public Criteria andDeliveryEndDateIsNull() { addCriterion("delivery_end_date is null"); return (Criteria) this; } public Criteria andDeliveryEndDateIsNotNull() { addCriterion("delivery_end_date is not null"); return (Criteria) this; } public Criteria andDeliveryEndDateEqualTo(Date value) { addCriterion("delivery_end_date =", value, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateNotEqualTo(Date value) { addCriterion("delivery_end_date <>", value, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateGreaterThan(Date value) { addCriterion("delivery_end_date >", value, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateGreaterThanOrEqualTo(Date value) { addCriterion("delivery_end_date >=", value, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateLessThan(Date value) { addCriterion("delivery_end_date <", value, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateLessThanOrEqualTo(Date value) { addCriterion("delivery_end_date <=", value, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateIn(List<Date> values) { addCriterion("delivery_end_date in", values, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateNotIn(List<Date> values) { addCriterion("delivery_end_date not in", values, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateBetween(Date value1, Date value2) { addCriterion("delivery_end_date between", value1, value2, "deliveryEndDate"); return (Criteria) this; } public Criteria andDeliveryEndDateNotBetween(Date value1, Date value2) { addCriterion("delivery_end_date not between", value1, value2, "deliveryEndDate"); return (Criteria) this; } public Criteria andCreateUserIsNull() { addCriterion("create_user is null"); return (Criteria) this; } public Criteria andCreateUserIsNotNull() { addCriterion("create_user is not null"); return (Criteria) this; } public Criteria andCreateUserEqualTo(Long value) { addCriterion("create_user =", value, "createUser"); return (Criteria) this; } public Criteria andCreateUserNotEqualTo(Long value) { addCriterion("create_user <>", value, "createUser"); return (Criteria) this; } public Criteria andCreateUserGreaterThan(Long value) { addCriterion("create_user >", value, "createUser"); return (Criteria) this; } public Criteria andCreateUserGreaterThanOrEqualTo(Long value) { addCriterion("create_user >=", value, "createUser"); return (Criteria) this; } public Criteria andCreateUserLessThan(Long value) { addCriterion("create_user <", value, "createUser"); return (Criteria) this; } public Criteria andCreateUserLessThanOrEqualTo(Long value) { addCriterion("create_user <=", value, "createUser"); return (Criteria) this; } public Criteria andCreateUserIn(List<Long> values) { addCriterion("create_user in", values, "createUser"); return (Criteria) this; } public Criteria andCreateUserNotIn(List<Long> values) { addCriterion("create_user not in", values, "createUser"); return (Criteria) this; } public Criteria andCreateUserBetween(Long value1, Long value2) { addCriterion("create_user between", value1, value2, "createUser"); return (Criteria) this; } public Criteria andCreateUserNotBetween(Long value1, Long value2) { addCriterion("create_user not between", value1, value2, "createUser"); return (Criteria) this; } public Criteria andCreateUserMobileIsNull() { addCriterion("create_user_mobile is null"); return (Criteria) this; } public Criteria andCreateUserMobileIsNotNull() { addCriterion("create_user_mobile is not null"); return (Criteria) this; } public Criteria andCreateUserMobileEqualTo(String value) { addCriterion("create_user_mobile =", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileNotEqualTo(String value) { addCriterion("create_user_mobile <>", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileGreaterThan(String value) { addCriterion("create_user_mobile >", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileGreaterThanOrEqualTo(String value) { addCriterion("create_user_mobile >=", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileLessThan(String value) { addCriterion("create_user_mobile <", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileLessThanOrEqualTo(String value) { addCriterion("create_user_mobile <=", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileLike(String value) { addCriterion("create_user_mobile like", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileNotLike(String value) { addCriterion("create_user_mobile not like", value, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileIn(List<String> values) { addCriterion("create_user_mobile in", values, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileNotIn(List<String> values) { addCriterion("create_user_mobile not in", values, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileBetween(String value1, String value2) { addCriterion("create_user_mobile between", value1, value2, "createUserMobile"); return (Criteria) this; } public Criteria andCreateUserMobileNotBetween(String value1, String value2) { addCriterion("create_user_mobile not between", value1, value2, "createUserMobile"); return (Criteria) this; } public Criteria andMobileIsNull() { addCriterion("mobile is null"); return (Criteria) this; } public Criteria andMobileIsNotNull() { addCriterion("mobile is not null"); return (Criteria) this; } public Criteria andMobileEqualTo(String value) { addCriterion("mobile =", value, "mobile"); return (Criteria) this; } public Criteria andMobileNotEqualTo(String value) { addCriterion("mobile <>", value, "mobile"); return (Criteria) this; } public Criteria andMobileGreaterThan(String value) { addCriterion("mobile >", value, "mobile"); return (Criteria) this; } public Criteria andMobileGreaterThanOrEqualTo(String value) { addCriterion("mobile >=", value, "mobile"); return (Criteria) this; } public Criteria andMobileLessThan(String value) { addCriterion("mobile <", value, "mobile"); return (Criteria) this; } public Criteria andMobileLessThanOrEqualTo(String value) { addCriterion("mobile <=", value, "mobile"); return (Criteria) this; } public Criteria andMobileLike(String value) { addCriterion("mobile like", value, "mobile"); return (Criteria) this; } public Criteria andMobileNotLike(String value) { addCriterion("mobile not like", value, "mobile"); return (Criteria) this; } public Criteria andMobileIn(List<String> values) { addCriterion("mobile in", values, "mobile"); return (Criteria) this; } public Criteria andMobileNotIn(List<String> values) { addCriterion("mobile not in", values, "mobile"); return (Criteria) this; } public Criteria andMobileBetween(String value1, String value2) { addCriterion("mobile between", value1, value2, "mobile"); return (Criteria) this; } public Criteria andMobileNotBetween(String value1, String value2) { addCriterion("mobile not between", value1, value2, "mobile"); return (Criteria) this; } public Criteria andRemarkIsNull() { addCriterion("remark is null"); return (Criteria) this; } public Criteria andRemarkIsNotNull() { addCriterion("remark is not null"); return (Criteria) this; } public Criteria andRemarkEqualTo(String value) { addCriterion("remark =", value, "remark"); return (Criteria) this; } public Criteria andRemarkNotEqualTo(String value) { addCriterion("remark <>", value, "remark"); return (Criteria) this; } public Criteria andRemarkGreaterThan(String value) { addCriterion("remark >", value, "remark"); return (Criteria) this; } public Criteria andRemarkGreaterThanOrEqualTo(String value) { addCriterion("remark >=", value, "remark"); return (Criteria) this; } public Criteria andRemarkLessThan(String value) { addCriterion("remark <", value, "remark"); return (Criteria) this; } public Criteria andRemarkLessThanOrEqualTo(String value) { addCriterion("remark <=", value, "remark"); return (Criteria) this; } public Criteria andRemarkLike(String value) { addCriterion("remark like", value, "remark"); return (Criteria) this; } public Criteria andRemarkNotLike(String value) { addCriterion("remark not like", value, "remark"); return (Criteria) this; } public Criteria andRemarkIn(List<String> values) { addCriterion("remark in", values, "remark"); return (Criteria) this; } public Criteria andRemarkNotIn(List<String> values) { addCriterion("remark not in", values, "remark"); return (Criteria) this; } public Criteria andRemarkBetween(String value1, String value2) { addCriterion("remark between", value1, value2, "remark"); return (Criteria) this; } public Criteria andRemarkNotBetween(String value1, String value2) { addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } public Criteria andUnnormalDescIsNull() { addCriterion("unnormal_desc is null"); return (Criteria) this; } public Criteria andUnnormalDescIsNotNull() { addCriterion("unnormal_desc is not null"); return (Criteria) this; } public Criteria andUnnormalDescEqualTo(String value) { addCriterion("unnormal_desc =", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescNotEqualTo(String value) { addCriterion("unnormal_desc <>", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescGreaterThan(String value) { addCriterion("unnormal_desc >", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescGreaterThanOrEqualTo(String value) { addCriterion("unnormal_desc >=", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescLessThan(String value) { addCriterion("unnormal_desc <", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescLessThanOrEqualTo(String value) { addCriterion("unnormal_desc <=", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescLike(String value) { addCriterion("unnormal_desc like", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescNotLike(String value) { addCriterion("unnormal_desc not like", value, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescIn(List<String> values) { addCriterion("unnormal_desc in", values, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescNotIn(List<String> values) { addCriterion("unnormal_desc not in", values, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescBetween(String value1, String value2) { addCriterion("unnormal_desc between", value1, value2, "unnormalDesc"); return (Criteria) this; } public Criteria andUnnormalDescNotBetween(String value1, String value2) { addCriterion("unnormal_desc not between", value1, value2, "unnormalDesc"); return (Criteria) this; } public Criteria andCreateDateIsNull() { addCriterion("create_date is null"); return (Criteria) this; } public Criteria andCreateDateIsNotNull() { addCriterion("create_date is not null"); return (Criteria) this; } public Criteria andCreateDateEqualTo(Date value) { addCriterion("create_date =", value, "createDate"); return (Criteria) this; } public Criteria andCreateDateNotEqualTo(Date value) { addCriterion("create_date <>", value, "createDate"); return (Criteria) this; } public Criteria andCreateDateGreaterThan(Date value) { addCriterion("create_date >", value, "createDate"); return (Criteria) this; } public Criteria andCreateDateGreaterThanOrEqualTo(Date value) { addCriterion("create_date >=", value, "createDate"); return (Criteria) this; } public Criteria andCreateDateLessThan(Date value) { addCriterion("create_date <", value, "createDate"); return (Criteria) this; } public Criteria andCreateDateLessThanOrEqualTo(Date value) { addCriterion("create_date <=", value, "createDate"); return (Criteria) this; } public Criteria andCreateDateIn(List<Date> values) { addCriterion("create_date in", values, "createDate"); return (Criteria) this; } public Criteria andCreateDateNotIn(List<Date> values) { addCriterion("create_date not in", values, "createDate"); return (Criteria) this; } public Criteria andCreateDateBetween(Date value1, Date value2) { addCriterion("create_date between", value1, value2, "createDate"); return (Criteria) this; } public Criteria andCreateDateNotBetween(Date value1, Date value2) { addCriterion("create_date not between", value1, value2, "createDate"); return (Criteria) this; } public Criteria andUpdateUserIsNull() { addCriterion("update_user is null"); return (Criteria) this; } public Criteria andUpdateUserIsNotNull() { addCriterion("update_user is not null"); return (Criteria) this; } public Criteria andUpdateUserEqualTo(Long value) { addCriterion("update_user =", value, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserNotEqualTo(Long value) { addCriterion("update_user <>", value, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserGreaterThan(Long value) { addCriterion("update_user >", value, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserGreaterThanOrEqualTo(Long value) { addCriterion("update_user >=", value, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserLessThan(Long value) { addCriterion("update_user <", value, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserLessThanOrEqualTo(Long value) { addCriterion("update_user <=", value, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserIn(List<Long> values) { addCriterion("update_user in", values, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserNotIn(List<Long> values) { addCriterion("update_user not in", values, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserBetween(Long value1, Long value2) { addCriterion("update_user between", value1, value2, "updateUser"); return (Criteria) this; } public Criteria andUpdateUserNotBetween(Long value1, Long value2) { addCriterion("update_user not between", value1, value2, "updateUser"); return (Criteria) this; } public Criteria andUpdateDateIsNull() { addCriterion("update_date is null"); return (Criteria) this; } public Criteria andUpdateDateIsNotNull() { addCriterion("update_date is not null"); return (Criteria) this; } public Criteria andUpdateDateEqualTo(Date value) { addCriterion("update_date =", value, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateNotEqualTo(Date value) { addCriterion("update_date <>", value, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateGreaterThan(Date value) { addCriterion("update_date >", value, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateGreaterThanOrEqualTo(Date value) { addCriterion("update_date >=", value, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateLessThan(Date value) { addCriterion("update_date <", value, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateLessThanOrEqualTo(Date value) { addCriterion("update_date <=", value, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateIn(List<Date> values) { addCriterion("update_date in", values, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateNotIn(List<Date> values) { addCriterion("update_date not in", values, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateBetween(Date value1, Date value2) { addCriterion("update_date between", value1, value2, "updateDate"); return (Criteria) this; } public Criteria andUpdateDateNotBetween(Date value1, Date value2) { addCriterion("update_date not between", value1, value2, "updateDate"); return (Criteria) this; } public Criteria andSexIsNull() { addCriterion("sex is null"); return (Criteria) this; } public Criteria andSexIsNotNull() { addCriterion("sex is not null"); return (Criteria) this; } public Criteria andSexEqualTo(String value) { addCriterion("sex =", value, "sex"); return (Criteria) this; } public Criteria andSexNotEqualTo(String value) { addCriterion("sex <>", value, "sex"); return (Criteria) this; } public Criteria andSexGreaterThan(String value) { addCriterion("sex >", value, "sex"); return (Criteria) this; } public Criteria andSexGreaterThanOrEqualTo(String value) { addCriterion("sex >=", value, "sex"); return (Criteria) this; } public Criteria andSexLessThan(String value) { addCriterion("sex <", value, "sex"); return (Criteria) this; } public Criteria andSexLessThanOrEqualTo(String value) { addCriterion("sex <=", value, "sex"); return (Criteria) this; } public Criteria andSexLike(String value) { addCriterion("sex like", value, "sex"); return (Criteria) this; } public Criteria andSexNotLike(String value) { addCriterion("sex not like", value, "sex"); return (Criteria) this; } public Criteria andSexIn(List<String> values) { addCriterion("sex in", values, "sex"); return (Criteria) this; } public Criteria andSexNotIn(List<String> values) { addCriterion("sex not in", values, "sex"); return (Criteria) this; } public Criteria andSexBetween(String value1, String value2) { addCriterion("sex between", value1, value2, "sex"); return (Criteria) this; } public Criteria andSexNotBetween(String value1, String value2) { addCriterion("sex not between", value1, value2, "sex"); return (Criteria) this; } public Criteria andPayModeIsNull() { addCriterion("pay_mode is null"); return (Criteria) this; } public Criteria andPayModeIsNotNull() { addCriterion("pay_mode is not null"); return (Criteria) this; } public Criteria andPayModeEqualTo(Integer value) { addCriterion("pay_mode =", value, "payMode"); return (Criteria) this; } public Criteria andPayModeNotEqualTo(Integer value) { addCriterion("pay_mode <>", value, "payMode"); return (Criteria) this; } public Criteria andPayModeGreaterThan(Integer value) { addCriterion("pay_mode >", value, "payMode"); return (Criteria) this; } public Criteria andPayModeGreaterThanOrEqualTo(Integer value) { addCriterion("pay_mode >=", value, "payMode"); return (Criteria) this; } public Criteria andPayModeLessThan(Integer value) { addCriterion("pay_mode <", value, "payMode"); return (Criteria) this; } public Criteria andPayModeLessThanOrEqualTo(Integer value) { addCriterion("pay_mode <=", value, "payMode"); return (Criteria) this; } public Criteria andPayModeIn(List<Integer> values) { addCriterion("pay_mode in", values, "payMode"); return (Criteria) this; } public Criteria andPayModeNotIn(List<Integer> values) { addCriterion("pay_mode not in", values, "payMode"); return (Criteria) this; } public Criteria andPayModeBetween(Integer value1, Integer value2) { addCriterion("pay_mode between", value1, value2, "payMode"); return (Criteria) this; } public Criteria andPayModeNotBetween(Integer value1, Integer value2) { addCriterion("pay_mode not between", value1, value2, "payMode"); return (Criteria) this; } public Criteria andLockStateIsNull() { addCriterion("lock_state is null"); return (Criteria) this; } public Criteria andLockStateIsNotNull() { addCriterion("lock_state is not null"); return (Criteria) this; } public Criteria andLockStateEqualTo(Integer value) { addCriterion("lock_state =", value, "lockState"); return (Criteria) this; } public Criteria andLockStateNotEqualTo(Integer value) { addCriterion("lock_state <>", value, "lockState"); return (Criteria) this; } public Criteria andLockStateGreaterThan(Integer value) { addCriterion("lock_state >", value, "lockState"); return (Criteria) this; } public Criteria andLockStateGreaterThanOrEqualTo(Integer value) { addCriterion("lock_state >=", value, "lockState"); return (Criteria) this; } public Criteria andLockStateLessThan(Integer value) { addCriterion("lock_state <", value, "lockState"); return (Criteria) this; } public Criteria andLockStateLessThanOrEqualTo(Integer value) { addCriterion("lock_state <=", value, "lockState"); return (Criteria) this; } public Criteria andLockStateIn(List<Integer> values) { addCriterion("lock_state in", values, "lockState"); return (Criteria) this; } public Criteria andLockStateNotIn(List<Integer> values) { addCriterion("lock_state not in", values, "lockState"); return (Criteria) this; } public Criteria andLockStateBetween(Integer value1, Integer value2) { addCriterion("lock_state between", value1, value2, "lockState"); return (Criteria) this; } public Criteria andLockStateNotBetween(Integer value1, Integer value2) { addCriterion("lock_state not between", value1, value2, "lockState"); return (Criteria) this; } public Criteria andTraderIsNull() { addCriterion("trader is null"); return (Criteria) this; } public Criteria andTraderIsNotNull() { addCriterion("trader is not null"); return (Criteria) this; } public Criteria andTraderEqualTo(String value) { addCriterion("trader =", value, "trader"); return (Criteria) this; } public Criteria andTraderNotEqualTo(String value) { addCriterion("trader <>", value, "trader"); return (Criteria) this; } public Criteria andTraderGreaterThan(String value) { addCriterion("trader >", value, "trader"); return (Criteria) this; } public Criteria andTraderGreaterThanOrEqualTo(String value) { addCriterion("trader >=", value, "trader"); return (Criteria) this; } public Criteria andTraderLessThan(String value) { addCriterion("trader <", value, "trader"); return (Criteria) this; } public Criteria andTraderLessThanOrEqualTo(String value) { addCriterion("trader <=", value, "trader"); return (Criteria) this; } public Criteria andTraderLike(String value) { addCriterion("trader like", value, "trader"); return (Criteria) this; } public Criteria andTraderNotLike(String value) { addCriterion("trader not like", value, "trader"); return (Criteria) this; } public Criteria andTraderIn(List<String> values) { addCriterion("trader in", values, "trader"); return (Criteria) this; } public Criteria andTraderNotIn(List<String> values) { addCriterion("trader not in", values, "trader"); return (Criteria) this; } public Criteria andTraderBetween(String value1, String value2) { addCriterion("trader between", value1, value2, "trader"); return (Criteria) this; } public Criteria andTraderNotBetween(String value1, String value2) { addCriterion("trader not between", value1, value2, "trader"); return (Criteria) this; } public Criteria andTraderNameIsNull() { addCriterion("trader_name is null"); return (Criteria) this; } public Criteria andTraderNameIsNotNull() { addCriterion("trader_name is not null"); return (Criteria) this; } public Criteria andTraderNameEqualTo(String value) { addCriterion("trader_name =", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameNotEqualTo(String value) { addCriterion("trader_name <>", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameGreaterThan(String value) { addCriterion("trader_name >", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameGreaterThanOrEqualTo(String value) { addCriterion("trader_name >=", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameLessThan(String value) { addCriterion("trader_name <", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameLessThanOrEqualTo(String value) { addCriterion("trader_name <=", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameLike(String value) { addCriterion("trader_name like", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameNotLike(String value) { addCriterion("trader_name not like", value, "traderName"); return (Criteria) this; } public Criteria andTraderNameIn(List<String> values) { addCriterion("trader_name in", values, "traderName"); return (Criteria) this; } public Criteria andTraderNameNotIn(List<String> values) { addCriterion("trader_name not in", values, "traderName"); return (Criteria) this; } public Criteria andTraderNameBetween(String value1, String value2) { addCriterion("trader_name between", value1, value2, "traderName"); return (Criteria) this; } public Criteria andTraderNameNotBetween(String value1, String value2) { addCriterion("trader_name not between", value1, value2, "traderName"); return (Criteria) this; } public Criteria andTraderSexIsNull() { addCriterion("trader_sex is null"); return (Criteria) this; } public Criteria andTraderSexIsNotNull() { addCriterion("trader_sex is not null"); return (Criteria) this; } public Criteria andTraderSexEqualTo(String value) { addCriterion("trader_sex =", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexNotEqualTo(String value) { addCriterion("trader_sex <>", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexGreaterThan(String value) { addCriterion("trader_sex >", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexGreaterThanOrEqualTo(String value) { addCriterion("trader_sex >=", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexLessThan(String value) { addCriterion("trader_sex <", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexLessThanOrEqualTo(String value) { addCriterion("trader_sex <=", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexLike(String value) { addCriterion("trader_sex like", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexNotLike(String value) { addCriterion("trader_sex not like", value, "traderSex"); return (Criteria) this; } public Criteria andTraderSexIn(List<String> values) { addCriterion("trader_sex in", values, "traderSex"); return (Criteria) this; } public Criteria andTraderSexNotIn(List<String> values) { addCriterion("trader_sex not in", values, "traderSex"); return (Criteria) this; } public Criteria andTraderSexBetween(String value1, String value2) { addCriterion("trader_sex between", value1, value2, "traderSex"); return (Criteria) this; } public Criteria andTraderSexNotBetween(String value1, String value2) { addCriterion("trader_sex not between", value1, value2, "traderSex"); return (Criteria) this; } public Criteria andTraderMobileIsNull() { addCriterion("trader_mobile is null"); return (Criteria) this; } public Criteria andTraderMobileIsNotNull() { addCriterion("trader_mobile is not null"); return (Criteria) this; } public Criteria andTraderMobileEqualTo(String value) { addCriterion("trader_mobile =", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileNotEqualTo(String value) { addCriterion("trader_mobile <>", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileGreaterThan(String value) { addCriterion("trader_mobile >", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileGreaterThanOrEqualTo(String value) { addCriterion("trader_mobile >=", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileLessThan(String value) { addCriterion("trader_mobile <", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileLessThanOrEqualTo(String value) { addCriterion("trader_mobile <=", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileLike(String value) { addCriterion("trader_mobile like", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileNotLike(String value) { addCriterion("trader_mobile not like", value, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileIn(List<String> values) { addCriterion("trader_mobile in", values, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileNotIn(List<String> values) { addCriterion("trader_mobile not in", values, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileBetween(String value1, String value2) { addCriterion("trader_mobile between", value1, value2, "traderMobile"); return (Criteria) this; } public Criteria andTraderMobileNotBetween(String value1, String value2) { addCriterion("trader_mobile not between", value1, value2, "traderMobile"); return (Criteria) this; } public Criteria andTraderAddressIsNull() { addCriterion("trader_address is null"); return (Criteria) this; } public Criteria andTraderAddressIsNotNull() { addCriterion("trader_address is not null"); return (Criteria) this; } public Criteria andTraderAddressEqualTo(String value) { addCriterion("trader_address =", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressNotEqualTo(String value) { addCriterion("trader_address <>", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressGreaterThan(String value) { addCriterion("trader_address >", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressGreaterThanOrEqualTo(String value) { addCriterion("trader_address >=", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressLessThan(String value) { addCriterion("trader_address <", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressLessThanOrEqualTo(String value) { addCriterion("trader_address <=", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressLike(String value) { addCriterion("trader_address like", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressNotLike(String value) { addCriterion("trader_address not like", value, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressIn(List<String> values) { addCriterion("trader_address in", values, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressNotIn(List<String> values) { addCriterion("trader_address not in", values, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressBetween(String value1, String value2) { addCriterion("trader_address between", value1, value2, "traderAddress"); return (Criteria) this; } public Criteria andTraderAddressNotBetween(String value1, String value2) { addCriterion("trader_address not between", value1, value2, "traderAddress"); return (Criteria) this; } public Criteria andWinnerIsNull() { addCriterion("winner is null"); return (Criteria) this; } public Criteria andWinnerIsNotNull() { addCriterion("winner is not null"); return (Criteria) this; } public Criteria andWinnerEqualTo(Long value) { addCriterion("winner =", value, "winner"); return (Criteria) this; } public Criteria andWinnerNotEqualTo(Long value) { addCriterion("winner <>", value, "winner"); return (Criteria) this; } public Criteria andWinnerGreaterThan(Long value) { addCriterion("winner >", value, "winner"); return (Criteria) this; } public Criteria andWinnerGreaterThanOrEqualTo(Long value) { addCriterion("winner >=", value, "winner"); return (Criteria) this; } public Criteria andWinnerLessThan(Long value) { addCriterion("winner <", value, "winner"); return (Criteria) this; } public Criteria andWinnerLessThanOrEqualTo(Long value) { addCriterion("winner <=", value, "winner"); return (Criteria) this; } public Criteria andWinnerIn(List<Long> values) { addCriterion("winner in", values, "winner"); return (Criteria) this; } public Criteria andWinnerNotIn(List<Long> values) { addCriterion("winner not in", values, "winner"); return (Criteria) this; } public Criteria andWinnerBetween(Long value1, Long value2) { addCriterion("winner between", value1, value2, "winner"); return (Criteria) this; } public Criteria andWinnerNotBetween(Long value1, Long value2) { addCriterion("winner not between", value1, value2, "winner"); return (Criteria) this; } public Criteria andWinnerRemarkIsNull() { addCriterion("winner_remark is null"); return (Criteria) this; } public Criteria andWinnerRemarkIsNotNull() { addCriterion("winner_remark is not null"); return (Criteria) this; } public Criteria andWinnerRemarkEqualTo(String value) { addCriterion("winner_remark =", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkNotEqualTo(String value) { addCriterion("winner_remark <>", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkGreaterThan(String value) { addCriterion("winner_remark >", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkGreaterThanOrEqualTo(String value) { addCriterion("winner_remark >=", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkLessThan(String value) { addCriterion("winner_remark <", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkLessThanOrEqualTo(String value) { addCriterion("winner_remark <=", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkLike(String value) { addCriterion("winner_remark like", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkNotLike(String value) { addCriterion("winner_remark not like", value, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkIn(List<String> values) { addCriterion("winner_remark in", values, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkNotIn(List<String> values) { addCriterion("winner_remark not in", values, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkBetween(String value1, String value2) { addCriterion("winner_remark between", value1, value2, "winnerRemark"); return (Criteria) this; } public Criteria andWinnerRemarkNotBetween(String value1, String value2) { addCriterion("winner_remark not between", value1, value2, "winnerRemark"); return (Criteria) this; } public Criteria andCollegeIdIsNull() { addCriterion("college_id is null"); return (Criteria) this; } public Criteria andCollegeIdIsNotNull() { addCriterion("college_id is not null"); return (Criteria) this; } public Criteria andCollegeIdEqualTo(Long value) { addCriterion("college_id =", value, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdNotEqualTo(Long value) { addCriterion("college_id <>", value, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdGreaterThan(Long value) { addCriterion("college_id >", value, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdGreaterThanOrEqualTo(Long value) { addCriterion("college_id >=", value, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdLessThan(Long value) { addCriterion("college_id <", value, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdLessThanOrEqualTo(Long value) { addCriterion("college_id <=", value, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdIn(List<Long> values) { addCriterion("college_id in", values, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdNotIn(List<Long> values) { addCriterion("college_id not in", values, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdBetween(Long value1, Long value2) { addCriterion("college_id between", value1, value2, "collegeId"); return (Criteria) this; } public Criteria andCollegeIdNotBetween(Long value1, Long value2) { addCriterion("college_id not between", value1, value2, "collegeId"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table tb_order * * @mbggenerated do_not_delete_during_merge Mon Oct 10 16:41:30 CST 2016 */ public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table tb_order * * @mbggenerated Mon Oct 10 16:41:30 CST 2016 */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
package com.tencent.mm.plugin.wallet.bind.ui; import android.view.View; import android.view.View.OnClickListener; import com.tencent.mm.plugin.report.service.h; import com.tencent.mm.wallet_core.ui.e; class WalletBankcardManageUI$4 implements OnClickListener { final /* synthetic */ WalletBankcardManageUI pdm; WalletBankcardManageUI$4(WalletBankcardManageUI walletBankcardManageUI) { this.pdm = walletBankcardManageUI; } public final void onClick(View view) { this.pdm.bNj(); e.He(19); h.mEJ.h(14422, new Object[]{Integer.valueOf(2)}); } }
package cracking.structure; import java.util.ArrayList; import java.util.List; public class Vertex { private String label; private List<String> neighbors; public List<Integer> getNeighbors(int v){ List<Integer> neighbors = new ArrayList<Integer>(); return neighbors; } /** * @return the label */ public String getLabel() { return label; } /** * @param label the label to set */ public void setLabel(String label) { this.label = label; } /** * @return the neighbors */ public List<String> getNeighbors() { return neighbors; } /** * @param neighbors the neighbors to set */ public void setNeighbors(List<String> neighbors) { this.neighbors = neighbors; } }
package com.rs.game.player.dialogues; import java.text.DecimalFormat; //import com.rs.cache.loaders.NPCDefinitions; import com.rs.game.Animation; import com.rs.game.ForceMovement; import com.rs.game.ForceTalk; import com.rs.game.Graphics; //import com.rs.game.World; import com.rs.game.WorldTile; //import com.rs.game.npc.NPC; import com.rs.game.player.QuestManager.Quests; import com.rs.game.player.Skills; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.utils.Utils; public class MuseumGuard extends Dialogue { public static final int[] randomAnimal = { 6935, 3283, 4344, 6966 }; /** * This dialogue is sent upon the player clicking on object id: 2562. */ @Override public void start() { sendNPCDialogue(4405, 9827, "Hey! Get your hands off that! Don't you know not to touch items in the a museum."); } @Override public void run(int interfaceId, int componentId) { switch (stage) { case -1: sendPlayerDialogue(9827, "Sorry, I just wondered what it was."); stage = 1; break; case 1: sendNPCDialogue(4405, 9827, "A good question. It's perhaps one of more mysterious exibits in this museum."); stage = 2; break; case 2: sendNPCDialogue( 4405, 9827, "It was only discovered recently, but our curators have" + " dated it back almost as far as we can track. It turns out" + " this cape might be the product, or at least involved with a" + " Second Age mage by the name of Dahmaroc."); stage = 3; break; case 3: sendPlayerDialogue(9827, "Dahmaroc?"); stage = 4; break; case 4: sendNPCDialogue( 4405, 9827, "Indeed, you might have learned about him downstairs. He" + " was a powerful mage back in the Second Age. Very skill-" + " focused too, so this cape was a particular find."); stage = 5; break; case 5: sendPlayerDialogue(9827, "What do you mean by that?"); stage = 6; break; case 6: sendNPCDialogue( 4405, 9827, "Well, generally, his magical abilities were focused away" + " from combat - it seems this cape is under the mose" + " powerful enchantment we've ever seen."); stage = 7; break; case 7: sendPlayerDialogue(9827, "This cape is enchanted?"); stage = 8; break; case 8: sendNPCDialogue( 4405, 9827, "Yes, and more than we can grasp. It physiclly repels anyone who tries to touch" + " it. We had quite a hassle getting it up here."); stage = 9; break; case 9: sendPlayerDialogue(9827, "So no one has worn this cape?"); stage = 10; break; case 10: sendNPCDialogue( 4405, 9827, "No one can! It's like it has a mind of it's own juding those who try as unworthy."); stage = 11; break; case 11: sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "Can I try?", "How interesting."); stage = 12; break; case 12: switch (componentId) { case OPTION_1: stage = 13; sendPlayerDialogue(9827, "Can I try?"); if (!isWorthy()) sendRequirementMessages(); break; case OPTION_2: default: stage = 30; sendPlayerDialogue(9827, "How interesting."); break; } break; case 13: sendNPCDialogue( 4405, 9827, "I said no touching... but, if you get close enough, I'm sure you'll the enchantment affects" + " ... Good luck!"); stage = 14; break; case 14: if (!isWorthy()) { player.getInterfaceManager().closeChatBoxInterface(); player.lock(); //final int[] randomAnimal = { 6935, 3283, 4344, 6966 }; //final NPC guard = 4405; WorldTasksManager.schedule(new WorldTask() { int phase = 0; @Override public void run() { switch (phase) { case 0: player.setNextAnimation(new Animation(857)); break; case 1: player.setNextAnimation(new Animation(915)); break; case 2: player.setNextAnimation(new Animation(857)); break; case 3: player.setNextGraphics(new Graphics(86)); player.getAppearence().transformIntoNPC(randomAnimal[Utils.random(getLength() - 1)]); break; case 4: player.setNextForceTalk(new ForceTalk("..What.")); break; case 5: player.setNextGraphics(new Graphics(86)); player.getAppearence().transformIntoNPC(-1); player.setNextAnimation(new Animation(10070)); player.setNextForceMovement(new ForceMovement( new WorldTile(player.getX() + 3, player.getY(), player.getPlane()), 1, 0)); //player.setNextFaceEntity(4405); break; case 6: player.setNextWorldTile(new WorldTile( player.getX() + 3, player.getY(), player.getPlane())); sendNPCDialogue(4405, 9827, "Looks like Dahmaroc had a sense of humour!"); player.unlock(); break; } phase++; } }, 2, 2); stage = 15; } else { // TODO: Animation & graphics sendNPCDialogue(4405, 9827, "Wait, i know you... Thats itMy sincerely apologies" + Utils.formatPlayerNameForDisplay(player.getUsername()) + ", you are talked about all over. There is no doubt you are worthy to wear the Completionist Cape."); stage = 16; } break; case 15: player.setNextFaceEntity(null); player.unlock(); sendNPCDialogue(4405, 9827, "Sorry, it doesn't look like you are worthy of this cape. At" + " least not yet..."); stage = -2; break; case 16: sendPlayerDialogue(9827, "You mean I can have it?"); stage = 17; break; case 17: sendNPCDialogue( 4405, 9827, "Well, yes, but... I can't just let you take the exhibit. You" + " may be the true owner, but it is one of the most" + " treasured items we have here."); stage = 18; break; case 18: sendNPCDialogue( 4405, 9827, "I suppose if the museum were compensated, perhaps I" + " could let you take it... How does 5,000,000 coins" + " sound?"); stage = 19; break; case 19: sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "That sounds fair.", "That sounds like a joke!"); stage = 20; break; case 20: switch (componentId) { case OPTION_1: sendPlayerDialogue(9827, "That sounds fair."); stage = 21; break; case OPTION_2: sendPlayerDialogue(9827, "That sounds like a joke!"); stage = -2; break; } break; case 21: if (player.money < 5000000) { sendNPCDialogue(4405, 9827, "Please come back when you actually have enough gold."); // TODO // not // real // message, // couldn't // find // in // video. stage = -2; } else { if (player.getInventory().getFreeSlots() < 2) { sendNPCDialogue(4405, 9827, "Sorry, but your inventory seems to be full, please come back " + "with more space."); stage = -2; } else { int value = 5000000; player.getPackets().sendRunScript(5561, 0, value); player.money -= value; player.getPackets().sendRunScript(5560, player.money); player.getPackets().sendGameMessage(getFormattedNumber(value) + " coins have been removed from your money-pouch."); sendNPCDialogue(4405, 9827, "Thanks, enjoy!"); player.getInventory().addItem(20769, 1); player.getInventory().addItem(20770, 1); stage = -2; } } break; case 30: sendNPCDialogue(4405, 9827, "Thanks for wasting my time."); stage = -2; break; case -2: end(); break; } } public String getFormattedNumber(int amount) { return new DecimalFormat("#,###,##0").format(amount).toString(); } public boolean isWorthy() { boolean worthy; if (player.isCompletedFightKiln() && player.getSkills().getTotalLevel(player) == 2496 && player.getQuestManager().completedQuest( Quests.NOMADS_REQUIEM) && player.isKilledQueenBlackDragon() || player.getUsername().equalsIgnoreCase("Username Here")) worthy = true; else worthy = false; return worthy; } public static int getLength() { return randomAnimal.length; } public void sendRequirementMessages() { if (player.getSkills().getTotalLevel(player) != 2496) { player.getPackets().sendGameMessage("To wear this cape you need level 99 in the following: "); for (int skill = 0; skill < 24; skill++) { if (player.getSkills().getLevelForXp(skill) == 120) continue; player.getPackets().sendGameMessage("You are not experienced enough."); } if (player.getSkills().getLevelForXp(Skills.DUNGEONEERING) != 120) { player.getPackets().sendGameMessage("To wear this cape you need level 120 in the following: "); player.getPackets().sendGameMessage("Dungeoneering "); } } if (!player.getQuestManager().completedQuest(Quests.NOMADS_REQUIEM)) player.getPackets().sendGameMessage("You need to have completed all quests to wear this cape."); if (!player.isCompletedFightKiln()) player.getPackets().sendGameMessage("You must have completed the fight kiln to wear this cape."); if (!player.isKilledQueenBlackDragon()) player.getPackets().sendGameMessage("You must have defeated the Queen Black Dragon and obtained the first dragonkin journal to wear this cape."); } /*public void sendRequirementInterface() { player.getInterfaceManager().sendInterface(275); for (int i = 0; i < 250; i++) player.getPackets().sendIComponentText(275, i, ""); player.getPackets().sendIComponentText(275, 1, "Completionist Requirements"); for (int skill = 0; skill < 24; skill++) player.getPackets() .sendIComponentText( 275, 10, ((player.getSkills().getLevelForXp(skill) == 99 ? "<str>" : " ")) + " Have level 99 in every skill besides Dungeoneering."); player.getPackets().sendIComponentText( 275, 11, ((player.getSkills().getLevelForXp(24) == 120 ? "<str>" : " ")) + " Have level 120 in Dungeoneering."); player.getPackets() .sendIComponentText( 275, 12, ((player.getQuestManager().completedQuest( Quests.NOMADS_REQUIEM) ? "<str>" : " ")) + " Complete Nomad's Requiem miniquest."); player.getPackets().sendIComponentText( 275, 13, ((player.isCompletedFightKiln() ? "<str>" : " ")) + " Complete the Fight kiln minigame."); player.getPackets().sendIComponentText( 275, 14, ((player.isKilledQueenBlackDragon() ? "<str>" : " ")) + " Kill the Queen Black Dragon."); } */ @Override public void finish() { } }
import com.sun.javafx.text.TextLine; import javafx.beans.Observable; import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import javafx.scene.text.Text; import javafx.stage.Stage; import java.util.ArrayList; /** * A kérdéseket és válaszokat tároló osztály * */ public class Question { String question; int ID; static int counter=0; Answer answers; public Question(){ answers=new Answer(); this.ID=counter; counter++; } public Question(String q,String T,String F1, String F2,String F3) { question=q; answers= new Answer(T, F1, F2,F3); ID = counter; counter++; } public Integer GetID() { return this.ID; } public void SetID(int v) {this.ID=v;} public String GetQuestion() { return question; } public void SetQuestion (String v) {this.question=v;} public Answer Getanswer(){return this.answers;} /** * Az Appban lévő questons listához hozzá ad egy kérdést és megalkotja egy kérdés hozzáadásához szükséges formot is * a létrehozás során ki kell tölteni minden mezőt és, csak a TruaAnswer mezőbe írt kérédés tekinit a rendszer helyesnek */ static public void AddNewQuestion() { Stage newQ= new Stage(); newQ.setTitle("New Question"); Scene scene; GridPane grid =new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(40); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); TextField quest=new TextField(); Label questlabel =new Label("Question"); TextField TrueAnswer=new TextField(); Label Truelab =new Label("True answer"); TextField false1=new TextField(); Label flab1 =new Label("False answer"); TextField false2=new TextField(); Label flab2 =new Label("False answer"); TextField false3=new TextField(); Label flab3 =new Label("False answer"); Button add=new Button("Add"); add.setOnAction(e->{ Question q=new Question(); int ok=0; try{ q.question=quest.getText(); q.answers.TrueAnswer=TrueAnswer.getText(); q.answers.False1=false1.getText(); q.answers.False2=false2.getText(); q.answers.False3=false3.getText(); if(q.question.equals("") || q.answers.TrueAnswer.equals("") || q.answers.False1.equals("") || q.answers.False2.equals("") || q.answers.False3.equals("")) {throw new NullPointerException();} } catch(NullPointerException ex){ ok=1; Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("Empty Fields"); alert.setHeaderText("Warning!"); alert.setContentText("Fill all fields!"); alert.showAndWait(); } if (ok==0) { App.questions.add(q); App.UpdateXML(App.xml); newQ.close(); } }); grid.add(questlabel,1,1); grid.add(Truelab,2,1); grid.add(flab1,2,3); grid.add(flab2,2,5); grid.add(flab3,2,7); grid.add(quest,1,2); grid.add(TrueAnswer,2,2); grid.add(false1,2,4); grid.add(false2,2,6); grid.add(false3,2,8); grid.add(add,2,10); scene=new Scene(grid, 600,500); newQ.setScene(scene); newQ.show(); } }
package com.mes.old.meta; // Generated 2017-5-22 1:25:24 by Hibernate Tools 5.2.1.Final import java.math.BigDecimal; import java.util.Date; /** * TTaskPart generated by hbm2java */ public class TTaskPart implements java.io.Serializable { private TTaskPartId id; private TTasks TTasks; private BigDecimal qtyreq; private Long reqtype; private BigDecimal allocatedqty; private Byte isineffect; private Date createtime; private String creator; private BigDecimal singlein; private BigDecimal singleout; private String uniqueId; private Date satisfydate; private String notes; private BigDecimal preassQty; private String preassEmp; private Date preassDate; private String warehouseid; private BigDecimal applyQty; private String prepareEmployeeid; private String prepareWarehouseid; private Byte prepareState; private long preassLevel; public TTaskPart() { } public TTaskPart(TTaskPartId id, TTasks TTasks, String uniqueId, long preassLevel) { this.id = id; this.TTasks = TTasks; this.uniqueId = uniqueId; this.preassLevel = preassLevel; } public TTaskPart(TTaskPartId id, TTasks TTasks, BigDecimal qtyreq, Long reqtype, BigDecimal allocatedqty, Byte isineffect, Date createtime, String creator, BigDecimal singlein, BigDecimal singleout, String uniqueId, Date satisfydate, String notes, BigDecimal preassQty, String preassEmp, Date preassDate, String warehouseid, BigDecimal applyQty, String prepareEmployeeid, String prepareWarehouseid, Byte prepareState, long preassLevel) { this.id = id; this.TTasks = TTasks; this.qtyreq = qtyreq; this.reqtype = reqtype; this.allocatedqty = allocatedqty; this.isineffect = isineffect; this.createtime = createtime; this.creator = creator; this.singlein = singlein; this.singleout = singleout; this.uniqueId = uniqueId; this.satisfydate = satisfydate; this.notes = notes; this.preassQty = preassQty; this.preassEmp = preassEmp; this.preassDate = preassDate; this.warehouseid = warehouseid; this.applyQty = applyQty; this.prepareEmployeeid = prepareEmployeeid; this.prepareWarehouseid = prepareWarehouseid; this.prepareState = prepareState; this.preassLevel = preassLevel; } public TTaskPartId getId() { return this.id; } public void setId(TTaskPartId id) { this.id = id; } public TTasks getTTasks() { return this.TTasks; } public void setTTasks(TTasks TTasks) { this.TTasks = TTasks; } public BigDecimal getQtyreq() { return this.qtyreq; } public void setQtyreq(BigDecimal qtyreq) { this.qtyreq = qtyreq; } public Long getReqtype() { return this.reqtype; } public void setReqtype(Long reqtype) { this.reqtype = reqtype; } public BigDecimal getAllocatedqty() { return this.allocatedqty; } public void setAllocatedqty(BigDecimal allocatedqty) { this.allocatedqty = allocatedqty; } public Byte getIsineffect() { return this.isineffect; } public void setIsineffect(Byte isineffect) { this.isineffect = isineffect; } public Date getCreatetime() { return this.createtime; } public void setCreatetime(Date createtime) { this.createtime = createtime; } public String getCreator() { return this.creator; } public void setCreator(String creator) { this.creator = creator; } public BigDecimal getSinglein() { return this.singlein; } public void setSinglein(BigDecimal singlein) { this.singlein = singlein; } public BigDecimal getSingleout() { return this.singleout; } public void setSingleout(BigDecimal singleout) { this.singleout = singleout; } public String getUniqueId() { return this.uniqueId; } public void setUniqueId(String uniqueId) { this.uniqueId = uniqueId; } public Date getSatisfydate() { return this.satisfydate; } public void setSatisfydate(Date satisfydate) { this.satisfydate = satisfydate; } public String getNotes() { return this.notes; } public void setNotes(String notes) { this.notes = notes; } public BigDecimal getPreassQty() { return this.preassQty; } public void setPreassQty(BigDecimal preassQty) { this.preassQty = preassQty; } public String getPreassEmp() { return this.preassEmp; } public void setPreassEmp(String preassEmp) { this.preassEmp = preassEmp; } public Date getPreassDate() { return this.preassDate; } public void setPreassDate(Date preassDate) { this.preassDate = preassDate; } public String getWarehouseid() { return this.warehouseid; } public void setWarehouseid(String warehouseid) { this.warehouseid = warehouseid; } public BigDecimal getApplyQty() { return this.applyQty; } public void setApplyQty(BigDecimal applyQty) { this.applyQty = applyQty; } public String getPrepareEmployeeid() { return this.prepareEmployeeid; } public void setPrepareEmployeeid(String prepareEmployeeid) { this.prepareEmployeeid = prepareEmployeeid; } public String getPrepareWarehouseid() { return this.prepareWarehouseid; } public void setPrepareWarehouseid(String prepareWarehouseid) { this.prepareWarehouseid = prepareWarehouseid; } public Byte getPrepareState() { return this.prepareState; } public void setPrepareState(Byte prepareState) { this.prepareState = prepareState; } public long getPreassLevel() { return this.preassLevel; } public void setPreassLevel(long preassLevel) { this.preassLevel = preassLevel; } }
package MasterClass.Models; public abstract class Character implements ICharacter { int pv = 0; int attack = 0; int attackBonus = 0; int vel = 0; int defense = 0; float dash = 0; int level = 0; int exp = 0; String name = ""; public Character(int pv, int attack, int attackBonus, int vel, int defense, float dash, int exp, String name) { this.pv = pv; this.attack = attack; this.attackBonus = attackBonus; this.vel = vel; this.defense = defense; this.dash = dash; this.exp = exp; this.name = name; } public abstract String getStats(); public int getPv() { return pv; } public void setPv(int pv) { this.pv = pv; } public int getAttack() { return attack; } public void setAttack(int attack) { this.attack = attack; } public int getAttackBonus() { return attackBonus; } public void setAttackBonus(int attackBonus) { this.attackBonus = attackBonus; } public int getDefense() { return defense; } public void setDefense(int defense) { this.defense = defense; } public float getDash() { return dash; } public void setDash(float dash) { this.dash = dash; } public int getExp() { return exp; } public void setExp(int exp) { this.exp = exp; } public int getLevel() { return level; } public void setLevel(int level) { this.exp = level; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getVel() { return vel; } public void setVel(int vel) { this.vel = vel; } }
package com.example.behavioral.iterator; /** * Copyright (C), 2020 * FileName: Iterator * * @author: xieyufeng * @date: 2020/11/23 17:06 * @description: */ public interface Iterator { boolean hasNext(); Object next(); }
package com.tencent.mm.plugin.game.gamewebview.jsapi.biz; import android.content.Intent; import com.samsung.android.sdk.look.smartclip.SlookSmartClipMetaTag; import com.tencent.mm.plugin.game.gamewebview.jsapi.a; import com.tencent.mm.plugin.game.gamewebview.ui.GameWebViewUI; import com.tencent.mm.plugin.game.gamewebview.ui.d; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import org.json.JSONObject; public final class ab extends a { public static final int CTRL_BYTE = 256; public static final String NAME = "openCustomWebview"; public final void a(d dVar, JSONObject jSONObject, int i) { GameWebViewUI pageActivity = dVar.getPageActivity(); if (pageActivity == null) { x.i("MicroMsg.GameJsApiOpenCustomWebView", "activity is null"); return; } String optString = jSONObject.optString(SlookSmartClipMetaTag.TAG_TYPE_URL); if (bi.oW(optString)) { dVar.E(i, a.f("openCunstonWebview:fail_invalid_url", null)); return; } dVar.getRawUrl().startsWith("http://game.weixin.qq.com/cgi-bin/h5/static/gameloading/index.html?appid="); String optString2 = jSONObject.optString("orientation"); int i2 = -1; if (!bi.oW(optString2)) { if (optString2.equals("horizontal")) { i2 = 0; } else if (optString2.equals("vertical")) { i2 = 1; } } boolean optBoolean = jSONObject.optBoolean("fullscreen"); String optString3 = jSONObject.optString("top_title"); String optString4 = jSONObject.optString("top_url"); boolean equals = jSONObject.optString("finish_recent_webview").equals("1"); boolean equals2 = jSONObject.optString("disable_swipe_back").equals("1"); String optString5 = jSONObject.optString("username"); Intent intent = new Intent(); intent.putExtra("rawUrl", optString); intent.putExtra("screen_orientation", i2); intent.putExtra("show_full_screen", optBoolean); intent.putExtra("disable_swipe_back", equals2); intent.putExtra("shortcut_user_name", optString5); intent.putExtra("finish_recent_page", equals); if (!(bi.oW(optString4) || bi.oW(optString3))) { intent.putExtra("custom_keep_top_url", optString4); intent.putExtra("custom_keep_top_title", optString3); } if (equals && dVar.jIT.aSG()) { intent.putExtra("is_from_keep_top", true); } intent.putExtra("game_hv_menu_appid", bi.oV(jSONObject.optString("gameAppid"))); pageActivity.L(intent); dVar.E(i, a.f("openCunstonWebview:ok", null)); } }
package com.template.di.module; import android.app.Application; import android.support.annotation.NonNull; import android.util.Log; import com.template.BuildConfig; import com.template.data.remote.ApiService; import com.template.data.remote.BaseIntercepter; import com.template.data.remote.DataSourceInterface; import com.template.data.remote.PersistentCookieStore; import com.template.data.remote.RemoteDataSource; import com.template.di.Remote; import java.util.List; import java.util.concurrent.TimeUnit; import javax.inject.Singleton; import dagger.Binds; import dagger.Module; import dagger.Provides; import okhttp3.Cookie; import okhttp3.CookieJar; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; @Module public abstract class HttpModule { @Provides @Singleton static OkHttpClient.Builder provideOkHttpClickBuilder(Application application) { OkHttpClient.Builder builder = new OkHttpClient.Builder(); builder.writeTimeout(30, TimeUnit.SECONDS); builder.readTimeout(30, TimeUnit.SECONDS); builder.connectTimeout(30, TimeUnit.SECONDS); builder.cookieJar(new CookieJar() { private final PersistentCookieStore cookieStore = new PersistentCookieStore(application); @Override public void saveFromResponse(@NonNull HttpUrl url, @NonNull List<Cookie> cookies) { if (cookies.size() > 0) { Log.d("HttpModule", "saveCookie:"); for (Cookie item : cookies) { cookieStore.add(url, item); if (item != null) { Log.d("HttpModule", "cookie:" + item.toString()); } } } } @Override public List<Cookie> loadForRequest(@NonNull HttpUrl url) { Log.d("HttpModule", "loadCookie:"); List<Cookie> cookies = cookieStore.get(url); for (Cookie item : cookies) { if (item != null) { Log.d("HttpModule", "cookie:" + item.toString()); } } return cookies; } }); if (BuildConfig.DEBUG) { HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); builder.addInterceptor(interceptor); } return builder; } @Provides @Singleton static Retrofit.Builder provideRetrofitBuilder() { return new Retrofit.Builder(); } @Provides @Singleton static Retrofit provideRetrofit(@NonNull Retrofit.Builder builder, @NonNull OkHttpClient.Builder client) { client.addInterceptor(new BaseIntercepter()); OkHttpClient httpClient = client.build(); builder.client(httpClient); builder.baseUrl(BuildConfig.BASE_URL); builder.addConverterFactory(GsonConverterFactory.create()); return builder.build(); } @Provides @Singleton static ApiService provideTraderService(Retrofit retrofit) { return retrofit.create(ApiService.class); } @Singleton @Binds @Remote abstract DataSourceInterface provideTraderRemoteDataSource(RemoteDataSource dataSource); }
package com.zznode.opentnms.isearch.otnRouteService.api; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import javax.xml.ws.ResponseWrapper; import org.springframework.stereotype.Component; import com.zznode.opentnms.isearch.otnRouteService.api.model.RouteCalculationInput; import com.zznode.opentnms.isearch.otnRouteService.api.model.RouteCalculationOutput; @WebService @SOAPBinding(style=Style.RPC) @Component public interface RouteCalculation { @WebMethod(operationName="calculate") @ResponseWrapper() public @WebResult(name="calculateResponse",partName="outputs") RouteCalculationOutput calculate( @WebParam(name="calculateRequest",partName="inputs") RouteCalculationInput input) throws RouteCalculationException; }
package br.com.globallabs.java.bootcamp.desenvolvimento.avancado.interfaces.funcionais; import java.util.function.Predicate; //recebe um parametro e retorna um boolean public class Predicado { public static void main(String[] args) { Predicate<String> igualAKarine = valor -> valor.equals("Karine"); System.out.println(igualAKarine.test("")); System.out.println(igualAKarine.test("Karine")); Predicate<String> estaVazio = String::isEmpty; System.out.println(estaVazio.test("")); System.out.println(estaVazio.test("Karine")); } }
package com.example.natgarse_upv.androidmysql; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import static com.example.natgarse_upv.androidmysql.R.id.txtMediciones; public class MainActivity extends AppCompatActivity { EditText txtMediciones; Button btnInsertar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); txtMediciones = findViewById(R.id.txtMediciones); } /* public void cliclkBtnInsertar(View view){ String url="https://192.168.0.129/ProyecteMediambientS0/insertar.php"; var queue:Volley.newRequestQueue(this); var resultadoPost=object:StringRequest(Request.Method.POST,url, Response.Listener<String>{response-> Toast.makeText(this,"Datos insertados correctamente",Toast.LENGTH_LONG).show() },Response.ErrorListener{error-> Toast.makeText(this,"Error $error",Toast.LENGTH_LONG).show() }){ } }*/ /* public void boton_enviar_pulsado(View quien) { Log.d("clienterestandroid", "boton_enviar_pulsado"); this.txtMediciones.setText("pulsado"); // ojo: creo que hay que crear uno nuevo cada vez PeticionarioREST elPeticionario = new PeticionarioREST(); elPeticionario.hacerPeticionREST("POST", "https://10.236.35.194/ProyecteMediambientS0/insertar.php", null, new PeticionarioREST.RespuestaREST() { @Override public void callback(int codigo, String cuerpo) { txtMediciones.setText("codigo respuesta= " + codigo + " <-> \n" + cuerpo); } } ); // (int codigo, String cuerpo) -> { elTexto.setText ("lo que sea"=; } String textoJSON = "{ 'Mediciones': '" + txtMediciones.toString() + "' }"; }*/ /// public void boto(View quien) { Log.d("clienterestandroid", "boton_enviar_pulsado"); // ojo: creo que hay que crear uno nuevo cada vez PeticionarioREST elPeticionario = new PeticionarioREST(); /* enviarPeticion( "hola", function (res) { res }) elPeticionario.hacerPeticionREST("GET", "http://158.42.144.126:8080/prueba", null, (int codigo, String cuerpo) => { } ); */ //la contrabarra es pa clavar la cometa dins del string sense tancar el stringç //http://localhost/phpmyadmin/sql.php?db=android_mysql&table=datosmedidos&pos=0 String textoJSON = "{\"Medicion\":\"" + txtMediciones.getText() + "\"}"; elPeticionario.hacerPeticionREST("POST", "http://10.236.35.194/ProyecteMediambientS0/insertar.php", textoJSON, new PeticionarioREST.RespuestaREST() { @Override public void callback(int codigo, String cuerpo) { txtMediciones.setText("codigo respuesta= " + codigo + " <-> \n" + cuerpo); } } ); } }
package com.wanglu.movcat.model; //计数 public class Count { private Integer commentCount; private Integer praiseCount; private Integer shareCount; private Integer totalBrowsingCount; private Integer todayBrowsingCount; public Count() { } public Count(Integer commentCount, Integer praiseCount, Integer shareCount, Integer totalBrowsingCount, Integer todayBrowsingCount) { this.commentCount = commentCount; this.praiseCount = praiseCount; this.shareCount = shareCount; this.totalBrowsingCount = totalBrowsingCount; this.todayBrowsingCount = todayBrowsingCount; } public Integer getCommentCount() { return commentCount; } public void setCommentCount(Integer commentCount) { this.commentCount = commentCount; } public Integer getPraiseCount() { return praiseCount; } public void setPraiseCount(Integer praiseCount) { this.praiseCount = praiseCount; } public Integer getShareCount() { return shareCount; } public void setShareCount(Integer shareCount) { this.shareCount = shareCount; } public Integer getTotalBrowsingCount() { return totalBrowsingCount; } public void setTotalBrowsingCount(Integer totalBrowsingCount) { this.totalBrowsingCount = totalBrowsingCount; } public Integer getTodayBrowsingCount() { return todayBrowsingCount; } public void setTodayBrowsingCount(Integer todayBrowsingCount) { this.todayBrowsingCount = todayBrowsingCount; } @Override public String toString() { return "Count{" + "commentCount=" + commentCount + ", praiseCount=" + praiseCount + ", shareCount=" + shareCount + ", totalBrowsingCount=" + totalBrowsingCount + ", todayBrowsingCount=" + todayBrowsingCount + '}'; } }
package 반복문; import javax.swing.JOptionPane; public class 반복문1 { public static void main(String[] args) { while (true) { // 무한루프 System.out.println("계속돈다"); String q = JOptionPane.showInputDialog("중단하십니까? x"); if (q.equals("x")) { //break; System.exit(0); //뭐가됬든 그만 } } } }
package com.tencent.mm.plugin.fav.ui.d; import com.tencent.mm.plugin.fav.a.b; import com.tencent.mm.plugin.fav.a.g; class k$1 implements Runnable { final /* synthetic */ g iVs; final /* synthetic */ k jeX; k$1(k kVar, g gVar) { this.jeX = kVar; this.iVs = gVar; } public final void run() { b.o(this.iVs); } }
package br.com.nozinho.dao.impl; import java.util.List; import javax.ejb.Stateless; import javax.persistence.TypedQuery; import br.com.nozinho.dao.PermissaoDAO; import br.com.nozinho.ejb.dao.impl.GenericDAOImpl; import br.com.nozinho.model.Permissao; @Stateless public class PermissaoDAOImpl extends GenericDAOImpl<Permissao, Long> implements PermissaoDAO{ @Override public List<Permissao> findPermissoes() { TypedQuery<Permissao> query = getEntityManager().createNamedQuery("Permissao.findPermissaoExceptAdm", Permissao.class); return query.getResultList(); } }
package moe.vergo.seasonalseiyuuapi.adapter.in.web.cache; public interface CacheManager<T> { public CacheService<T> initialiseCache(String cacheName); }
package ex3; import java.util.Calendar; public class Persoana { private String nume; private String CNP; public Persoana(String nume, String CNP) throws CNPEronat { if (CNP.length() != 13) { throw new CNPEronat("\n\nEroare! => CNP -ul trebuie sa aiba strict 13 caractere!", CNP); } else if(isCifra(CNP) == false) { throw new CNPEronat("\nEroare! => CNP-ul trebuie sa contina doar cifre!", CNP); } else if(isCifraSex(CNP) == false) { throw new CNPEronat("\nEroare! => Prima cifra ce codifica sex-ul trebuie sa fie cuprinsa intre 1 si 6!", CNP); } else if(isCifraLuna(CNP) == false) { throw new CNPEronat("\nEroare! => Cifrele ce codifica luna trebuie sa fie cuprinse intre 1 si 12!", CNP); } else if(isCifraZiua(CNP) == false) { throw new CNPEronat("\nEroare! => Cifrele ce codifica ziua trebuie sa fie cuprinse intre 1 si 31!", CNP); } else { this.nume = nume; this.CNP = CNP; } } public String getNume() { return nume; } public String getCNP() { return CNP; } public String toString() { return "\nNume : " + nume + "\nCNP : " + CNP; } Boolean isCifra(String s) { for (int i = 0; i < s.length(); i++) if (Character.isDigit(s.charAt(i)) == false) return false; return true; } Boolean isCifraSex(String str) { int cifraSex = Character.getNumericValue(str.charAt(0)); if(cifraSex > 6 || cifraSex == 0) { System.out.println("Cifra ce codifica sex-ul este " + cifraSex + "\n"); return false; } return true; } Boolean isCifraLuna(String str) { int luna = convertireCifre(str.charAt(3),str.charAt(4)); if(luna > 12 || luna == 0) { System.out.println("Cifrele ce codifica luna sunt " + luna + "\n"); return false; } return true; } Boolean isCifraZiua(String str) { int ziua = convertireCifre(str.charAt(5),str.charAt(6)); if(ziua > 31 || ziua == 0) { System.out.println("Cifrele ce codifica ziua sunt " + ziua + "\n"); return false; } return true; } void calculareVarsta(String str) { Calendar dataNasterii = Calendar.getInstance(); Calendar dataCurenta = Calendar.getInstance(); int cifraSex = Character.getNumericValue(str.charAt(0)); int ziua = convertireCifre(str.charAt(5),str.charAt(6)); int luna = convertireCifre(str.charAt(3),str.charAt(4)); int an = convertireCifre(str.charAt(1),str.charAt(2)); if(cifraSex == 1 || cifraSex == 2) { an += 1900; }else if(cifraSex == 5 || cifraSex == 6) { an += 2000; } dataNasterii.set(an, luna, ziua); long millis = dataCurenta.getTimeInMillis() - dataNasterii.getTimeInMillis(); long ani = millis / 31536000000L; System.out.println("\nData nasterii \nZiua : " + ziua + "\nLuna : " + luna + "\nAn : " + an); System.out.println("\nVarsta : " + ani + " ani"); } private static int convertireCifre(char char1, char char2) { int primaCifra = Character.getNumericValue(char1); int aDouaCifra = Character.getNumericValue(char2); return primaCifra *10 + aDouaCifra; } }
package com.appdear.client.model; import android.content.ComponentName; import android.content.Intent; import android.graphics.drawable.Drawable; public class OyysShareApplicationInfo { public CharSequence title; public Intent intent; public Drawable icon; public boolean filtered; public boolean ischeck; public int id; public void setActivity(ComponentName className, int launchFlags) { intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(className); intent.setFlags(launchFlags); } public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof OyysShareApplicationInfo)) { return false; } OyysShareApplicationInfo that = (OyysShareApplicationInfo) o; return title.equals(that.title) && intent.getComponent().getClassName().equals( that.intent.getComponent().getClassName()); } public int hashCode() { int result; result = (title != null ? title.hashCode() : 0); final String name = intent.getComponent().getClassName(); result = 31 * result + (name != null ? name.hashCode() : 0); return result; } }
package com.slort.struts.form.security; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMapping; import com.slort.model.Opcionmenu; import com.slort.struts.action.ActionForm; public class PerfilForm extends ActionForm { private Integer idPerfil; private String descripcionCorta; private String descripcionLarga; private Integer opcionDefecto; private Opcionmenu opcionmenuDefecto; private String[] opcionAsignada; private String[] idsOpcionmenu; private String[] orden; public PerfilForm() { super(); this.opcionAsignada = new String[1000]; this.idsOpcionmenu = new String[1000]; this.orden = new String[1000]; } public Integer getIdPerfil() { return idPerfil; } public void setIdPerfil(Integer idPerfil) { this.idPerfil = idPerfil; } public String getDescripcionCorta() { return descripcionCorta; } public void setDescripcionCorta(String descripcionCorta) { this.descripcionCorta = descripcionCorta; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); validateRequired(errors, "descripcionCorta", this.descripcionCorta); validateRequired(errors, "descripcionLarga", this.descripcionLarga); return errors; } public void reset(ActionMapping mapping, HttpServletRequest request) { this.idPerfil=null; this.descripcionCorta =""; this.descripcionLarga = ""; super.reset(mapping, request); } public Integer getOpcionDefecto() { if (this.opcionmenuDefecto==null) return null; return opcionmenuDefecto.getIdOpcionmenu(); } public void setOpcionDefecto(Integer opcionDefecto) { if (this.opcionmenuDefecto==null) this.opcionmenuDefecto = new Opcionmenu(); this.opcionmenuDefecto.setIdOpcionmenu(this.opcionDefecto); this.opcionmenuDefecto.setDescripcionLargo(this.getDescripcionLargaOpcionDefecto()); this.opcionDefecto = opcionDefecto; opcionmenuDefecto.setIdOpcionmenu(opcionDefecto); } public Opcionmenu getOpcionmenuDefecto() { return opcionmenuDefecto; } public void setOpcionmenuDefecto(Opcionmenu opcionmenuDefecto) { this.opcionmenuDefecto = opcionmenuDefecto; } public String getDescripcionLargaOpcionDefecto(){ if (this.opcionmenuDefecto==null) return null; return this.opcionmenuDefecto.getDescripcionLargo(); } public String getDescripcionLarga() { return descripcionLarga; } public void setDescripcionLarga(String descripcionLarga) { this.descripcionLarga = descripcionLarga; } public void setDescripcionLargaOpcionDefecto(String pvalor){ if (this.opcionmenuDefecto==null) this.opcionmenuDefecto = new Opcionmenu(); this.opcionmenuDefecto.setIdOpcionmenu(this.opcionDefecto); this.opcionmenuDefecto.setDescripcionLargo(pvalor); } public String[] getOpcionAsignada() { return opcionAsignada; } public void setOpcionAsignada(String[] opcionAsignada) { this.opcionAsignada = opcionAsignada; } public String[] getIdsOpcionmenu() { return idsOpcionmenu; } public void setIdsOpcionmenu(String[] idsOpcionmenu) { this.idsOpcionmenu = idsOpcionmenu; } public String[] getOrden() { return orden; } public void setOrden(String[] orden) { this.orden = orden; } }
package com.example.mobilebooks; import android.os.Bundle; import android.os.Handler; import android.app.Activity; import android.content.Intent; import android.widget.VideoView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Thread startApp = new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub Intent i = new Intent(MainActivity.this, LoginActivity.class); startActivity(i); finish(); } }); Handler handler = new Handler(); handler.postDelayed(startApp, 2000); } }
package roart; public class Main { public static void main(String[] argv) { if (argv[0] == null || argv.length == 0) { System.out.println("No number"); return; } try { Integer number = Integer.valueOf(argv[0]); if (number < 0) { System.out.println("No natural number"); return; } System.out.println("" + findMultiplier(number)); } catch (NumberFormatException e) { System.out.println("No integer given"); } } static int findMultiplier (int allNumbersLessThan) { int[] numbers = { 3, 5 }; int resultNumber = 0; for (Integer number : numbers) { int mult = (allNumbersLessThan - 1) / number; resultNumber += number * mult * (mult + 1) / 2; } int fifteens = allNumbersLessThan / 15; resultNumber -= 15 * fifteens * (fifteens + 1) / 2; return resultNumber; } }
package com.emn.member.model; import java.sql.SQLException; import org.apache.log4j.Logger; import com.emn.common.SqlMapConfig; public class UserDao2 { // 싱글톤 방식으로 처리하기 위해 static으로 처리함. private static UserDao2 instance = new UserDao2(); //for logging public static final Logger log = Logger.getLogger(UserDao2.class); // 인스턴스를 반환하는 메소드 public static UserDao2 getInstance(){ return instance; } private UserDao2(){ super(); } public boolean isCorrectPassword(String memberId, String memberPw) throws SQLException{ boolean result = false; Member memberResult = null; Member param = new Member(); param.setMemberId(memberId); param.setMemberPw(memberPw); memberResult = (Member)SqlMapConfig.selectOneEmn("login", param); if(memberResult != null && memberResult.getMemberId() != null)result = true; else result = false; return result; } }
package de.lgohlke.pebuild.config; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; import org.yaml.snakeyaml.error.MarkedYAMLException; import static org.junit.jupiter.api.Assertions.assertThrows; class BuildConfigReaderTest { @Test void shouldParse() { String yaml = "" + "options: \n" + " timeout: 10m\n" + "\n" + "steps:\n" + "- name: demo\n" + " command: 'date'\n" + "- name: sleep\n" + " command: 'sleep 2'\n" + " timeout: 10s\n" + " waitfor: ['demo']"; BuildConfigReader.parse(yaml); } @Nested class errors { @Test void failOnMissingSteps_implicite() { assertThrows(BuildConfigReader.MissingSteps.class, () -> BuildConfigReader.parse("options:")); } @Test void failOnMissingSteps_explicite() { assertThrows(BuildConfigReader.MissingSteps.class, () -> BuildConfigReader.parse("steps:")); } @Test void failOnEmptyConfig() { assertThrows(BuildConfigReader.EmptyConfig.class, () -> BuildConfigReader.parse("")); } @Test void failOnWrongConfig() { assertThrows(MarkedYAMLException.class, () -> BuildConfigReader.parse("x")); } @Test void failOnMissingCommandInStep() { String config = "" + "steps:\n" + " - name: test\n"; Executable executable = () -> BuildConfigReader.parse(config); assertThrows(BuildConfigReader.MissingCommandInStepException.class, executable); } } }
package codechef; import java.util.*; /** * Given a set of closed intervals, find the * smallest set that covers all the intervals. * * Elements of Programming Interviews, p331 */ public final class CoverIntervals { public static final class Interval { public final int start; public final int end; public Interval(int start, int end) { this.start = start; this.end = end; } public Interval(Interval other) { this.start = other.start; this.end = other.end; } } /** * Approach: greedy * <ul> * <li> sort the intervals by start date * <li> starting with the first interval, * greedily add intervals to the window * that touches the first interval * </ul> * * @param intervals to cover - (start, end) inclusive * @return minimum set of times that touch all the intervals */ public static Set<Integer> findCover(List<Interval> intervals) { if (intervals.isEmpty()) { return Collections.emptySet(); } final Set<Integer> result = new HashSet<>(); final List<Interval> sortedByStart = new ArrayList<>(intervals); Collections.sort( intervals, (a, b) -> Integer.compare(a.start, b.start) ); int windowStart = Integer.MIN_VALUE; int windowEnd = Integer.MAX_VALUE; for (final Interval it : sortedByStart) { if (it.start > windowEnd) { // interval is outside the window result.add(windowStart); windowStart = it.start; windowEnd = it.end; } else { if (it.start > windowStart) { windowStart = it.start; } if (it.end < windowEnd) { windowEnd = it.end; } } } result.add(windowStart); return result; } }
package Sem1.HomeWork.GUI2.Circles; import javax.swing.*; public class Splat { public static void main (String[] args) { JFrame frame = new JFrame ("Splat"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new SplatPanel()); frame.pack(); frame.setVisible(true); } }
package com.yjjyjy.yjj.entity; /**** * Description: 性别枚举类<br/> * Copyright: Copyright (c) 2018-2028 <br/> * */ public enum Sex { MALE("男"), FEMALE("女"), UNKNOW("保密");//记住要用分号结束 private String value;//中文描述 /** * 私有构造,防止被外部调用 * @param desc */ private Sex(String value){ this.value=value; } /** * 定义方法,返回描述,跟常规类的定义没区别 * @return */ public String getValue(){ return value; } }
import core.Coordinate; import core.Person; import core.UpdatingFunctions; import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.TilePane; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.stage.Stage; public class VisualizationApplication extends Application { private Stage stage; private Scene personScene, cityScene; @Override public void start(Stage primaryStage) throws Exception { Label personLabel = new Label("Person Distribution"); Group personGroup = new Group(); for (Person person : UpdatingFunctions.getPeople()) { personGroup.getChildren().add(new Circle(person.getLocation().getX(), person.getLocation().getY(), 1, Color.BLACK)); } Button toCityButton = new Button("Show city distribution"); toCityButton.setOnAction(e -> nextScene()); TilePane peoplePane = new TilePane(10, 10, personLabel, personGroup, toCityButton ); peoplePane.setPrefColumns(1); peoplePane.setPadding(new Insets(25)); peoplePane.setAlignment(Pos.TOP_CENTER); Label cityLabel = new Label("City Distribution"); Group cityGroup = new Group(); int roundFactor = (int) Math.pow(10, UpdatingFunctions.getMeanPopDigits()); for (Coordinate coordinate: UpdatingFunctions.getCities().keySet()) { //this is kind of sketchy cityGroup.getChildren().add(new Circle(coordinate.getX(), coordinate.getY(), UpdatingFunctions.getCities().get(coordinate) / roundFactor)); } Button toPersonButton = new Button("Show person distribution"); toPersonButton.setOnAction(e -> nextScene()); TilePane cityPane = new TilePane(10, 10, cityLabel, cityGroup, toPersonButton ); cityPane.setPrefColumns(1); cityPane.setPadding(new Insets(25)); cityPane.setAlignment(Pos.TOP_CENTER); personScene = new Scene(peoplePane); cityScene = new Scene(cityPane); stage = new Stage(); stage.setScene(personScene); stage.show(); } private void nextScene() { if (stage.getScene().equals(personScene)) { stage.setScene(cityScene); } else { stage.setScene(personScene); } } public static void main(String[] args) { launch(args); } }
package corgi.hub.core.mqtt.listener.impl; import corgi.hub.core.mqtt.bean.MqttStoreMessage; import corgi.hub.core.mqtt.bean.Subscription; import corgi.hub.core.mqtt.common.HubContext; import corgi.hub.core.mqtt.common.JedisConnectionManager; import corgi.hub.core.mqtt.common.MqttConstants; import corgi.hub.core.mqtt.event.MqttPublishEvent; import corgi.hub.core.mqtt.exception.RedisStorageException; import corgi.hub.core.mqtt.listener.QueueListener; import corgi.hub.core.mqtt.service.IQueueService; import corgi.hub.core.mqtt.service.IStorageService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import redis.clients.jedis.Jedis; import javax.annotation.PostConstruct; import javax.annotation.Resource; /** * Created by Terry LIANG on 2017/1/19. */ @Component("InternalPublishQueueListener") public class InternalPublishQueueListener extends AbstractQueueListener { private static final Logger LOGGER = LoggerFactory.getLogger(InternalPublishQueueListener.class); private String name = InternalPublishQueueListener.class.getName(); @Resource(name = "redisStorageService") private IStorageService storageService; @Autowired private IQueueService queueService; @Autowired private JedisConnectionManager jedisConnectionManager; private static final String EXCLUSIVE_QUEUE_PREFIX = "exclusiveQueue-"; private String internalTopic; @Autowired private HubContext context; @PostConstruct private void init() { // this.exclusiveQueue = EXCLUSIVE_QUEUE_PREFIX + "-" + context.getNodeName(); internalTopic = MqttConstants.INTERNAL_PUBLISH_TOPIC; } @Override public void onQueueMessage(Object message) { String publishKey = (String) message; MqttPublishEvent mqttPublishEvent = (MqttPublishEvent) storageService.retrievePublishedMessage(publishKey); Jedis jedis = null; try { if (mqttPublishEvent != null) { jedis = jedisConnectionManager.getPersistConnection(); MqttStoreMessage mqttStoreMessage = storageService.addStoreMessage(mqttPublishEvent); long storeMsgId = mqttStoreMessage.getStoreMsgId(); storageService.removePublishedMessage(publishKey); String topic = mqttPublishEvent.getTopic(); // Add the logic for downlink message to specify device if (mqttStoreMessage.getKey() != null && !"*".equals(mqttStoreMessage.getKey())) { Subscription subscription = storageService.retrieveSubscription(mqttStoreMessage.getKey(), topic); String exclusiveQueue = EXCLUSIVE_QUEUE_PREFIX + "-" + subscription.getNodeBelongTo(); jedis.lpush(exclusiveQueue, Long.toString(storeMsgId)); } else if (topic.startsWith("VirtualTopic")) { queueService.pushQueueMessage(topic, storeMsgId); } else { storageService.loggingNotifyEvent(storeMsgId); notifySubscriber(Long.toString(storeMsgId)); } } else { } } catch (RedisStorageException e) { LOGGER.error(e.getMessage(), e); } finally { if (jedis != null) { jedis.close(); } } } private void notifySubscriber(String message) throws RedisStorageException { Jedis jedis = null; try { jedis = jedisConnectionManager.getPersistConnection(); jedis.publish(internalTopic, message); } catch (Exception e) { throw new RedisStorageException(String.format("Fail to publish %s %s... ", internalTopic, message), e); } finally { if (jedis != null) { jedis.close(); } } } @Override public String getListenerName() { return this.name; } }
package br.com.GamesPlat.api.controller.dto; import java.util.Optional; import br.com.GamesPlat.api.models.Usuario; public class UsuarioDto { private String login; private String username; private String email; public UsuarioDto(Optional<Usuario> user) { this.login = user.get().getLogin(); this.username = user.get().getUsername(); this.email = user.get().getEmail(); } public UsuarioDto(Usuario user) { this.login = user.getLogin(); this.username = user.getUsername(); this.email = user.getEmail(); } public String getLogin() { return login; } public String getUsername() { return username; } public String getEmail() { return email; } }
package factorioMain; import org.newdawn.slick.Animation; public class HighAssemblyMachine extends AssemblyMachine{ private boolean item3; private String itemthree; private Entity entity3; public HighAssemblyMachine(Animation animation, String name, Entity produced, Entity item1, Entity item2,Entity item3) { super(animation, name, produced, item1, item2); this.itemthree = item3.getName(); // TODO Auto-generated constructor stub } @Override public boolean IsValidEntity(Entity e) { if(e.getName() == this.itemone && !this.item1) { this.item1 = true; return true; } else if(e.getName() == this.itemtwo && !this.item2) { this.item2 = true; return true; } else if(e.getName() == this.itemthree && !this.item3) { this.item3 = true; return true; } else { return false; } } @Override public void setReady(boolean full) { if(this.item1 && this.item2 && this.item3) { this.ready = true; } else { this.ready = false; } } @Override public void setFull(boolean full) { if(this.item1 && this.item2 && this.item3) { this.full = true; } else { this.full = false; } } @Override public void update(WorldGeneration world, int posX, int posY, AssetManager asset) { this.tick ++; if(this.tick > 20) { //update if(this.entity != null && this.entity2 != null && this.entity3 != null && this.item1 && this.item2 && this.item3 && world.getEntityFromIndex(this.getX(), this.getY()) == null) { this.animation = this.animation2; if(this.smelt > 100) { Entity temp; this.entity.setInInventory(false); this.entity2.setInInventory(false); this.entity3.setInInventory(false); this.entity = null; this.entity2 = null; this.entity3 = null; temp = new Entity(this.itemimage,this.getX()*world.getTileSize(),this.getY()*world.getTileSize(),this.itemname); temp.setInInventory(true); world.AddEntity(temp); this.smelt = 0; this.ready = true; this.item1 = false; this.item2 = false; this.item3 = false; this.full = false; } else { this.smelt++; } } else { this.animation = null; } this.tick = 0; } } @Override public void setEntity(Entity entity) { if(entity != null) { this.IsValidEntity(entity); if(this.entity == null) { this.setFull(true); this.entity = entity; this.entity.setInInventory(true); } else if(this.entity2 == null) { this.setFull(true); this.entity2 = entity; this.entity2.setInInventory(true); } else if(this.entity3 == null) { this.setFull(true); this.entity3 = entity; this.entity3.setInInventory(true); } entity.setErase(true); } } @Override public String toString() { String entity1str = "null"; String entity2str = "null"; String entity3str = "null"; if(this.entity != null) { entity1str = this.entity.getName(); } if(this.entity2 != null) { entity2str = this.entity2.getName(); } if(this.entity3 != null) { entity3str = this.entity3.getName(); } return this.name + "\n" + " Entity1: " + entity1str + "\n" + " Entity2: " + entity2str + "\n" + " Entity3: " + entity3str + "\n" + "Required items : " + itemone +" & "+ itemtwo + " & " + itemthree; } }
package com.tencent.mm.plugin.qqmail.ui; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.Filter; import android.widget.Filterable; import android.widget.TextView; import com.tencent.mm.R; import com.tencent.mm.plugin.qqmail.b.i; import java.util.ArrayList; import java.util.List; public class MailAddrsViewControl$b extends BaseAdapter implements Filterable { private List<i> ePu; private ArrayList<i> ePv; private Context mContext; private final Object mLock = new Object(); private boolean mhe = true; private a mhf; public MailAddrsViewControl$b(Context context, List<i> list) { this.mContext = context; this.ePu = list; } public final void notifyDataSetChanged() { super.notifyDataSetChanged(); this.mhe = true; } public final int getCount() { return this.ePu.size(); } /* renamed from: uZ */ public final i getItem(int i) { return (i) this.ePu.get(i); } public final long getItemId(int i) { return (long) i; } public final View getView(int i, View view, ViewGroup viewGroup) { if (view == null) { view = View.inflate(this.mContext, R.i.qqmail_dropdown_addrlist_item, null); b bVar = new b(this, (byte) 0); bVar.eMe = (TextView) view.findViewById(R.h.qqmail_addrlist_item_name_tv); bVar.mgP = (TextView) view.findViewById(R.h.qqmail_addrlist_item_addr_iv); bVar.mhh = (CheckBox) view.findViewById(R.h.qqmail_addrlist_item_select_cb); view.setTag(bVar); } else { ViewGroup viewGroup2 = (ViewGroup) view; } i uZ = getItem(i); b bVar2 = (b) view.getTag(); bVar2.eMe.setText(uZ.name); bVar2.mgP.setText(uZ.kCs); bVar2.mhh.setVisibility(8); view.setBackgroundColor(-789517); return view; } public final Filter getFilter() { if (this.mhf == null) { this.mhf = new a(this, (byte) 0); } return this.mhf; } }
package org.apache.commons.net.ftp; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.net.InetAddress; import java.net.SocketException; import java.net.SocketTimeoutException; import java.util.ArrayList; import org.apache.commons.net.MalformedServerReplyException; import org.apache.commons.net.ProtocolCommandSupport; import org.apache.commons.net.SocketClient; import org.apache.commons.net.io.CRLFLineReader; public class FTP extends SocketClient { public static final int DEFAULT_DATA_PORT = 20; public static final int DEFAULT_PORT = 21; public static final int ASCII_FILE_TYPE = 0; public static final int EBCDIC_FILE_TYPE = 1; public static final int BINARY_FILE_TYPE = 2; public static final int LOCAL_FILE_TYPE = 3; public static final int NON_PRINT_TEXT_FORMAT = 4; public static final int TELNET_TEXT_FORMAT = 5; public static final int CARRIAGE_CONTROL_TEXT_FORMAT = 6; public static final int FILE_STRUCTURE = 7; public static final int RECORD_STRUCTURE = 8; public static final int PAGE_STRUCTURE = 9; public static final int STREAM_TRANSFER_MODE = 10; public static final int BLOCK_TRANSFER_MODE = 11; public static final int COMPRESSED_TRANSFER_MODE = 12; public static final String DEFAULT_CONTROL_ENCODING = "ISO-8859-1"; public static final int REPLY_CODE_LEN = 3; private static final String __modes = "AEILNTCFRPSBC"; protected int _replyCode; protected ArrayList<String> _replyLines; protected boolean _newReplyString; protected String _replyString; protected String _controlEncoding; protected ProtocolCommandSupport _commandSupport_; protected boolean strictMultilineParsing = false; private boolean strictReplyParsing = true; protected BufferedReader _controlInput_; protected BufferedWriter _controlOutput_; public FTP() { setDefaultPort(21); this._replyLines = new ArrayList<>(); this._newReplyString = false; this._replyString = null; this._controlEncoding = "ISO-8859-1"; this._commandSupport_ = new ProtocolCommandSupport(this); } private boolean __strictCheck(String line, String code) { return !(line.startsWith(code) && line.charAt(3) == ' '); } private boolean __lenientCheck(String line) { return !(line.length() > 3 && line.charAt(3) != '-' && Character.isDigit(line.charAt(0))); } private void __getReply() throws IOException { __getReply(true); } protected void __getReplyNoReport() throws IOException { __getReply(false); } private void __getReply(boolean reportReply) throws IOException { this._newReplyString = true; this._replyLines.clear(); String line = this._controlInput_.readLine(); if (line == null) throw new FTPConnectionClosedException( "Connection closed without indication."); int length = line.length(); if (length < 3) throw new MalformedServerReplyException( "Truncated server reply: " + line); String code = null; try { code = line.substring(0, 3); this._replyCode = Integer.parseInt(code); } catch (NumberFormatException e) { throw new MalformedServerReplyException( "Could not parse response code.\nServer Reply: " + line); } this._replyLines.add(line); if (length > 3) { char sep = line.charAt(3); if (sep == '-') { do { line = this._controlInput_.readLine(); if (line == null) throw new FTPConnectionClosedException( "Connection closed without indication."); this._replyLines.add(line); } while (isStrictMultilineParsing() ? !__strictCheck(line, code) : !__lenientCheck(line)); } else if (isStrictReplyParsing()) { if (length == 4) throw new MalformedServerReplyException("Truncated server reply: '" + line + "'"); if (sep != ' ') throw new MalformedServerReplyException("Invalid server reply: '" + line + "'"); } } else if (isStrictReplyParsing()) { throw new MalformedServerReplyException("Truncated server reply: '" + line + "'"); } if (reportReply) fireReplyReceived(this._replyCode, getReplyString()); if (this._replyCode == 421) throw new FTPConnectionClosedException("FTP response 421 received. Server closed connection."); } protected void _connectAction_() throws IOException { _connectAction_((Reader)null); } protected void _connectAction_(Reader socketIsReader) throws IOException { super._connectAction_(); if (socketIsReader == null) { this._controlInput_ = (BufferedReader)new CRLFLineReader(new InputStreamReader(this._input_, getControlEncoding())); } else { this._controlInput_ = (BufferedReader)new CRLFLineReader(socketIsReader); } this._controlOutput_ = new BufferedWriter(new OutputStreamWriter(this._output_, getControlEncoding())); if (this.connectTimeout > 0) { int original = this._socket_.getSoTimeout(); this._socket_.setSoTimeout(this.connectTimeout); try { __getReply(); if (FTPReply.isPositivePreliminary(this._replyCode)) __getReply(); } catch (SocketTimeoutException e) { IOException ioe = new IOException("Timed out waiting for initial connect reply"); ioe.initCause(e); throw ioe; } finally { this._socket_.setSoTimeout(original); } } else { __getReply(); if (FTPReply.isPositivePreliminary(this._replyCode)) __getReply(); } } public void setControlEncoding(String encoding) { this._controlEncoding = encoding; } public String getControlEncoding() { return this._controlEncoding; } public void disconnect() throws IOException { super.disconnect(); this._controlInput_ = null; this._controlOutput_ = null; this._newReplyString = false; this._replyString = null; } public int sendCommand(String command, String args) throws IOException { if (this._controlOutput_ == null) throw new IOException("Connection is not open"); String message = __buildMessage(command, args); __send(message); fireCommandSent(command, message); __getReply(); return this._replyCode; } private String __buildMessage(String command, String args) { StringBuilder __commandBuffer = new StringBuilder(); __commandBuffer.append(command); if (args != null) { __commandBuffer.append(' '); __commandBuffer.append(args); } __commandBuffer.append("\r\n"); return __commandBuffer.toString(); } private void __send(String message) throws IOException, FTPConnectionClosedException, SocketException { try { this._controlOutput_.write(message); this._controlOutput_.flush(); } catch (SocketException e) { if (!isConnected()) throw new FTPConnectionClosedException("Connection unexpectedly closed."); throw e; } } protected void __noop() throws IOException { String msg = __buildMessage(FTPCmd.NOOP.getCommand(), (String)null); __send(msg); __getReplyNoReport(); } @Deprecated public int sendCommand(int command, String args) throws IOException { return sendCommand(FTPCommand.getCommand(command), args); } public int sendCommand(FTPCmd command) throws IOException { return sendCommand(command, (String)null); } public int sendCommand(FTPCmd command, String args) throws IOException { return sendCommand(command.getCommand(), args); } public int sendCommand(String command) throws IOException { return sendCommand(command, (String)null); } public int sendCommand(int command) throws IOException { return sendCommand(command, (String)null); } public int getReplyCode() { return this._replyCode; } public int getReply() throws IOException { __getReply(); return this._replyCode; } public String[] getReplyStrings() { return this._replyLines.<String>toArray(new String[this._replyLines.size()]); } public String getReplyString() { if (!this._newReplyString) return this._replyString; StringBuilder buffer = new StringBuilder(256); for (String line : this._replyLines) { buffer.append(line); buffer.append("\r\n"); } this._newReplyString = false; return this._replyString = buffer.toString(); } public int user(String username) throws IOException { return sendCommand(FTPCmd.USER, username); } public int pass(String password) throws IOException { return sendCommand(FTPCmd.PASS, password); } public int acct(String account) throws IOException { return sendCommand(FTPCmd.ACCT, account); } public int abor() throws IOException { return sendCommand(FTPCmd.ABOR); } public int cwd(String directory) throws IOException { return sendCommand(FTPCmd.CWD, directory); } public int cdup() throws IOException { return sendCommand(FTPCmd.CDUP); } public int quit() throws IOException { return sendCommand(FTPCmd.QUIT); } public int rein() throws IOException { return sendCommand(FTPCmd.REIN); } public int smnt(String dir) throws IOException { return sendCommand(FTPCmd.SMNT, dir); } public int port(InetAddress host, int port) throws IOException { StringBuilder info = new StringBuilder(24); info.append(host.getHostAddress().replace('.', ',')); int num = port >>> 8; info.append(','); info.append(num); info.append(','); num = port & 0xFF; info.append(num); return sendCommand(FTPCmd.PORT, info.toString()); } public int eprt(InetAddress host, int port) throws IOException { StringBuilder info = new StringBuilder(); String h = host.getHostAddress(); int num = h.indexOf('%'); if (num > 0) h = h.substring(0, num); info.append("|"); if (host instanceof java.net.Inet4Address) { info.append("1"); } else if (host instanceof java.net.Inet6Address) { info.append("2"); } info.append("|"); info.append(h); info.append("|"); info.append(port); info.append("|"); return sendCommand(FTPCmd.EPRT, info.toString()); } public int pasv() throws IOException { return sendCommand(FTPCmd.PASV); } public int epsv() throws IOException { return sendCommand(FTPCmd.EPSV); } public int type(int fileType, int formatOrByteSize) throws IOException { StringBuilder arg = new StringBuilder(); arg.append("AEILNTCFRPSBC".charAt(fileType)); arg.append(' '); if (fileType == 3) { arg.append(formatOrByteSize); } else { arg.append("AEILNTCFRPSBC".charAt(formatOrByteSize)); } return sendCommand(FTPCmd.TYPE, arg.toString()); } public int type(int fileType) throws IOException { return sendCommand(FTPCmd.TYPE, "AEILNTCFRPSBC".substring(fileType, fileType + 1)); } public int stru(int structure) throws IOException { return sendCommand(FTPCmd.STRU, "AEILNTCFRPSBC".substring(structure, structure + 1)); } public int mode(int mode) throws IOException { return sendCommand(FTPCmd.MODE, "AEILNTCFRPSBC".substring(mode, mode + 1)); } public int retr(String pathname) throws IOException { return sendCommand(FTPCmd.RETR, pathname); } public int stor(String pathname) throws IOException { return sendCommand(FTPCmd.STOR, pathname); } public int stou() throws IOException { return sendCommand(FTPCmd.STOU); } public int stou(String pathname) throws IOException { return sendCommand(FTPCmd.STOU, pathname); } public int appe(String pathname) throws IOException { return sendCommand(FTPCmd.APPE, pathname); } public int allo(int bytes) throws IOException { return sendCommand(FTPCmd.ALLO, Integer.toString(bytes)); } public int feat() throws IOException { return sendCommand(FTPCmd.FEAT); } public int allo(int bytes, int recordSize) throws IOException { return sendCommand(FTPCmd.ALLO, String.valueOf(Integer.toString(bytes)) + " R " + Integer.toString(recordSize)); } public int rest(String marker) throws IOException { return sendCommand(FTPCmd.REST, marker); } public int mdtm(String file) throws IOException { return sendCommand(FTPCmd.MDTM, file); } public int mfmt(String pathname, String timeval) throws IOException { return sendCommand(FTPCmd.MFMT, String.valueOf(timeval) + " " + pathname); } public int rnfr(String pathname) throws IOException { return sendCommand(FTPCmd.RNFR, pathname); } public int rnto(String pathname) throws IOException { return sendCommand(FTPCmd.RNTO, pathname); } public int dele(String pathname) throws IOException { return sendCommand(FTPCmd.DELE, pathname); } public int rmd(String pathname) throws IOException { return sendCommand(FTPCmd.RMD, pathname); } public int mkd(String pathname) throws IOException { return sendCommand(FTPCmd.MKD, pathname); } public int pwd() throws IOException { return sendCommand(FTPCmd.PWD); } public int list() throws IOException { return sendCommand(FTPCmd.LIST); } public int list(String pathname) throws IOException { return sendCommand(FTPCmd.LIST, pathname); } public int mlsd() throws IOException { return sendCommand(FTPCmd.MLSD); } public int mlsd(String path) throws IOException { return sendCommand(FTPCmd.MLSD, path); } public int mlst() throws IOException { return sendCommand(FTPCmd.MLST); } public int mlst(String path) throws IOException { return sendCommand(FTPCmd.MLST, path); } public int nlst() throws IOException { return sendCommand(FTPCmd.NLST); } public int nlst(String pathname) throws IOException { return sendCommand(FTPCmd.NLST, pathname); } public int site(String parameters) throws IOException { return sendCommand(FTPCmd.SITE, parameters); } public int size(String parameters) throws IOException { return sendCommand(FTPCmd.SIZE, parameters); } public int syst() throws IOException { return sendCommand(FTPCmd.SYST); } public int stat() throws IOException { return sendCommand(FTPCmd.STAT); } public int stat(String pathname) throws IOException { return sendCommand(FTPCmd.STAT, pathname); } public int help() throws IOException { return sendCommand(FTPCmd.HELP); } public int help(String command) throws IOException { return sendCommand(FTPCmd.HELP, command); } public int noop() throws IOException { return sendCommand(FTPCmd.NOOP); } public boolean isStrictMultilineParsing() { return this.strictMultilineParsing; } public void setStrictMultilineParsing(boolean strictMultilineParsing) { this.strictMultilineParsing = strictMultilineParsing; } public boolean isStrictReplyParsing() { return this.strictReplyParsing; } public void setStrictReplyParsing(boolean strictReplyParsing) { this.strictReplyParsing = strictReplyParsing; } protected ProtocolCommandSupport getCommandSupport() { return this._commandSupport_; } } /* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\org\apache\commons\net\ftp\FTP.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
package com.example.demo.category; import com.sun.istack.NotNull; import lombok.Data; import lombok.Getter; import lombok.Setter; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.validation.constraints.Size; @Data @Entity @Setter @Getter public class Category { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @NotNull @Size(min = 2, max = 512, message = "Please provide Name size between 2 - 512") private String Name; }
package codeOrchestra.colt.updater; import java.io.*; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.nio.channels.FileChannel; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.prefs.Preferences; /** * @author Dima Kruk */ class ColtUpdater { private static final String NUM_OF_RESTART = "num_of_restart"; private static Preferences preferences = Preferences.userNodeForPackage(ColtUpdater.class); public static void main(String[] args) { File baseDir = getApplicationBaseDir(); File jarDir; if (SystemInfo.isMac) { jarDir = new File(baseDir, "Contents/Java"); } else if (SystemInfo.isWindows){ jarDir = new File(baseDir, "lib"); } else { jarDir = new File(baseDir, "app"); } File updates = new File(baseDir.getPath() + File.separator + "updates"); if (updates.exists()) { File[] files = updates.listFiles(); if (files != null) { for (File f : files) { if (f.getName().endsWith(".jar")) { try { if (checkFileMD5(f)) { copyFile(f, new File(jarDir.getPath(), f.getName())); } } catch (IOException e) { e.printStackTrace(); } } } } } try { File core = new File(jarDir, "colt-core.jar"); URLClassLoader loader = new URLClassLoader(new URL[] {core.toURI().toURL()}, ColtUpdater.class.getClassLoader()); Class app = Class.forName("codeOrchestra.colt.core.ui.ColtApplication", true, loader); Method[] methods = app.getMethods(); for (Method m : methods) { if (m.getName().equals("main")) { m.invoke(null, new Object[]{args}); break; } } preferences.putInt(NUM_OF_RESTART, 0); preferences.sync(); } catch (Throwable throwable) { throwable.printStackTrace(); int restarts = preferences.getInt(NUM_OF_RESTART, 0); if (restarts < 5) { restarts++; preferences.putInt(NUM_OF_RESTART, restarts); restart(); } else { //todo: need reinstall } } } public static boolean checkFileMD5(File file) { File md = new File(file.getParentFile(), file.getName() + ".MD5"); try { BufferedReader bufferedReader = new BufferedReader(new FileReader(md)); String md_str = bufferedReader.readLine(); bufferedReader.close(); md.delete(); String fileDigestMD5 = getFileDigestMD5(file); return md_str.equals(fileDigestMD5); } catch (IOException e) { e.printStackTrace(); return false; } } public static String getFileDigestMD5(File file) throws IOException { MessageDigest md; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return ""; } FileInputStream fis = new FileInputStream(file); byte[] dataBytes = new byte[1024]; int nread; while ((nread = fis.read(dataBytes)) != -1) { md.update(dataBytes, 0, nread); } fis.close(); byte[] mdbytes = md.digest(); //convert the byte to hex format StringBuffer sb = new StringBuffer(""); for (byte mdbyte : mdbytes) { sb.append(Integer.toString((mdbyte & 0xff) + 0x100, 16).substring(1)); } return sb.toString(); } public static void copyFile (File sourceFile, File destFile) throws IOException { if(!destFile.exists()) { destFile.createNewFile(); } try { FileChannel source = new FileInputStream(sourceFile).getChannel(); FileChannel destination = new FileOutputStream(destFile).getChannel(); destination.transferFrom(source, 0, source.size()); source.close(); destination.close(); sourceFile.delete(); } catch (Exception e) { System.out.println(e); } } public static File getApplicationBaseDir() { String coltBaseDirProp = System.getProperty("colt.base.dir"); coltBaseDirProp = coltBaseDirProp != null ? coltBaseDirProp : ""; if (coltBaseDirProp.isEmpty()) { String path = ColtUpdater.class.getProtectionDomain().getCodeSource().getLocation().getPath().replaceAll("%20", " "); File file = new File(path); while (!new File(file, "flex_sdk").exists()) { file = file.getParentFile(); } return file; } else if (SystemInfo.isMac && "$APP_PACKAGE".equals(coltBaseDirProp)) { File file = new File(ColtUpdater.class.getProtectionDomain().getCodeSource().getLocation().getPath()); while (!file.getName().equals("COLT.app")) { file = file.getParentFile(); } return file; } return new File(coltBaseDirProp); } public static void restart() { if (SystemInfo.isMac) { File baseDir = getApplicationBaseDir(); if (baseDir.getPath().endsWith(".app")) { try { Runtime.getRuntime().exec("open -n -a " + baseDir.getPath()); } catch (IOException e) { e.printStackTrace(); } } } else if (SystemInfo.isWindows) { File executable = getApplicationExecutable(); if (executable != null && executable.exists()) { startExecutable(executable.getPath()); } } else { throw new IllegalStateException("Unsupported OS: " + System.getProperty("os.name")); } } public static File getApplicationExecutable() { if (SystemInfo.isMac) { File executable = new File(getApplicationBaseDir(), "Contents/MacOs/JavaAppLauncher"); return executable.exists() ? executable : null; } if (SystemInfo.isWindows) { File executable = new File(getApplicationBaseDir(), "colt.exe"); return executable.exists() ? executable : null; } throw new IllegalStateException("Unsupported OS: " + System.getProperty("os.name")); } private static void startExecutable(String executable, String... args) { ProcessBuilder builder = new ProcessBuilder(executable); if (args.length > 0) { builder = builder.command(args); } try { builder.start(); } catch (IOException e) { e.printStackTrace(); } } }
/* * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.test.lib; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; /** * Run security tools (including jarsigner and keytool) in a new process. * The en_US locale is always used so a test can always match output to * English text. {@code /dev/urandom} is used as entropy source so tool will * not block because of entropy scarcity. {@code -Jvm-options} is supported * as an argument. */ public class SecurityTools { /** * The response file name for keytool. Use {@link #setResponse} to * create one. Do NOT manipulate it directly. */ public static final String RESPONSE_FILE = "security_tools_response.txt"; private SecurityTools() {} public static ProcessBuilder getProcessBuilder(String tool, List<String> args) { JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK(tool) .addVMArg("-Duser.language=en") .addVMArg("-Duser.country=US"); if (!Platform.isWindows()) { launcher.addVMArg("-Djava.security.egd=file:/dev/./urandom"); } for (String arg : args) { if (arg.startsWith("-J")) { launcher.addVMArg(arg.substring(2)); } else if (Platform.isWindows() && arg.isEmpty()) { // JDK-6518827: special handling for empty argument on Windows launcher.addToolArg("\"\""); } else { launcher.addToolArg(arg); } } return new ProcessBuilder(launcher.getCommand()); } /** * Runs keytool. * * @param args arguments to keytool * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer keytool(List<String> args) throws Exception { ProcessBuilder pb = getProcessBuilder("keytool", args); Path p = Paths.get(RESPONSE_FILE); if (!Files.exists(p)) { Files.createFile(p); } pb.redirectInput(ProcessBuilder.Redirect.from(new File(RESPONSE_FILE))); try { return execute(pb); } finally { Files.delete(p); } } /** * Runs keytool. * * @param args arguments to keytool in a single string. The string is * converted to be List with makeList. * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer keytool(String args) throws Exception { return keytool(makeList(args)); } /** * Runs keytool. * * @param args arguments to keytool * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer keytool(String... args) throws Exception { return keytool(List.of(args)); } /** * Sets the responses (user input) for keytool. * <p> * For example, if keytool requires entering a password twice, call * {@code setResponse("password", "password")}. Do NOT append a newline * character to each response. If there are useless responses at the end, * they will be discarded silently. If there are less responses than * necessary, keytool will read EOF. The responses will be written into * {@linkplain #RESPONSE_FILE a local file} and will only be used by the * next keytool run. After the run, the file is removed. Calling this * method will always overwrite the previous response file (if exists). * * @param responses response to keytool * @throws IOException if there is an error */ public static void setResponse(String... responses) throws IOException { String text; if (responses.length > 0) { text = Stream.of(responses).collect( Collectors.joining("\n", "", "\n")); } else { text = ""; } Files.write(Paths.get(RESPONSE_FILE), text.getBytes()); } /** * Runs jarsigner. * * @param args arguments to jarsigner * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer jarsigner(List<String> args) throws Exception { return execute(getProcessBuilder("jarsigner", args)); } private static OutputAnalyzer execute(ProcessBuilder pb) throws Exception { try { OutputAnalyzer oa = ProcessTools.executeCommand(pb); System.out.println("Exit value: " + oa.getExitValue()); return oa; } catch (Throwable t) { if (t instanceof Exception) { throw (Exception) t; } else { throw new Exception(t); } } } /** * Runs jarsigner. * * @param args arguments to jarsigner in a single string. The string is * converted to be List with makeList. * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer jarsigner(String args) throws Exception { return jarsigner(makeList(args)); } /** * Runs jarsigner. * * @param args arguments to jarsigner * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer jarsigner(String... args) throws Exception { return jarsigner(List.of(args)); } /** * Runs ktab. * * @param args arguments to ktab in a single string. The string is * converted to be List with makeList. * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer ktab(String args) throws Exception { return execute(getProcessBuilder("ktab", makeList(args))); } /** * Runs klist. * * @param args arguments to klist in a single string. The string is * converted to be List with makeList. * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer klist(String args) throws Exception { return execute(getProcessBuilder("klist", makeList(args))); } /** * Runs jar. * * @param args arguments to jar in a single string. The string is * converted to be List with makeList. * @return an {@link OutputAnalyzer} object * @throws Exception if there is an error */ public static OutputAnalyzer jar(String args) throws Exception { return execute(getProcessBuilder("jar", makeList(args))); } /** * Split a line to a list of string. All whitespaces are treated as * delimiters unless quoted between ` and `. * * @param line the input * @return the list */ public static List<String> makeList(String line) { List<String> result = new ArrayList<>(); StringBuilder sb = new StringBuilder(); boolean inBackTick = false; for (char c : line.toCharArray()) { if (inBackTick) { if (c == '`') { result.add(sb.toString()); sb.setLength(0); inBackTick = false; } else { sb.append(c); } } else { if (sb.length() == 0 && c == '`') { // Allow ` inside a string inBackTick = true; } else { if (Character.isWhitespace(c)) { if (sb.length() != 0) { result.add(sb.toString()); sb.setLength(0); } } else { sb.append(c); } } } } if (sb.length() != 0) { result.add(sb.toString()); } return result; } }
package com.fpl.statistics.fpls.player; import com.fpl.statistics.fpls.postion.Position; import com.fpl.statistics.fpls.postion.PositionService; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.web.server.ServerWebInputException; import java.util.Arrays; import java.util.List; import java.util.Optional; @Service public class PlayerService { private static final List<String> acceptableSortOptions = Arrays.asList("form", "value_form", "total_points", "points_per_game"); private final PlayerRepository playerRepository; private final PositionService positionService; public PlayerService(PlayerRepository playerRepository, PositionService positionService) { this.playerRepository = playerRepository; this.positionService = positionService; } public List<Player> getAvailablePlayers() { return playerRepository.findAllAvailable(); } public List<Player> getUnavailablePlayers() { return playerRepository.findAllUnavailable(); } public List<Player> getByPosition(String positionName, final String sortOption) { final Optional<Position> position = positionService.getPosition(positionName); if (position.isEmpty() || !acceptableSortOptions.contains(sortOption)) { throw new ServerWebInputException(String.format("Not supported position : %s or sort option : %s provided.", positionName, sortOption)); } return playerRepository.findAllByPosition(Integer.parseInt(position.get().getId()), Sort.by(Sort.Direction.DESC, "player." + sortOption)); } }
package misc; /** * @author huangyongkang, created 2020-04-07 */ public class TryCatchFinally { public static void main(String[] args) { System.out.println(getDoubleValue(4)); } private static int getDoubleValue(int value) { try { // 执行了 exit 将不会再执行 finally 语句块 System.exit(0); return 2 * value; } finally { System.out.println("getDoubleValue println"); // finally 中的 return 值会覆盖 try 中的 return return 1; } } }
package com.utility.test; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import com.mainmethod.test.BusinessMethod; import com.stepdefinition.test.StepDefinition; public class CommonMethods extends StepDefinition{ public static void clickmethod(By click) { WebElement clk = BusinessMethod.getobject().findElement(click); clk.click(); } public static void sendmethod(By send,String args) { WebElement element = BusinessMethod.getobject().findElement(send); } public static void check() { List<WebElement> list = BusinessMethod.getobject().findElements(By.xpath("//ul[@role='listbox']//li/descendant::div[@class='sbl1']")); System.out.println("The list of elements are =="+ list.size()); for(int i=0;i<list.size();i++) { System.out.println(list.get(i).getText()); if(list.get(i).getText().contains("maveric systems")) { list.get(i).click(); } else { System.out.println("Enter the valid company name"); } break; } } } //public static void validate() throws AWTException, InterruptedException { //Robot robot = new Robot(); //robot.keyPress(KeyEvent.VK_ENTER); //robot.keyRelease(KeyEvent.VK_ENTER); //Thread.sleep(2000); //String Title=BusinessMethod.getobject().getTitle(); //System.out.println("Title of page ==" + Title); //if(Title.contains("maveric systems")) { // System.out.println("It's valid company name "); //} //else { // System.out.println("It's invalid company name"); //}
package com.eigen.controller; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import java.text.ParseException; import java.util.ArrayList; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.eigen.constant.DataProvider; import com.eigen.constant.HistDataType; import com.eigen.iface.finder.HistDataFinder; import com.eigen.iface.finder.ProfileFinder; import com.eigen.iface.finder.EikonDataFinder; import com.eigen.iface.finder.YahooDataFinder; import com.eigen.iface.manager.HistDataManager; import com.eigen.iface.manager.ProfileManager; import com.eigen.model.MHistData; import com.eigen.model.MProfile; @RestController public class DataController { private static final Logger logger = Logger.getLogger(DataController.class.getName()); @Autowired private HistDataFinder histDataFinder; @Autowired private ProfileFinder profileFinder; /* <<< jhleong */ @Autowired private YahooDataFinder yahooDataFinder; @Autowired private EikonDataFinder eikonDataFinder; @Autowired private HistDataManager histDataManager; @Autowired private ProfileManager profileManager; /* <<< jhleong */ private DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); @RequestMapping("/get_profile/{dp}/{sb}") //@Cacheable("c_profile") public MProfile getProfile( @PathVariable("dp") int nDataProviderId, @PathVariable("sb") String sSymbol) { // DataProvider dataProvider = DataProvider.fromId(nDataProviderId); MProfile p = profileFinder.get_bySymbol(dataProvider, sSymbol); return p; } @RequestMapping("/get_bar_data/{dp}/{sb}/{fr}/{to}") //@Cacheable("c_bar_data") public List<MHistData> getBarData( @PathVariable("dp") int nDataProviderId, @PathVariable("sb") String sSymbol, @PathVariable("fr") String sFrDate, @PathVariable("to") String sToDate) { // List<MHistData> ls = getTimeSeriesForRest(nDataProviderId, sSymbol, sFrDate, sToDate, HistDataType.EQUITY); return ls; } @RequestMapping(value = "/get_bar_data_csv/{dp}/{sb}/{fr}/{to}", produces = "text/csv") //@Cacheable("c_bar_data_csv") public String getBarData_csv( HttpServletResponse response, @PathVariable("dp") int nDataProviderId, @PathVariable("sb") String sSymbol, @PathVariable("fr") String sFrDate, @PathVariable("to") String sToDate) { // response.setContentType("data:text/csv; charset=utf-8"); response.setHeader("Content-Disposition", "attachment; filename=" + sSymbol + ".csv"); // List<MHistData> ls = getBarData(nDataProviderId, sSymbol, sFrDate, sToDate); StringBuilder sb = new StringBuilder(); if (!ls.isEmpty()) { sb.append("Date,Open,High,Low,Close,Volume,Adj Close"); for (MHistData d: ls) { sb.append("\n" + dateFormat.format(d.getTs().getTime()) + "," + d.getOpen() + "," + d.getHigh() + "," + d.getLow() + "," + d.getClose() + "," + d.getVolume() + "," + d.getAdjClose()); } } return sb.toString(); } @RequestMapping("/get_nav_data/{dp}/{sb}/{tp}/{fr}/{to}") @Cacheable("c_nav_data") public List<MHistData> getNavData( @PathVariable("dp") int nDataProviderId, @PathVariable("sb") String sSymbol, @PathVariable("tp") String sType, @PathVariable("fr") String sFrDate, @PathVariable("to") String sToDate) { HistDataType t = HistDataType.fromCode(sType); List<MHistData> ls = getTimeSeriesForRest(nDataProviderId, sSymbol, sFrDate, sToDate, t); return ls; } @RequestMapping(value = "/get_nav_data_csv/{dp}/{sb}/{tp}/{fr}/{to}", produces = "text/csv") @Cacheable("c_nav_data_csv") public String getNavData_csv( @PathVariable("dp") int nDataProviderId, @PathVariable("sb") String sSymbol, @PathVariable("tp") String sType, @PathVariable("fr") String sFrDate, @PathVariable("to") String sToDate) { // List<MHistData> ls = getNavData(nDataProviderId, sSymbol, sType, sFrDate, sToDate); StringBuilder sb = new StringBuilder(); if (!ls.isEmpty()) { sb.append("Date,Open,High,Low,Close,Volume,Adj Close"); for (MHistData d: ls) { sb.append("\n" + dateFormat.format(d.getTs().getTime()) + "," + d.getOpen() + "," + d.getHigh() + "," + d.getLow() + "," + d.getClose() + "," + d.getVolume() + "," + d.getAdjClose()); } } return sb.toString(); } /* >>> jhleong */ private List<MHistData> getHistData(int nDataProviderId, MProfile mProfile, HistDataType type, Date dtFrom, Date dtTo) { DataProvider dataProvider = DataProvider.fromId(nDataProviderId); List<MHistData> ls = new ArrayList<MHistData>(); // switch (dataProvider) { case YAHOO: ls = yahooDataFinder.getHistData(mProfile); // TODO break; case EIKON_DESKTOP: ls = eikonDataFinder.getHistData(mProfile, type); //retrieve from 20 year ago till today. break; } // return ls; } private List<MHistData> getTimeSeriesForRest(int nDataProviderId, String sSymbol, String sFrDate, String sToDate, HistDataType type){ // Date dtFrDate; Date dtToDate; try { dtFrDate = dateFormat.parse(sFrDate); dtToDate = dateFormat.parse(sToDate); } catch (Exception e) { logger.log(Level.SEVERE, e.getMessage()); throw new RuntimeException(e); } MProfile p = getProfile(nDataProviderId, sSymbol); /* if the symbol is not found at the dataprovider */ if(p == null) return null; Calendar cToday = Calendar.getInstance(); Calendar cToDate = Calendar.getInstance(); try { cToday.setTime(dateFormat.parse(dateFormat.format(new Date()))); cToDate.setTime(dtToDate); } catch (ParseException e) { logger.log(Level.SEVERE, e.getMessage()); throw new RuntimeException(e); } if (p.getLastUpdateTs() == null || p.getLastUpdateTs().before(cToDate)) { // Get live data when last_update_ts is earlier then the ToDate // TODO: Check online availability first List<MHistData> ls = null; ls = getHistData(nDataProviderId, p, type, dtFrDate, dtToDate); //assumption of only EQUITY use BAR structure if (!ls.isEmpty()) { histDataManager.doDelete_byProfileId(p.getId()); histDataManager.doSave(ls); //update the hist_data.last_update_ts to the last day from the list p.setLastUpdateTs(ls.get(0).getTs()); profileManager.doUpdate(p); } } List<MHistData> ls = histDataFinder.get_byProfile_byType_byDate(p, type, dtFrDate, dtToDate); return ls; } /* <<< jhleong */ }
package com.example.testo.onAppDestroyed; import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.Calendar; public class AppStatesHandling { final static String TAG="a7eh"; public static int resumed; public static int paused; public static int started; public static int stopped; public void incrementResumed(){ resumed++; if(resumed>paused){ Log.d(TAG, "incrementResumed: "); } } public void incrementPaused(){ paused++; if(resumed>paused){ Status("Online"); Log.d(TAG, "incrementPaused: "+" App is open"); } } public void incrementStarted(){ started++; if(started>stopped){ Status("Online"); Log.d(TAG, "incrementStarted: "+" App is Open"); }else if(started==stopped){ Log.d(TAG, "incrementStarted: "); } } public void incrementStopped(){ stopped++; if(started>stopped){ Log.d(TAG, "incrementStopped: "+" App is Open"); }else if(started==stopped){ Status(Calendar.getInstance().getTime().toString()); Log.d(TAG, "incrementStopped: "+" App is in background apps"); } } private void Status(final String status){ if(FirebaseAuth.getInstance().getCurrentUser()!=null) { DatabaseReference reference = FirebaseDatabase.getInstance().getReference(); reference.child("users").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).child("information").child("activeStatus").setValue(status); } } }
package com.tencent.mm.g.a; import com.tencent.mm.sdk.b.b; public final class mt extends b { public a bXJ; public mt() { this((byte) 0); } private mt(byte b) { this.bXJ = new a(); this.sFm = false; this.bJX = null; } }
package com.squidtech.nodechan; import java.util.Random; import java.util.ArrayList; /** * * An entity that represents a single collection of posts or "conversation" on * NodeChan. * Despite the unfortunate name, this class has nothing to do with * multithreading. It's only a collection of posts. * * This class is a local collection of the posts in a specific thread that the * client has received. * */ public class ChanThread { /** Unique thread ID **/ private String tid; /** The title of this thread **/ private String title; /** The time of the most recent post in this thread **/ private long lastTime; /** Storage for all of the posts that have been made in this thread **/ private ArrayList<ChanPost> posts; public ChanThread(String tid) { if (tid.equals("")) { // generate random 8-character thread ID byte[] tid_bytes = new byte[8]; Random rand = new Random(); for (int i = 0; i < 8; i++) { tid_bytes[i] = (byte)(rand.nextInt(42) + 48); } this.tid = new String(tid_bytes); } else { this.tid = tid; } this.posts = new ArrayList<ChanPost>(); this.title = ""; this.lastTime = 0; } /** * Add a post to this thread. * Sorted by post time - earliest first. */ public void addPost(ChanPost post) { if (post.getIsRoot()) { // this is the first post in the thread this.title = post.getTitle(); } this.posts.add(post); if (post.getPostTime() > this.lastTime) this.lastTime = post.getPostTime(); } /** * For sorting purposes * Sort from most recent (so, highest) post time to oldest (top-to-bottom) */ public int compareTo(ChanThread other) { long t = this.lastTime - other.getLastTime(); if (t < 0) return 1; else if (t > 0) return -1; else return 0; } public void setTitle(String title) { this.title = title; } /* * getters */ public String getTid() { return this.tid; } public String getTitle() { return this.title; } public int getNumPosts() { return this.posts.size(); } public long getLastTime() { return this.lastTime; } public ChanPost getPost(int i) { return this.posts.get(i); } public ArrayList<ChanPost> getPosts() { return this.posts; } /** * Delete a post (in case of blocking) */ public void removePost(int i) { this.posts.remove(i); } }
package Ex1.SymbolTables; import ast.*; import java.util.HashMap; public class SymbolTable { private String type; //"class" or "method" private HashMap<String, MethodEntry> methods; private HashMap<String, VarEntry> variables; private SymbolTable parent; private AstNode astNodeInProgram; public SymbolTable(SymbolTable parent, AstNode astNode, String type){ this.type = type; this.methods = new HashMap<String, MethodEntry>(); this.variables = new HashMap<String, VarEntry>(); this.parent = parent; this.astNodeInProgram = astNode; } public void addVarEntry(VariableIntroduction var, String varType){ VarEntry entry = new VarEntry(var, varType); String name = var.name(); this.variables.put(name, entry); } public void addMethodEntry(MethodDecl methodDecl){ MethodEntry entry = new MethodEntry(methodDecl); String name = methodDecl.name(); this.methods.put(name, entry); } // public String type(){ // return this.type; // } public HashMap<String, MethodEntry> methods(){ return this.methods; } public HashMap<String, VarEntry> variables(){ return this.variables; } public boolean hasMethodWithName(String methodName){ return (this.methods.containsKey(methodName)); } public boolean hasVariableWithName(String varName){ return this.variables.containsKey(varName); } public AstType getVariableAstTypeOfName(String varName){ return this.variables.get(varName).type(); } public SymbolTable parent(){ return this.parent; } public AstNode astNodeInProgram(){ return this.astNodeInProgram; } public String GetVariableType(String varName){ if(this.hasVariableWithName(varName)){ AstType type = getVariableAstTypeOfName(varName); if (type instanceof RefType){ return ((RefType) type).id(); } } return null; } public boolean isMethodSymbolTable(){ return this.type.equals("method"); } public boolean isClassSymbolTable(){ return this.type.equals("class"); } }
package com.ittr.main; import java.io.IOException; import java.util.ArrayList; import java.util.List; import com.ittr.data.Invoice.Invoice; import com.ittr.data.Order.PurchaseOrder; import com.ittr.services.InvoiceFilterOData; import com.ittr.services.PurchaseOrderManager; public class Main { @SuppressWarnings("unused") public static void main(String[] args) throws IOException, Exception { InvoiceFilterOData invoiceFilter = new InvoiceFilterOData(); List<Invoice> invoiceList = new ArrayList<Invoice>(); invoiceList = invoiceFilter.invoiceFilterByOrderID(); List<PurchaseOrder> purchaseOrderList = new ArrayList<PurchaseOrder>(); PurchaseOrderManager purchaseOrderManager = new PurchaseOrderManager(); purchaseOrderList = purchaseOrderManager.setPurchaseOrder(); } }
package day50_Abstraction; public class WarmUpRequirements { /* * WarmUp: create an Animal abstract class data/attributes: gender, age, color, name create one constructor that can set the gender, name, color and age Actions: Speak(), Eat(), Sleep(), Drink(); create sub classes of the Animal and override those actions: dog: Speak() ==> woof Sleep() ==> 8 hours Eat() ==> KFC Drinks() ==> Milk Shake Cat: Speak() ==> meow Sleep() ==> 14 hours Eat() ==> m&m Drinks() ==> Hot chocolate cow: Speak() ==> moo Sleep() ==> 5 hours Eat() ==> grace Drinks() ==> Coffee with sugar create zoo class and store some of those animals' objects */ /* * abstrcation: concentrating on importance/essential things * without worrying about implemetations or details * * Abstract class:abstrcat keyword can only be applicable to class and methods * abstrcat class is aclass that we can not create object * it is a class that is meant to be extended * can not be final, or immutable * class' access modifiers can only be public or default * * Abstrcat method: that is meant to be override. * is a method without body, implementations. * can not be static, private and final * only the instance method can be override * hides the implementation details * * decleration of abstract method; * access-modifier abstrcat keyword return type name(parameter); * access modifier: public, default, protected * return type: void, primitives, non-primitives(object) * name: any name * parameter:primitives, non-primitives(object) * * overriding: same method name, same parameter, same return type, same method signatures * access modifier needs to be same or more visible * Must be override in sub class * @Override annitation must be applicable * * * */ }
/* * MIT License * * Copyright (c) 2018 Alen Turkovic * * 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.github.alturkovic.lock.redis.impl; import com.github.alturkovic.lock.Lock; import java.util.List; import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.script.RedisScript; @Data @Slf4j @AllArgsConstructor public class MultiRedisLock implements Lock { private final StringRedisTemplate stringRedisTemplate; private final RedisScript<Boolean> lockScript; private final RedisScript<Boolean> lockReleaseScript; private final Supplier<String> tokenSupplier; public MultiRedisLock(final StringRedisTemplate stringRedisTemplate, final RedisScript<Boolean> lockScript, final RedisScript<Boolean> lockReleaseScript) { this(stringRedisTemplate, lockScript, lockReleaseScript, () -> UUID.randomUUID().toString()); } @Override public String acquire(final List<String> keys, final String storeId, final long expiration) { final List<String> keysWithStoreIdPrefix = keys.stream().map(key -> storeId + ":" + key).collect(Collectors.toList()); final String token = tokenSupplier.get(); final Boolean locked = stringRedisTemplate.execute(lockScript, keysWithStoreIdPrefix, token, String.valueOf(expiration)); log.debug("Tried to acquire lock for keys '{}' in store '{}' with safety token '{}'. Locked: {}", keys, storeId, token, locked); return locked ? token : null; } @Override public boolean release(final List<String> keys, final String token, final String storeId) { final List<String> keysWithStoreIdPrefix = keys.stream().map(key -> storeId + ":" + key).collect(Collectors.toList()); final boolean released = stringRedisTemplate.execute(lockReleaseScript, keysWithStoreIdPrefix, token); if (released) { log.debug("Release script deleted the record for keys {} with token {} in store {}", keys, token, storeId); } else { log.error("Release script failed for keys {} with token {} in store {}", keys, token, storeId); } return released; } }
package com.example.testhub.Tools; import com.example.testhub.domain.MathQuestion; import com.example.testhub.service.MathService; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class TestTools { public static List<String> delimeter(String answers) { List<String> listOfAnswers = new ArrayList<>(); String[] subStr; String delimeter = ","; subStr = answers.split(delimeter); listOfAnswers.addAll(Arrays.asList(subStr)); return listOfAnswers; } // Intentional hardcode (MathService) public static int compareAnswers(List<String> listOfAnswers, MathService mathService) { int result = 0; List<MathQuestion> listOfMathQuestions = mathService.findAll(); for (int i = 0; i < listOfMathQuestions.size(); i++) { if (listOfAnswers.get(i).equals(listOfMathQuestions.get(i).getAnswer())) result++; } return result; } }
package com.tencent.mm.ar; import android.os.Looper; import com.tencent.mm.ab.b; import com.tencent.mm.ab.b.a; import com.tencent.mm.ab.e; import com.tencent.mm.ab.l; import com.tencent.mm.ab.n; import com.tencent.mm.g.a.lu; import com.tencent.mm.g.a.sg; import com.tencent.mm.k.c; import com.tencent.mm.kernel.g; import com.tencent.mm.network.q; import com.tencent.mm.platformtools.ab; import com.tencent.mm.platformtools.af; import com.tencent.mm.protocal.c.afy; import com.tencent.mm.protocal.c.afz; import com.tencent.mm.protocal.c.ayv; import com.tencent.mm.sdk.platformtools.bi; import com.tencent.mm.sdk.platformtools.x; import com.tencent.mm.storage.aa; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; public final class k extends l implements n, com.tencent.mm.network.k { private int bJE; private b diG; private e diJ; private boolean ecQ; private int flags; public k(boolean z) { this.ecQ = false; this.flags = -1; this.bJE = 26; this.ecQ = false; x.d("MicroMsg.NetSceneGetPackageList", "Init dkregcode:26"); x.d("MicroMsg.NetSceneGetPackageList", "isOnlyCheckInReqList: %b", new Object[]{Boolean.valueOf(z)}); if (z) { this.flags = 1; } } public k(int i) { this.ecQ = false; this.flags = -1; this.bJE = i; this.ecQ = false; x.d("MicroMsg.NetSceneGetPackageList", "Init dkregcode:" + i); } public final int a(com.tencent.mm.network.e eVar, e eVar2) { this.diJ = eVar2; x.d("MicroMsg.NetSceneGetPackageList", "DoScene dkregcode :" + this.bJE); a aVar = new a(); aVar.dIG = new afy(); aVar.dIH = new afz(); aVar.uri = "/cgi-bin/micromsg-bin/getpackagelist"; aVar.dIF = 159; aVar.dII = 51; aVar.dIJ = 1000000051; this.diG = aVar.KT(); afy afy = (afy) this.diG.dID.dIL; LinkedList linkedList = new LinkedList(); if (!g.Eg().Dx()) { return -1; } m[] ik = r.Qp().ik(this.bJE); if (ik != null && ik.length > 0) { for (int i = 0; i < ik.length; i++) { ayv ayv = new ayv(); ayv.jTt = ik[i].id; if (af.exc && this.bJE == 7) { x.d("MicroMsg.NetSceneGetPackageList", "isShakeGetConfigList"); ayv.hcD = 0; } else { ayv.hcD = ik[i].version; } x.d("MicroMsg.NetSceneGetPackageList", "package, id:%d, ver:%d", new Object[]{Integer.valueOf(ayv.jTt), Integer.valueOf(ayv.hcD)}); linkedList.add(ayv); } } afy.hbG = linkedList; afy.hbF = linkedList.size(); afy.hcE = this.bJE; if (this.flags != -1) { afy.rbZ = this.flags; } return a(eVar, this.diG, this); } protected final int a(q qVar) { return l.b.dJm; } protected final int Cc() { return 20; } protected final void a(l.a aVar) { } public final boolean KX() { return true; } private m a(ayv ayv) { m mVar = new m(); mVar.id = ayv.jTt; mVar.version = ayv.hcD; mVar.name = ayv.jPe; mVar.size = ayv.hcy; mVar.ecV = ayv.rwQ; mVar.status = 5; mVar.bPh = this.bJE; return mVar; } public final void a(int i, int i2, int i3, String str, q qVar, byte[] bArr) { x.d("MicroMsg.NetSceneGetPackageList", "onGYNetEnd, netid:%d, errType:%d, errCode:%d, pkgType:%d, errMsg:%s", new Object[]{Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(this.bJE), str}); if (i2 == 0 || i3 == 0) { afz afz = (afz) ((b) qVar).dIE.dIL; if (afz.hcE != this.bJE) { x.e("MicroMsg.NetSceneGetPackageList", "packageType is not consistent, respType = %d", new Object[]{Integer.valueOf(afz.hcE)}); this.diJ.a(3, -1, "", this); return; } LinkedList linkedList = afz.hbG; x.v("MicroMsg.NetSceneGetPackageList", "summer list size:" + (linkedList == null ? 0 : linkedList.size()) + " packageType: " + this.bJE + " resp.Type: " + afz.hcE); ayv ayv; m bi; m a; m a2; if (this.bJE == 2) { h(linkedList); } else if (this.bJE == 1) { g(linkedList); } else if (this.bJE == 4) { i(linkedList); } else if (this.bJE == 6) { x.i("MicroMsg.NetSceneGetPackageList", "change new egg."); } else if (this.bJE == 7) { j(linkedList); } else if (this.bJE == 8) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty regioncode pkg list"); } else { x.d("MicroMsg.NetSceneGetPackageList", "pkgList size " + linkedList.size()); ayv = (ayv) linkedList.get(0); bi = r.Qp().bi(ayv.jTt, this.bJE); a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } x.d("MicroMsg.NetSceneGetPackageList", ayv.jPe + " - " + ayv.jTt + " - " + ayv.rwQ + " - " + ayv.hcy); } } else if (this.bJE == 9) { f(linkedList); } else if (this.bJE == 10) { if (linkedList == null || linkedList.size() <= 0) { x.e("MicroMsg.NetSceneGetPackageList", "empty mass send top config package"); } else { x.d("MicroMsg.NetSceneGetPackageList", "pkgList size " + linkedList.size()); ayv = (ayv) linkedList.get(0); bi = r.Qp().bi(ayv.jTt, this.bJE); a2 = a(ayv); a2.bWA = -1; if (bi == null) { r.Qp().a(a2); } else { r.Qp().b(a2); } } } else if (this.bJE != 11) { if (this.bJE == 12) { l(linkedList); } else if (this.bJE == 5) { m(linkedList); } else if (this.bJE == 20) { k(linkedList); } else if (this.bJE == 17) { if (linkedList == null || linkedList.size() == 0) { x.d("MicroMsg.NetSceneGetPackageList", "poi type is null"); } else { ayv = (ayv) linkedList.get(0); x.d("MicroMsg.NetSceneGetPackageList", ayv.jPe + " - " + ayv.jTt + " - " + ayv.rwQ + " - " + ayv.hcy); bi = r.Qp().bi(ayv.jTt, this.bJE); a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } lu luVar = new lu(); try { luVar.bWi.content = ab.a(ayv.rdp); if (luVar.bWi.content != null) { com.tencent.mm.sdk.b.a.sFg.a(luVar, Looper.getMainLooper()); } } catch (Exception e) { x.e("MicroMsg.NetSceneGetPackageList", e.getMessage()); } } } else if (this.bJE != 18) { if (this.bJE == 19) { Q(linkedList); } else if (this.bJE == 21) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "summer trace config empty scene list"); } else { ayv = (ayv) linkedList.get(0); x.d("MicroMsg.NetSceneGetPackageList", "summer getpackage pkg: " + ayv + "|id = " + ayv.jTt + "|Name = " + ayv.jPe + "|PackName = " + ayv.rwQ + "|Size = " + ayv.hcy + "|Version = " + ayv.hcD); bi = r.Qp().bi(ayv.jTt, this.bJE); a2 = a(ayv); a2.bWA = -1; if (bi == null) { r.Qp().a(a2); } else if (bi.version < a2.version) { r.Qp().b(a2); } else { x.d("MicroMsg.NetSceneGetPackageList", "summer old version [%d] new version[%d], not need update", new Object[]{Integer.valueOf(bi.version), Integer.valueOf(a2.version)}); } } } else if (23 == this.bJE) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "permission tips config is empty"); } else { ayv = (ayv) linkedList.get(0); x.d("MicroMsg.NetSceneGetPackageList", "permission getpackage pkg: " + ayv + "|id = " + ayv.jTt + "|Name = " + ayv.jPe + "|PackName = " + ayv.rwQ + "|Size = " + ayv.hcy + "|Version = " + ayv.hcD); bi = r.Qp().bi(ayv.jTt, this.bJE); a2 = a(ayv); a2.bWA = -1; if (bi == null) { r.Qp().a(a2); } else if (bi.version < a2.version) { r.Qp().b(a2); } } } else if (this.bJE == 26) { R(linkedList); } else if (this.bJE == 36) { S(linkedList); } else if (this.bJE == 37) { n(linkedList); } } } sg sgVar = new sg(); sgVar.cdb.cdc = linkedList; sgVar.cdb.bJE = this.bJE; com.tencent.mm.sdk.b.a.sFg.m(sgVar); if (afz.rlm <= 0) { this.diJ.a(i2, i3, str, this); return; } else if (a(this.dIX, this.diJ) == -1) { this.diJ.a(3, -1, "doScene failed", this); return; } else { return; } } this.diJ.a(i2, i3, str, this); } protected final boolean b(l lVar) { if ((lVar instanceof k) && this.bJE == ((k) lVar).bJE) { return false; } return true; } private void f(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty upload speex config list"); return; } r.Qp(); String Qm = n.Qm(); for (int i = 0; i < linkedList.size(); i++) { ayv ayv = (ayv) linkedList.get(i); m bi = r.Qp().bi(ayv.jTt, this.bJE); if (bi == null || bi.version != ayv.hcD) { com.tencent.mm.a.e.deleteFile(Qm + r.Qp().bk(ayv.jTt, this.bJE)); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } g.Eh().dpP.a(new j(a.id, 9), 0); } if (ab.a(ayv.rdp) != null) { x.v("MicroMsg.NetSceneGetPackageList", "xml:" + new String(ab.a(ayv.rdp))); } if (ab.a(ayv.sbD) != null) { x.v("MicroMsg.NetSceneGetPackageList", "xml2:" + new String(ab.a(ayv.sbD))); } x.v("MicroMsg.NetSceneGetPackageList", "xml3:" + ayv.toString()); x.v("MicroMsg.NetSceneGetPackageList", "xml4:" + ayv.jPe); x.v("MicroMsg.NetSceneGetPackageList", "xml5:" + ayv.rwQ); } } private void g(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty background pkg list"); return; } r.Qp(); String Qm = n.Qm(); int i = 0; while (true) { int i2 = i; if (i2 < linkedList.size()) { ayv ayv = (ayv) linkedList.get(i2); m bi = r.Qp().bi(ayv.jTt, this.bJE); if (bi == null || bi.version != ayv.hcD) { com.tencent.mm.a.e.deleteFile(Qm + r.Qp().bk(ayv.jTt, this.bJE)); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } } byte[] a2 = ab.a(ayv.rdp); if (a2 != null && a2.length > 0) { r.Qp(); String bj = n.bj(ayv.jTt, this.bJE); com.tencent.mm.a.e.deleteFile(Qm + bj); com.tencent.mm.a.e.b(Qm, bj, a2); } i = i2 + 1; } else { return; } } } @Deprecated private void h(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty emoji pkg list"); return; } int i = 0; while (true) { int i2 = i; if (i2 < linkedList.size()) { ayv ayv = (ayv) linkedList.get(i2); m bi = r.Qp().bi(ayv.jTt, this.bJE); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } byte[] a2 = ab.a(ayv.rdp); if (a2 != null && a2.length > 0) { List arrayList = new ArrayList(); arrayList.add(new String(a2)); arrayList.size(); } i = i2 + 1; } else { return; } } } private void i(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty emoji pkg list"); return; } x.d("MicroMsg.NetSceneGetPackageList", "pkgList size " + linkedList.size()); r.Qp(); String Qm = n.Qm(); int i = 0; while (true) { int i2 = i; if (i2 < linkedList.size()) { ayv ayv = (ayv) linkedList.get(i2); m bi = r.Qp().bi(ayv.jTt, this.bJE); byte[] a = ab.a(ayv.rdp); if (ayv.rdp == null) { x.e("MicroMsg.NetSceneGetPackageList", "error give me a null thumb it should be xml"); } else { if (bi == null || bi.version != ayv.hcD) { String str = new String(a); String str2 = "zh_CN"; if (str.indexOf(str2) < 0) { str2 = "en"; if (str.indexOf(str2) < 0) { str2 = "zh_TW"; if (str.indexOf(str2) < 0) { str2 = "en"; } } } str = str2 + "_ARTIST.mm"; com.tencent.mm.a.e.deleteFile(Qm + str); com.tencent.mm.a.e.deleteFile(Qm + str2 + "_ARTISTF.mm"); com.tencent.mm.a.e.b(Qm, str, a); } m a2 = a(ayv); a2.bWA = -1; if (bi == null) { r.Qp().a(a2); } else { r.Qp().b(a2); } x.d("MicroMsg.NetSceneGetPackageList", ayv.jPe + " - " + ayv.jTt + " - " + ayv.rwQ + " - " + ayv.hcy); } i = i2 + 1; } else { return; } } } private void j(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty config list"); return; } x.d("MicroMsg.NetSceneGetPackageList", "updateConfigList pkgList size " + linkedList.size()); for (int i = 0; i < linkedList.size(); i++) { ayv ayv = (ayv) linkedList.get(i); m bi = r.Qp().bi(ayv.jTt, this.bJE); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } x.d("MicroMsg.NetSceneGetPackageList", ayv.jPe + " - " + ayv.jTt + " - " + ayv.rwQ + " - " + ayv.hcy); byte[] a2 = ab.a(ayv.rdp); x.d("MicroMsg.NetSceneGetPackageList", "ConfigList xml : " + new String(a2)); c AU = ((com.tencent.mm.plugin.zero.b.a) g.l(com.tencent.mm.plugin.zero.b.a.class)).AU(); int i2 = ayv.jTt; File file = new File(c.dgQ); if (!file.exists()) { file.mkdir(); } try { file = new File(c.fU(i2)); if (!file.exists()) { file.createNewFile(); } com.tencent.mm.a.e.b(c.fU(i2), a2, a2.length); AU.p(i2, new String(a2)); } catch (Throwable e) { x.e("MicroMsg.ConfigListDecoder", "exception:%s", new Object[]{bi.i(e)}); } } } private void k(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty regioncode pkg list"); return; } x.d("MicroMsg.NetSceneGetPackageList", "pkgList size " + linkedList.size()); Iterator it = linkedList.iterator(); while (it.hasNext()) { ayv ayv = (ayv) it.next(); m bi = r.Qp().bi(ayv.jTt, this.bJE); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } x.d("MicroMsg.NetSceneGetPackageList", ayv.jPe + " - " + ayv.jTt + " - " + ayv.rwQ + " - " + ayv.hcy); } } private void l(LinkedList<ayv> linkedList) { if (linkedList == null || linkedList.size() <= 0) { x.e("MicroMsg.NetSceneGetPackageList", "empty address pkg list"); return; } x.i("MicroMsg.NetSceneGetPackageList", "updateRcptAddress pkgList size " + linkedList.size()); for (int i = 0; i < linkedList.size(); i++) { ayv ayv = (ayv) linkedList.get(i); m bi = r.Qp().bi(ayv.jTt, this.bJE); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } g.Eh().dpP.a(new j(a.id, 12), 0); } } private void Q(List<ayv> list) { if (list == null || list.size() <= 0) { x.d("MicroMsg.NetSceneGetPackageList", "[oneliang]empty update expose scene list"); return; } r.Qp(); String Qm = n.Qm(); for (int i = 0; i < list.size(); i++) { ayv ayv = (ayv) list.get(i); m bi = r.Qp().bi(ayv.jTt, this.bJE); if (bi == null || bi.version != ayv.hcD) { com.tencent.mm.a.e.deleteFile(Qm + r.Qp().bk(ayv.jTt, this.bJE)); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } g.Eh().dpP.a(new j(a.id, 19), 0); } x.d("MicroMsg.NetSceneGetPackageList", "[oneliang]name:%s,packName:%s", new Object[]{ayv.jPe, ayv.rwQ}); } } private void R(List<ayv> list) { if (list == null || list.size() == 0) { x.d("MicroMsg.NetSceneGetPackageList", "updateIPCallCountryCodeConfig, package list is empty"); return; } x.d("MicroMsg.NetSceneGetPackageList", "updateIPCallCountryCodeConfig, pkgList.size: %d", new Object[]{Integer.valueOf(list.size())}); int intValue = ((Integer) g.Ei().DT().get(aa.a.sQP, Integer.valueOf(-1))).intValue(); x.d("MicroMsg.NetSceneGetPackageList", "configPkgId: %d", new Object[]{Integer.valueOf(intValue)}); if (intValue != -1) { m bi = r.Qp().bi(intValue, this.bJE); for (ayv a : list) { m a2 = a(a); x.d("MicroMsg.NetSceneGetPackageList", "newInfo.id: %d, version: %d", new Object[]{Integer.valueOf(a2.id), Integer.valueOf(a2.version)}); if (bi != null && a2.id == intValue) { x.d("MicroMsg.NetSceneGetPackageList", "find match old pkg, update one"); r.Qp().b(a2); return; } else if (bi == null && a2.id == intValue) { x.d("MicroMsg.NetSceneGetPackageList", "insert new pkg"); r.Qp().a(a2); return; } } } } private void S(List<ayv> list) { if (list == null || list.size() == 0) { x.d("MicroMsg.NetSceneGetPackageList", "update sense where location but package list is empty."); return; } x.i("MicroMsg.NetSceneGetPackageList", "start update sense where location. package list size " + list.size()); for (ayv ayv : list) { m bi = r.Qp().bi(ayv.jTt, this.bJE); if (bi == null || bi.version != ayv.hcD) { m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } g.Eh().dpP.a(new j(a.id, 36), 0); } } } private void m(LinkedList<ayv> linkedList) { x.d("MicroMsg.NetSceneGetPackageList", "updateLangPkg"); if (linkedList == null || linkedList.size() == 0) { x.d("MicroMsg.NetSceneGetPackageList", "empty langage package list"); return; } Iterator it = linkedList.iterator(); while (it.hasNext()) { ayv ayv = (ayv) it.next(); x.d("MicroMsg.NetSceneGetPackageList", "pkg.toString %s", new Object[]{ayv.toString()}); m bi = r.Qp().bi(ayv.jTt, this.bJE); m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } } } private void n(LinkedList<ayv> linkedList) { x.d("MicroMsg.NetSceneGetPackageList", "updateAppleEmojiPackage"); if (linkedList == null || linkedList.size() == 0) { x.d("MicroMsg.NetSceneGetPackageList", "update apple emoji but package list is empty."); return; } x.i("MicroMsg.NetSceneGetPackageList", "start update apple emoji. package list size " + linkedList.size()); Iterator it = linkedList.iterator(); while (it.hasNext()) { ayv ayv = (ayv) it.next(); m bi = r.Qp().bi(ayv.jTt, this.bJE); if (bi == null || bi.version != ayv.hcD) { m a = a(ayv); a.bWA = -1; if (bi == null) { r.Qp().a(a); } else { r.Qp().b(a); } g.Eh().dpP.a(new j(a.id, 37), 0); } } } public final int getType() { return 159; } public final int Lf() { return this.bJE; } }
package cn.shadow.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import cn.shadow.dto.SelectRequest; import cn.shadow.dto.SelectResponse; import cn.shadow.entity.User; import cn.shadow.user.IUserService; import cn.shadow.util.PageData; @Controller @RequestMapping(value = "/test") public class UserController { @Autowired private IUserService userService; @ResponseBody @RequestMapping("/aas") public User selectUser(HttpServletRequest request) { PageData pd=new PageData(request); SelectRequest request2=new SelectRequest(); request2.setId("1"); SelectResponse response=userService.select(request2); User user=response.getUser(); return user; } }
class Book { //title, author, publish(출판사), price //생성자 //sell(), buy() 4번 방법으로 //setAuhor() //setTitle() //getAuthor() //getTitle() public static void main(String ar[]) { Book b1=new Book("A","a","aa",100); Book b2=new Book("B","bb",200); Book b3=new Book("C",300); Book b4=new Book(); b4.setAuthor() b4.setTitile() b4.getAuthor() b4.getTitle() } }
package chatbox; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; /** * * @author EMerckx */ public class Client { // input and output private Socket socket; private BufferedReader in; private PrintWriter out; // GUI JFrame jFrame; JTextField jTextField; JTextArea jTextArea; /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { Client client = new Client(); client.jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); client.jFrame.setVisible(true); client.run(); } public Client() throws IOException { // init socket, reader and printer // construct GUI jFrame = new JFrame("ChatBox"); jTextField = new JTextField(40); jTextArea = new JTextArea(15, 40); // layout GUI jTextField.setEditable(false); jTextArea.setEditable(false); jFrame.add(jTextField, "North"); jFrame.add(new JScrollPane(jTextArea), "Center"); jFrame.pack(); // set action listener on the textfield jTextField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // get the message from the TextField String message = jTextField.getText(); jTextField.setText(""); out.println(message); } }); } private void run() throws IOException { socket = new Socket("localhost", 8080); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintWriter(socket.getOutputStream(), true); while (true) { // read the line send by the server String line = in.readLine(); System.out.println(line); if (line.startsWith("SUBMITNAME")) { // get the name and submit it to the server String name = getName(); out.println(name); } else if (line.startsWith("NAMEACCEPTED")) { // enable TextField to chat jTextField.setEditable(true); } else if (line.startsWith("MESSAGE")) { // add message to TextArea jTextArea.append(line.substring(8) + "\n"); } } } private String getName() { String name = JOptionPane.showInputDialog(jFrame, "Choose your name", "Name selection", JOptionPane.PLAIN_MESSAGE); return name; } }
package com.example.demo; import java.util.ArrayList; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SpringBootCrmApplicationTests { @Test public void contextLoads() { ArrayList al = new ArrayList(); al.add(1); al.add(2); al.add(3); al.add(4); for (int i = 0; i < al.size(); i++) { al.add(1); } } }
package com.example.parcial_v2.Data; public class Music { public String title; public String autor; public String duration; public Music(String title, String autor, String duration){ this.autor = autor; this.title = title; this.duration = duration; } }
/** * This class contains the start point of the program. * It also contains a static method called from main to get the input string and return the desired result. */ public class RoverControl { public static void main(String[] args) { String nasaInstructions = "5 5 1 2 N LMLMLMLMM 3 3 E MMRMMRMRRM"; String output = roverControlOnMars(nasaInstructions); System.out.println(output); } /** * This is a static method that doesn't need an object to be called. * The input string inserted is split into a string array by the space between the characters. * * @param nasaInstructions The input string inserted by NASA that specified the plateau size and the rover/s * instructions. * @return It returns the output string that contains the final position of the rover after exploration. */ public static String roverControlOnMars(String nasaInstructions) { String[] inputs = nasaInstructions.split(" "); /** * The first two strings from input stand for the upper-right corner of the plateau. * It checks if the values inserted are integers, otherwise it throws BadCoordinatesException. */ Position plateauPosition; try { plateauPosition = new Position(Integer.parseInt(inputs[0]), Integer.parseInt(inputs[1])); } catch (NumberFormatException e) { throw new BadCoordinatesException("Expected integer values for the plateau's position. Retype position " + "values from input!"); } Plateau plateauMars = new Plateau(plateauPosition); String output = ""; int i = 2; while (i < inputs.length) { /** * Creates the roverPosition by assuring that the position values are positive integers. * It also checks if the input for the rover/s contains the position, the cardinal point and the * instructions. */ Position roverPosition; try { try { roverPosition = new Position(Integer.parseInt(inputs[i]), Integer.parseInt(inputs[i + 1])); } catch (NumberFormatException e) { throw new BadCoordinatesException("Expected integer values for the rover's position. Retype " + "position values from input!"); } Rover rover = new Rover(roverPosition, Coordinates.valueOf(inputs[i + 2]), plateauMars); rover.exploringMars(inputs[i + 3], plateauMars); i = i + 4; output += rover.toString(); } catch (ArrayIndexOutOfBoundsException e) { throw new BadInstructionException("Missing instructions for rover. Please tell the rover how to " + "explore the plateau"); } } return output.trim(); } }
package nl.jtosti.hermes.image; import nl.jtosti.hermes.config.ImagePathConfiguration; import nl.jtosti.hermes.image.exception.FileStoreException; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import org.springframework.stereotype.Service; import org.springframework.util.FileSystemUtils; import org.springframework.web.multipart.MultipartFile; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.MalformedURLException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Date; @Service public class StorageService implements StorageServiceInterface { private Path rootLocation; private Path cacheLocation; public StorageService(ImagePathConfiguration imagePathConfiguration) { this.rootLocation = Paths.get(imagePathConfiguration.getPath()); this.cacheLocation = Paths.get(imagePathConfiguration.getCachePath()); } @Override public String store(MultipartFile file) { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); String fileName = Long.toString(new Date().getTime()); Path path = this.cacheLocation.resolve(fileName + ".png"); BufferedImage image = ImageIO.read(file.getInputStream()); ImageIO.write(image, "png", stream); Files.copy(new ByteArrayInputStream(stream.toByteArray()), path); return fileName + ".png"; } catch (Exception e) { throw new FileStoreException("store"); } } @Override public Resource load(String filename) { try { Path file = rootLocation.resolve(filename); Resource resource = new UrlResource(file.toUri()); if (resource.exists() && resource.isReadable()) { return resource; } else { throw new FileStoreException("load.!exists"); } } catch (MalformedURLException e) { throw new FileStoreException("MalformedURL"); } } @Override public void deleteAll() { FileSystemUtils.deleteRecursively(rootLocation.toFile()); } @Override public void init() { if (Files.notExists(rootLocation)) { try { Files.createDirectory(rootLocation); } catch (IOException e) { throw new FileStoreException("init"); } } if (Files.notExists(cacheLocation)) { try { Files.createDirectory(cacheLocation); } catch (IOException e) { throw new FileStoreException("Could not initialize cache directory!"); } } } @Override public String moveToPersistentLocation(String fileName, Long imageId) { try { Path cacheImage = this.cacheLocation.resolve(fileName); if (Files.exists(cacheImage)) { Path targetImage = this.rootLocation.resolve(imageId + ".png"); if (Files.exists(targetImage)) { throw new FileStoreException("Target image already exists"); } Files.move(cacheImage, targetImage); return targetImage.getFileName().toString(); } else { throw new FileStoreException("Chosen image does not exist"); } } catch (IOException e) { throw new FileStoreException("Could not move image to persistent location"); } } @Override public boolean cacheFileExist(String fileName) { return Files.exists(this.cacheLocation.resolve(fileName)); } @Override public void deleteCache() { FileSystemUtils.deleteRecursively(cacheLocation.toFile()); } }
/** * Write a description of class Part2 here. * * @author (your name) * @version (a version number or a date) */ public class Part2 { public String findSimpleGene(String dna, String startCodon, String stopCodon) { // put your code here String gene = ""; int startIndex= dna.indexOf(startCodon); int stopIndex = dna.indexOf(stopCodon); if(startIndex == -1 || stopIndex == -1) { return gene; } else if((stopIndex - startIndex) % 3 == 0){ gene = dna.substring(startIndex, stopIndex + 3); } if(Character.isUpperCase(dna.charAt(0))) return gene.toLowerCase(); else return gene.toUpperCase(); } public void testSimpleGene() { String testcase1 = "AACTGTAA"; String testcase2 = "AACATG"; String testcase3 = "AACATTCCG"; String testcase4 = "aacttatgcctccttaa"; String testcase5 = "AACATGCTTAA"; String startCodon = "ATG"; String stopCodon = "TAA"; System.out.println("without ATG for " + testcase1 + " = " + findSimpleGene(testcase1, startCodon, stopCodon)); System.out.println("without TAA for " + testcase2 + " = " + findSimpleGene(testcase2, startCodon, stopCodon)); System.out.println("without ATG and TAA for " + testcase3 + " = " + findSimpleGene(testcase3, startCodon, stopCodon)); System.out.println("with multiple of 3 between ATG and TAA for " + testcase4 + " = " + findSimpleGene(testcase4, "atg", "taa")); System.out.println("without multiple of 3 between ATG and TAA for " + testcase5+ " = " + findSimpleGene(testcase5, startCodon, stopCodon)); } }
package com.example.demo.domain.exception; public class EntidadeNaoEncontradoException extends NeogocioException { public EntidadeNaoEncontradoException(String message) { super(message); // TODO Auto-generated constructor stub } }
package ngordnet; import java.util.TreeSet; import java.util.TreeMap; import java.util.Collection; import java.util.NavigableSet; import java.util.ArrayList; public class TimeSeries<T extends Number> extends TreeMap<Integer, T> { /** Constructs a new empty TimeSeries. */ public TimeSeries() {} /** Returns the years in which this time series is valid. Doesn't really * need to be a NavigableSet. This is a private method and you don't have * to implement it if you don't want to. */ private NavigableSet<Integer> validYears(int startYear, int endYear) { TreeSet<Integer> res = new TreeSet<Integer>(); for(int y = startYear; y <= endYear; ++y) { if(containsKey(y)) res.add(y); } return res; } /** Creates a copy of TS, but only between STARTYEAR and ENDYEAR. * inclusive of both end points. */ public TimeSeries(TimeSeries<T> ts, int startYear, int endYear) { for(int y = startYear; y <= endYear; ++y) { if(containsKey(y)) if(ts.containsKey(y)) put(y, ts.get(y)); } } /** Creates a copy of TS. */ public TimeSeries(TimeSeries<T> ts) { for(Integer i: ts.keySet()) { put(i, ts.get(i)); } } /** Returns the quotient of this time series divided by the relevant value in ts. * If ts is missing a key in this time series, return an IllegalArgumentException. */ public TimeSeries<Double> dividedBy(TimeSeries<? extends Number> ts) { TimeSeries<Double> res = new TimeSeries<Double>(); for(Integer i: keySet()) { if(ts.containsKey(i)) { res.put(i, get(i).doubleValue()/ts.get(i).doubleValue()); } else { throw new IllegalArgumentException(); } } return res; } /** Returns the sum of this time series with the given ts. The result is a * a Double time series (for simplicity). */ public TimeSeries<Double> plus(TimeSeries<? extends Number> ts) { TimeSeries<Double> res = new TimeSeries<Double>(); for(Integer i: ts.keySet()) { if(containsKey(i)) { res.put(i, get(i).doubleValue() + ts.get(i).doubleValue()); } else { res.put(i, ts.get(i).doubleValue()); } } return res; } /** Returns all years for this time series (in any order). */ public Collection<Number> years() { ArrayList<Number> res = new ArrayList<Number>(); for(Integer i: keySet()) res.add(i); return res; } /** Returns all data for this time series. * Must be in the same order as years(). */ public Collection<Number> data() { ArrayList<Number> res = new ArrayList<Number>(); for(Number i: years()) res.add(get(i)); return res; } }
package com.lingnet.vocs.action.workorder; import java.util.HashMap; import com.lingnet.common.action.BaseAction; public class MaterielOutlayAction extends BaseAction { private static final long serialVersionUID = -8646430481288770180L; private HashMap<String, String> materiel; public String list() { return LIST; } public String getListData() { String json = ""; json += "[{'name':'用料A','code':'YL001','num':'10kg','numprice':'10 RMB','price':'100 RMB','mc':'类别A'}" + " ,{'name':'用料B','code':'YL002','num':'10kg','numprice':'10 RMB','price':'100 RMB','mc':'类别B'}" + "]"; return ajax(Status.success, json); } public String add() { return ADD; } public String remove() { return ajax(Status.success, "success"); } public String edit() { materiel = new HashMap<String, String>(); materiel.put("name", "用料A"); materiel.put("code", "YL001"); materiel.put("num", "10kg"); materiel.put("numprice", "10"); materiel.put("price", "100"); materiel.put("mc", "类别A"); return ADD; } public String look() { materiel = new HashMap<String, String>(); materiel.put("name", "用料A"); materiel.put("code", "YL001"); materiel.put("num", "10kg"); materiel.put("numprice", "10"); materiel.put("price", "100"); materiel.put("mc", "类别A"); return ADD; } /******************************************* get set ********************************************/ public HashMap<String, String> getMateriel() { return materiel; } public void setMateriel(HashMap<String, String> materiel) { this.materiel = materiel; } }
//package falconrobotics.scoutingprogram; // ///** // * Created by Rodrigo on 3/11/2016. // */ //import android.bluetooth.*; //import android.util.Log; // // // // //import java.io.IOException; //import java.io.ObjectInputStream; //import java.io.ObjectOutputStream; //import java.util.UUID; // // //public class ServerThread extends Thread { // public static String TAG = ServerThread.class.getSimpleName(); // private final BluetoothAdapter mBluetoothAdapter; // public boolean isOpne = true; // // private BluetoothServerSocket serverSocket; // // public ServerThread() // { // serverSocket = null; // mBluetoothAdapter = BluetoothUtil.getBluetoothAdapter(); // } // // @Override // public void run() // { // Log.d(TAG) // } // //}
package com.filiereticsa.arc.augmentepf.localization; import java.util.ArrayList; /** * Created by anthony on 09/05/2017. */ public interface BeaconDetectorInterface { void rangedBeacons(ArrayList<GABeacon> beacons); }
package com.zznode.opentnms.isearch.otnRouteService.db.mapper; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.beans.BeanUtils; import org.springframework.cglib.beans.BeanCopier; import org.springframework.jdbc.core.RowMapper; import com.zznode.opentnms.isearch.otnRouteService.db.po.DbWdmSncRoute; import com.zznode.opentnms.isearch.otnRouteService.db.po.WdmSncRoute; public class WdmSncRouteMapper implements RowMapper<WdmSncRoute> { public WdmSncRoute mapRow(ResultSet resultset, int arg1) throws SQLException { DbWdmSncRoute dbwdmSncRoute = new DbWdmSncRouteMapper().mapRow(resultset, arg1); WdmSncRoute wdmSncRoute = new WdmSncRoute(); //BeanCopier copier = BeanCopier.create(DbWdmSncRoute.class, WdmSncRoute.class, false); //copier.copy(dbwdmSncRoute, wdmSncRoute, null); BeanUtils.copyProperties(dbwdmSncRoute, wdmSncRoute); wdmSncRoute.setAcardmodel( resultset.getString( "acardmodel")); wdmSncRoute.setZcardmodel( resultset.getString( "zcardmodel")); wdmSncRoute.setAendjuzhan( resultset.getString("ajuzhan") ); wdmSncRoute.setZendjuzhan( resultset.getString("zjuzhan") ); return wdmSncRoute ; } }
package com.company.function; public class loopFunctions { public int[] whileFunc(int val, int fact) { int[] result = new int[2]; result[0] = val; result[1] = fact; while (val > 1) { fact = fact * val; val--; System.out.println("inside while loop:" + fact); } System.out.print("outside while loop: " + fact); return result; } public int[] doWhileFunc(int iVal) { int[] result = new int[1]; result[0]=iVal; do { iVal = iVal * 2; System.out.println("inside do While loop:"+iVal); } while (iVal < 25); System.out.print("outside do While loop:"+iVal); return result; } public int arraysFunction() { float[] vals = new float[3]; vals[0] = 10.0f; vals[1] = 20.0f; vals[2] = 15.0f; float sum = 0.0f; for(int index = 0 ; index < vals.length;index++) { sum = sum + vals[index]; System.out.println(sum); } return (int) sum; } }
package com.example.meditracker; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; public class customAdapter_times extends RecyclerView.Adapter<customAdapter_times.customMyViewHolder> { private static Context context; private ArrayList medicine_namesc,time_listc,date_listc; private Button cancel; public customAdapter_times(Context context,ArrayList medicine_names,ArrayList time_list,ArrayList date_list){ this.context=context; this.medicine_namesc=medicine_names; this.time_listc=time_list; this.date_listc=date_list; } @NonNull @Override public customAdapter_times.customMyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { LayoutInflater inflater=LayoutInflater.from(context); View view=inflater.inflate(R.layout.rows_design_time,parent,false); ///////this line connects the row_design with the custom Adapter file.. return new customAdapter_times.customMyViewHolder(view); ///////this line connects the row_design with the custom Adapter file.. } @Override public void onBindViewHolder(@NonNull customAdapter_times.customMyViewHolder holder, int position) { holder.m.setText(String.valueOf(medicine_namesc.get(position))); ///// this will be the IDS OF THE ITEMS IN row_design.xml holder.t.setText(String.valueOf(time_listc.get(position))); //////////one important THING WHICH WE HAVE MISSED OUT IS THE SETTING UP OF DATE NOTIFICATION ADDED IN holder.d.setText((String.valueOf(date_listc.get(position)))); } ////////////////////////////////////////////////////////////DATABASE @Override public int getItemCount() { return medicine_namesc.size(); } public class customMyViewHolder extends RecyclerView.ViewHolder { TextView m,d,t; public customMyViewHolder(@NonNull View itemView) { super(itemView); d = itemView.findViewById(R.id.date_notif_added); //// we can do our visual operations on this.. m = itemView.findViewById(R.id.medname_notif_added); t = itemView.findViewById(R.id.time_notif_added); cancel=itemView.findViewById(R.id.buttonc); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final int pos=getAdapterPosition(); cancelAlarms(pos+1); } }); } private void cancelAlarms(int position) { notificationsdatabase db=new notificationsdatabase(context); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); //////first 4 lines are useful for cancelling the alarm Intent intent = new Intent(context, AlertReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, position, intent, 0); /////CANCELLING THE REQUEST IS VERY EASY alarmManager.cancel(pendingIntent); String s = "All Alarms of this medicine are cancelled"; t.setText("All Alarms of this medicine are cancelled"); //////this information has to go to the database too that all alarms are cancelled.. db.updatealarmtext(position,s); //////this is completely wrong ..we are supposed to be sending the actual position where cancel is pressed.. //////it shouldnot be db.countrows()... } } }
/* * This software is licensed under the MIT License * https://github.com/GStefanowich/MC-Server-Protection * * Copyright (c) 2019 Gregory Stefanowich * * 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 net.theelm.sewingmachine.base.objects; import net.minecraft.registry.Registries; import net.theelm.sewingmachine.interfaces.ShopSignData; import net.theelm.sewingmachine.utilities.InventoryUtils; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Recipe; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import org.jetbrains.annotations.NotNull; import java.util.Objects; /** * Created on Apr 25 2022 at 6:35 PM. * By greg in SewingMachineMod */ public final class ShopCraftAction { private final @NotNull Identifier input; private final int inputCount; private final int remainder; private final @NotNull ShopSignData shop; private final @NotNull BlockPos shopPos; private final @NotNull Inventory container; public ShopCraftAction(@NotNull Recipe<?> recipe, @NotNull ShopSignData shop, @NotNull BlockPos signPos, @NotNull Inventory inventory) { this.shop = shop; this.shopPos = signPos; this.container = inventory; // Get the ITEM that is used for the craft Ingredient ingredient = recipe.getIngredients() .get(0); ItemStack stack = ingredient.getMatchingStacks()[0]; this.input = Registries.ITEM.getId(stack.getItem()); int needs = 0; int outputs = 0; while (outputs < shop.getShopItemCount()) { needs += stack.getCount(); outputs += recipe.getOutput(null) .getCount(); } this.inputCount = needs; this.remainder = outputs - shop.getShopItemCount(); } private boolean itemMatchesInput(ItemStack stack) { return stack != null && Objects.equals(this.input, Registries.ITEM.getId(stack.getItem())); } public boolean craft(@NotNull ServerPlayerEntity player) { if (!InventoryUtils.playerToChest(player, this.shopPos, player.getInventory(), this.container, this::itemMatchesInput, this.inputCount, true)) return false; if (this.remainder > 0) { player.getInventory() .offerOrDrop(new ItemStack(this.shop.getShopItem(), this.remainder)); } return true; } }
package VSMSerialization; import java.io.FileInputStream; import java.io.IOException; import java.io.ObjectInputStream; /** * The class is used to read the the serialized object from the file and return * the count map object * * @author sameerkhurana10 * */ public class VSMReadSerialTreeCountObj { public static VSMTreeCount redTreeCountObj(String fileName) { VSMTreeCount treeCountObj = null; FileInputStream fis = null; ObjectInputStream in = null; try { fis = new FileInputStream(fileName); in = new ObjectInputStream(fis); /* * getting the countMap object */ treeCountObj = (VSMTreeCount) in.readObject(); in.close(); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace(); } return treeCountObj; } }
package com.zilker.taxi.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import com.zilker.taxi.bean.CabModel; import com.zilker.taxi.constant.SQLConstants; import com.zilker.taxi.util.DbConnect; /* * Describes the admin functionalities. */ public class AdminDAO { private final static Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); /* * Inserts cab model details. */ public void insertCabModel(int adminID, CabModel cabModel) { Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; try { connection = DbConnect.getConnection(); preparedStatement = connection.prepareStatement(SQLConstants.INSERT_CAB_MODEL_DETAILS); preparedStatement.setString(1, cabModel.getModelName()); preparedStatement.setString(2, cabModel.getModelDescription()); preparedStatement.setInt(3, cabModel.getNumberSeats()); preparedStatement.setInt(4, adminID); preparedStatement.setInt(5, adminID); preparedStatement.executeUpdate(); } catch (SQLException e) { LOGGER.log(Level.SEVERE, "Error in inserting cab model details to DB."); } finally { DbConnect.closeConnection(connection, preparedStatement, resultSet); } } /* * Launches the cab model. */ public void launchCab(int modelID, int adminID, String licencePlate) { Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; try { connection = DbConnect.getConnection(); preparedStatement = connection.prepareStatement(SQLConstants.INSERT_CAB_LAUNCH_DETAILS); preparedStatement.setString(1, licencePlate); preparedStatement.setInt(2, modelID); preparedStatement.setInt(3, adminID); preparedStatement.setInt(4, adminID); preparedStatement.executeUpdate(); } catch (SQLException e) { LOGGER.log(Level.SEVERE, "Error in inserting cab launch details to DB."); } finally { DbConnect.closeConnection(connection, preparedStatement, resultSet); } } }
package com.tencent.mm.plugin.appbrand.widget.input; import android.text.NoCopySpan; import android.text.Spannable; import android.widget.TextView; final class ae { private static class a implements NoCopySpan { public float Yr; public float Ys; public int gJn; public int gJo; public boolean gJp; public boolean gJq; public boolean gJr; @Deprecated public boolean gJs; public a(float f, float f2, int i, int i2) { this.Yr = f; this.Ys = f2; this.gJn = i; this.gJo = i2; } } static a[] d(TextView textView) { int i = 0; a[] aVarArr = null; if (textView != null && (textView.getText() instanceof Spannable)) { Spannable spannable = (Spannable) textView.getText(); aVarArr = (a[]) spannable.getSpans(0, spannable.length(), a.class); int length = aVarArr.length; while (i < length) { spannable.removeSpan(aVarArr[i]); i++; } } return aVarArr; } }
import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author DELL */ public class newCar { public static void main (String args[]) { int yearModel = 0; int speed = 0; String make=null; Scanner sc = new Scanner (System.in); car myCar = new car(yearModel,make); System.out.println("Enter year of car:"); yearModel = sc.nextInt(); System.out.println("Enter make of car:"); make = sc.nextLine(); System.out.println("Enter speed of car:"); speed = sc.nextInt(); for(int i=0; i<5; i++) { myCar.acceleration(); System.out.println(" car speed is:" +myCar.getSpeed()); } for(int i=0; i<5; i++) { myCar.breaks(); System.out.println(" car speed is:" +myCar.getSpeed()); } } }
package com.drzewo97.ballotbox.committeepanel.controller.root; import com.drzewo97.ballotbox.core.service.committee.CommitteeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping("/committeepanel/{committeeId}") public class CommitteeManageController { @Autowired private CommitteeService committeeService; @GetMapping private String showCommitteeManage(@PathVariable("committeeId") Integer committeeId){ //Get username String currentPrincipalName = SecurityContextHolder.getContext().getAuthentication().getName(); if(!committeeService.isCommitteeAdmin(currentPrincipalName, committeeId)){ return "redirect:/"; } return "committeepanel/committeepanel"; } }
package com.example.wanghong.criminalintent; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.example.wanghong.database.*; import com.example.wanghong.database.CrimeDBschema.CrimeTable; import java.util.ArrayList; import java.util.UUID; /** * Created by wanghong on 2016/5/27. */ public class CrimeLab {//创建单例类用来保存crime类 private static CrimeLab sCrimeLab; private Context mContext; private SQLiteDatabase mSQLiteDatabase; private ArrayList<Crime>mArrayList; private CrimeLab(Context context) { this.mContext = context.getApplicationContext(); MyDataHelper myDataHelper = new MyDataHelper(mContext); mSQLiteDatabase = myDataHelper.getWritableDatabase(); } public static CrimeLab getCrimeLab(Context context)//得到实例 { if (sCrimeLab == null) { sCrimeLab = new CrimeLab(context.getApplicationContext()); } return sCrimeLab; } private static ContentValues getcontentvalues(Crime crime)//数据库操作中用来存储数据信息的 { ContentValues contentValues = new ContentValues(); contentValues.put(CrimeTable.col.UUID, crime.getMuuid().toString()); contentValues.put(CrimeTable.col.TITLE, crime.getMtitle()); contentValues.put(CrimeTable.col.DATE, crime.getMdate().getTime()); contentValues.put(CrimeTable.col.SOLVED, crime.isMsloved()?1:0); contentValues.put(CrimeTable.col.SUSPECT,crime.getMsuspect()); return contentValues; } public void addCrime(Crime crime) {//在数据库中插入数据 ContentValues contentValues = getcontentvalues(crime); mSQLiteDatabase.insert(CrimeTable.TABLE_NAME, null, contentValues); } public void updata(Crime crime)//当添加一个Crime对象的时候在数据库中更新 { String UUId = crime.getMuuid().toString(); ContentValues contentValues = getcontentvalues(crime); mSQLiteDatabase.update(CrimeTable.TABLE_NAME, contentValues, CrimeTable.col.UUID + "=?", new String[]{UUId}); } private MyCursor quetyCrimes(String where, String[] args)//用来辅助获取数组列表 { Cursor cursor = mSQLiteDatabase.query(CrimeTable.TABLE_NAME, null, where, args, null, null, null); return new MyCursor(cursor); } public void DeleteCrime(Crime crime) { } public ArrayList<Crime> getArrayList() {//返回数组列表 mArrayList=new ArrayList<Crime>(); MyCursor myCursor=quetyCrimes(null,null); try { myCursor.moveToFirst(); while ((!myCursor.isAfterLast())) { mArrayList.add(myCursor.getCrime()); myCursor.moveToNext(); } } finally { myCursor.close(); } return mArrayList; } public Crime getCrime(UUID id) { MyCursor cursor = quetyCrimes( CrimeTable.col.UUID + " = ?", new String[] { id.toString() } ); try { if (cursor.getCount() == 0) { return null; } cursor.moveToFirst(); return cursor.getCrime(); } finally { cursor.close(); } } }
package arenaworker.abilities; import org.json.JSONObject; import arenaworker.Player; public class Resurrection extends Ability { boolean isInvisible = false; long duration = 100L; long start; public Resurrection(Player player, int abilityNum) { super(player, abilityNum); cooldown = 1000L * 90L; } @Override public void Init() { //Fire(); } @Override public void Fire() { //super.Fire(); } // use this instead of fire // fire just returns so that if player triggers ability // it won't reset public void TriggerRevive() { lastFired = player.game.tickStartTime; SendCooldownMessage(); JSONObject json = new JSONObject(); json.put("t", "reviveInitial"); json.put("shipId", player.id); player.game.SendJsonToClients(json); } @Override public void Start() { isOn = true; } }
package cqu.shy.client; import java.awt.BasicStroke; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ConnectException; import java.net.Socket; import java.net.UnknownHostException; import javax.imageio.ImageIO; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.SwingConstants; import cqu.shy.data.DataPacket; import cqu.shy.data.Graph; import cqu.shy.data.ImagePacket; import cqu.shy.paintmode.PaintMode; public class ClientFrame extends JFrame { private static final long serialVersionUID = -2397593626990759111L; private Socket socket = null; private ObjectOutputStream out = null; private ObjectInputStream in = null; private boolean isConnected = false; private Thread dataThread = null; private String userName; private String hostAddress; public void Launch() { try { socket = new Socket(hostAddress, 9003); System.out.println("服务器地址:" + hostAddress); System.out.println("客户端已连接"); isConnected = true; out = new ObjectOutputStream(socket.getOutputStream()); in = new ObjectInputStream(socket.getInputStream()); System.out.println("socket的输入输出流阻塞结束"); dataThread.start(); } catch (UnknownHostException e) { // e.printStackTrace(); // 服务器地址不对 JOptionPane.showMessageDialog(this, "服务器地址未知", "错误", JOptionPane.ERROR_MESSAGE); System.exit(0); try { socket.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } catch (ConnectException c) { // 服务器拒绝访问 JOptionPane.showMessageDialog(this, "服务器访问失败,请检查服务器是否开启", "错误", JOptionPane.ERROR_MESSAGE); System.exit(0); try { socket.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } } // GUI部分,1:聊天面板 private JLabel title; private JTextArea text = null; // 显示对话内容, private JButton SendBtn = null, ClearBtn = null; private JTextArea inputText = null; // 文字输入框 // GUI部分,2:画板部分 private JLabel title2; private JButton LineBtn; private JButton RectangleBtn; private JButton EllipseBtn; private JButton PencilBtn; private JButton RubberBtn; private JButton PaperColorBtn; private JComboBox<Integer> LineWidthBox; private JButton ColorBtn; private JButton ClearPaperBtn; private JButton SendImageBtn; private JCheckBox RealTimeBtn; private PaintPanel paintPanel; private JLabel statusBar; private String Tooltip; private String Colortip; private String BgColortip; public ClientFrame(String username, String host) { this.userName = username; this.hostAddress = host; dataThread = new Thread() { // 接受数据的线程 public void run() { while (isConnected) { try { DataPacket data = (DataPacket) in.readObject(); if (data.getPacketType().equals("Image")) { // 如果接受到的是图像 byte[] ob = (byte[]) data.getData(); ByteArrayInputStream bin = new ByteArrayInputStream( ob); BufferedImage image = ImageIO.read(bin); paintPanel.setImage(image); bin.close(); } else if (data.getPacketType().equals("Text")) { // 如果接受到的是文字 text.append((String)data.getData()); } else if(data.getPacketType().equals("Graph")){ String temp_name = ((Graph)data.getData()).userName; if(RealTimeBtn.isSelected() && !temp_name.equals(userName)){ System.out.println(userName+",实时按钮被选上,获取的data的用户名是"+temp_name); paintPanel.addGraph((Graph)data.getData()); } } } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block //System.out.println("客户端被关闭"); } } } }; this.getContentPane().setLayout(new GridLayout(1, 2, 8, 20)); // 聊天部分GUI初始化 // 标题Label title = new JLabel("聊天"); title.setForeground(Color.MAGENTA); title.setHorizontalAlignment(SwingConstants.CENTER); title.setFont(new Font("微软雅黑", Font.PLAIN, 25)); // 处于中间的可以滚动的文本显示区域 text = new JTextArea("", 10, 18); text.setEditable(false); // 不可录入 text.setLineWrap(true); // 允许自动换行 text.setWrapStyleWord(true); // 允许断行不断字 text.setFont(new Font("SimSun", Font.BOLD, 14)); // 设置字体, // JTextArea不支持改变字体颜色 text.setTabSize(4); text.setBackground(new Color(208, 240, 213)); // 设置对话框背景颜色 JScrollPane scrollPane = new JScrollPane(text); // 让对话框超出后可以出现滚动条 // Box,包含按钮和文本输入框 inputText = new JTextArea("", 5, 40); inputText.setEditable(true); // 可录入 inputText.setLineWrap(true); // 允许自动换行 inputText.setWrapStyleWord(true); // 允许断行不断字 inputText.setFont(new Font("SimSun", Font.PLAIN, 15)); // 设置字体, // JTextArea不支持改变字体颜色 inputText.setTabSize(4); inputText.setBackground(Color.WHITE); JScrollPane scrollPane2 = new JScrollPane(inputText); SendBtn = new JButton("发送"); SendBtn.setFont(new Font("SimSun", Font.PLAIN, 13)); ClearBtn = new JButton("清屏"); ClearBtn.setFont(new Font("SimSun", Font.PLAIN, 13)); SendBtn.addActionListener(new ActionListener() { // 发送信息 @Override public void actionPerformed(ActionEvent arg0) { String message = inputText.getText(); String str = new String(userName + ":\n" + message + "\n"+"\n"); inputText.setText(""); // 建立一个数据包,发送出去 DataPacket mydata = new DataPacket(); mydata.setPacketType("Text"); mydata.setData(str); try { out.writeObject(mydata); out.flush(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } inputText.requestFocusInWindow(); } }); ClearBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { text.setText(""); } }); SendBtn.setFocusPainted(false); ClearBtn.setFocusPainted(false); Box box = Box.createHorizontalBox(); Box btnBox = Box.createVerticalBox(); // 按钮Box,垂直结构 btnBox.add(SendBtn); btnBox.add(Box.createVerticalStrut(5)); btnBox.add(ClearBtn); btnBox.add(Box.createGlue()); box.add(scrollPane2); box.add(Box.createHorizontalStrut(6)); // 输入框与按钮的间距 box.add(btnBox); box.setBorder(BorderFactory.createEmptyBorder(8, 1, 2, 8)); // 边距 inputText.requestFocusInWindow(); JPanel chatPanel = new JPanel(); chatPanel.setLayout(new BorderLayout(4, 4)); chatPanel.add(title, BorderLayout.NORTH); chatPanel.add(scrollPane, BorderLayout.CENTER); chatPanel.add(box, BorderLayout.SOUTH); this.add(chatPanel); // 画板部分GUI初始化 Tooltip = new String("当前工具:直线"); Colortip = new String("画笔颜色:RGB(0,0,0)"); BgColortip = new String("画布颜色:RGB(255,255,255)"); // 顶部标题和按钮 Box box1 = Box.createVerticalBox(); title2 = new JLabel("绘图"); title2.setForeground(Color.MAGENTA); title2.setHorizontalAlignment(SwingConstants.CENTER); title2.setFont(new Font("微软雅黑", Font.PLAIN, 25)); Box box2 = Box.createHorizontalBox(); Box box3 = Box.createVerticalBox(); Box box4 = Box.createHorizontalBox(); LineBtn = new JButton(); LineBtn.setIcon(new ImageIcon("src/Icon/LineIcon.png")); LineBtn.setPreferredSize(new Dimension(40, 29)); RectangleBtn = new JButton(); RectangleBtn.setIcon(new ImageIcon("src/Icon/RectangleIcon.png")); RectangleBtn.setPreferredSize(new Dimension(40, 29)); EllipseBtn = new JButton(); EllipseBtn.setIcon(new ImageIcon("src/Icon/EllipseIcon.png")); EllipseBtn.setPreferredSize(new Dimension(40, 29)); PencilBtn = new JButton(); PencilBtn.setIcon(new ImageIcon("src/Icon/PancilIcon.png")); PencilBtn.setPreferredSize(new Dimension(40, 29)); RubberBtn = new JButton(); RubberBtn.setIcon(new ImageIcon("src/Icon/RubberIcon.png")); RubberBtn.setPreferredSize(new Dimension(40, 29)); PaperColorBtn = new JButton("画布颜色"); PaperColorBtn.setFont(new Font("SimSun", Font.PLAIN, 12)); box4.add(LineBtn); box4.add(Box.createHorizontalStrut(10)); box4.add(RectangleBtn); box4.add(Box.createHorizontalStrut(10)); box4.add(EllipseBtn); box4.add(Box.createHorizontalStrut(10)); box4.add(PencilBtn); box4.add(Box.createHorizontalStrut(10)); box4.add(RubberBtn); box4.add(Box.createHorizontalStrut(10)); box4.add(PaperColorBtn); box4.add(Box.createHorizontalGlue()); box4.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); // 3个像素的边距 Box box5 = Box.createHorizontalBox(); ColorBtn = new JButton(); ColorBtn.setIcon(new ImageIcon("src/Icon/ColorIcon.png")); ColorBtn.setPreferredSize(new Dimension(40, 29)); JLabel linewidth_label = new JLabel("画笔宽度:"); linewidth_label.setFont(new Font("SimSun", Font.PLAIN, 13)); Integer[] items = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; LineWidthBox = new JComboBox<Integer>(items); LineWidthBox.setPreferredSize(new Dimension(40, 29)); ClearPaperBtn = new JButton("清除图像"); ClearPaperBtn.setFont(new Font("SimSun", Font.PLAIN, 12)); box5.add(ColorBtn); box5.add(Box.createHorizontalStrut(10)); box5.add(linewidth_label); box5.add(Box.createHorizontalStrut(4)); box5.add(LineWidthBox); box5.add(Box.createHorizontalStrut(10)); box5.add(ClearPaperBtn); box5.add(Box.createGlue()); box5.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); // 3个像素的边距 box3.add(box4); box3.add(box5); Box box6 = Box.createVerticalBox(); Box box7 = Box.createHorizontalBox(); SendImageBtn = new JButton("发送"); SendImageBtn.setFont(new Font("SimSun", Font.PLAIN, 12)); RealTimeBtn = new JCheckBox("允许实时更新"); RealTimeBtn.setSelected(false); RealTimeBtn.setFont(new Font("SimSun", Font.PLAIN, 13)); box7.add(SendImageBtn); box7.add(Box.createHorizontalStrut(4)); box7.add(Box.createGlue()); Box box8 = Box.createHorizontalBox(); box8.add(RealTimeBtn); box8.add(Box.createGlue()); box6.add(box7); box6.add(box8); box2.add(box3); box2.add(box6); box1.add(title2); box1.add(box2); box1.add(Box.createVerticalStrut(2)); // 中间的绘图面板 paintPanel = new PaintPanel(); JScrollPane temp_scroll = new JScrollPane(paintPanel); // 底部的状态栏 statusBar = new JLabel(); statusBar.setFont(new Font("SimSun", Font.PLAIN, 14)); statusBar.setAlignmentX(CENTER_ALIGNMENT); statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); // 最后将以上元素添加进去 JPanel paintCanvas = new JPanel(); paintCanvas.setLayout(new BorderLayout(4, 4)); paintCanvas.add(box1, BorderLayout.NORTH); paintCanvas.add(temp_scroll, BorderLayout.CENTER); paintCanvas.add(statusBar, BorderLayout.SOUTH); this.add(paintCanvas); // 按钮事件 LineBtn.addActionListener(new ActionListener() { // 直线 @Override public void actionPerformed(ActionEvent arg0) { Tooltip = "当前工具:直线"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); paintPanel.setPaintmode(PaintMode.LINE); } }); RectangleBtn.addActionListener(new ActionListener() { // 矩形 @Override public void actionPerformed(ActionEvent arg0) { Tooltip = "当前工具:矩形"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); paintPanel.setPaintmode(PaintMode.RECTANGLE); } }); EllipseBtn.addActionListener(new ActionListener() { // 椭圆 @Override public void actionPerformed(ActionEvent e) { Tooltip = "当前工具:椭圆"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); paintPanel.setPaintmode(PaintMode.ELLIPSE); } }); PencilBtn.addActionListener(new ActionListener() { // 铅笔 @Override public void actionPerformed(ActionEvent e) { Tooltip = "当前工具:铅笔"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); paintPanel.setPaintmode(PaintMode.PENCIL); } }); RubberBtn.addActionListener(new ActionListener() { // 橡皮擦 @Override public void actionPerformed(ActionEvent e) { Tooltip = "当前工具:橡皮擦"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); paintPanel.setPaintmode(PaintMode.RUBBER); } }); PaperColorBtn.addActionListener(new ActionListener() { // 选择画布颜色 @Override public void actionPerformed(ActionEvent e) { // 提示该操作会覆盖当前图像 int choose = JOptionPane.showConfirmDialog(ClientFrame.this, "该操作将会覆盖当前图像,确定要进行吗?", "提示", JOptionPane.YES_NO_OPTION); if (choose == 1) return; Color color = JColorChooser.showDialog(ClientFrame.this, "画布颜色选择", paintPanel.getColor()); if (color != null) { paintPanel.setPaperColor(color); BgColortip = "画笔颜色:RGB(" + color.getRed() + "," +color.getGreen()+","+color.getBlue()+")"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); } } }); ColorBtn.addActionListener(new ActionListener() { // 改变线条颜色 @Override public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog(ClientFrame.this, "画笔颜色选择", paintPanel.getColor()); if (color != null) { paintPanel.setColor(color); Colortip = "画笔颜色:RGB(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue() + ")"; statusBar.setText("状态栏: " + Tooltip + " " + Colortip + " "+BgColortip); } } }); ClearPaperBtn.addActionListener(new ActionListener() { // 清除图像 @Override public void actionPerformed(ActionEvent e) { paintPanel.ClearPaper(); } }); SendImageBtn.addActionListener(new ActionListener() { // 发送 @Override public void actionPerformed(ActionEvent e) { BufferedImage image = paintPanel.getImage(); ImagePacket imgPack = new ImagePacket(image); ByteArrayOutputStream byte_out = imgPack.getByteOutputStream(); byte[] datas = byte_out.toByteArray(); try { DataPacket data = new DataPacket(); data.setPacketType("Image"); data.setData(datas); out.writeObject(data); out.flush(); } catch (IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } } }); this.setSize(1080, 600); this.setTitle("网络白板客户端..." + username); this.setLocation(100, 100); this.setResizable(false);// 不可改变窗体大小 this.setVisible(true); this.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.out.println("客户端窗口关闭"); isConnected = false; try { socket.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // 需要处理关闭事件 System.exit(0); } }); } public void sendGraph(Graph graph){ DataPacket mydata = new DataPacket(); mydata.setPacketType("Graph"); mydata.setData(graph); try { out.writeObject(mydata); out.flush(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // 内部类, 绘图面板 private class PaintPanel extends JPanel implements MouseListener, MouseMotionListener { /** * */ private static final long serialVersionUID = 1L; private PaintMode paintmode = PaintMode.LINE; private final int WIDTH = 530, HEIGHT = 440; private int startX = 0, startY = 0, endX = 0, endY = 0; // 画图过程判断 private boolean isBegin = false; private boolean isPainting = false; private boolean isEnd = false; // 绘图属性 private Color color; // 画笔颜色 private Color paperColor; // 画布颜色,橡皮擦颜色 // 缓存的图像 private BufferedImage MyImage; private Graphics2D MyImage_g; private boolean isGetFromOther=false; public PaintPanel() { super(); repaint(); addMouseListener(this); addMouseMotionListener(this); setBackground(Color.WHITE); color = new Color(0, 0, 0); paperColor = new Color(255, 255, 255); MyImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); MyImage_g = MyImage.createGraphics(); MyImage_g.setColor(paperColor); MyImage_g.fillRect(0, 0, WIDTH, HEIGHT); MyImage_g.setColor(color); } public PaintMode getPaintmode() { return paintmode; } public void setPaintmode(PaintMode paintmode) { this.paintmode = paintmode; } public Color getColor() { return color; } public void setColor(Color color) { this.color = color; } public Color getPaperColor() { return paperColor; } public void setPaperColor(Color paperColor) { this.paperColor = paperColor; MyImage_g.clearRect(0, 0, WIDTH, HEIGHT); MyImage_g.setColor(paperColor); MyImage_g.fillRect(0, 0, WIDTH, HEIGHT); isBegin = false; isPainting = false; isEnd = false; startX = startY = endX = endY = -1; repaint(); } public void ClearPaper() { MyImage_g.clearRect(0, 0, WIDTH, HEIGHT); MyImage_g.setColor(paperColor); MyImage_g.fillRect(0, 0, WIDTH, HEIGHT); System.out.println("清除图像"); startX = startY = endX = endY = -1; repaint(); } @Override public void paint(Graphics g) { super.paint(g); // 先画出已有的图像 g.drawImage(MyImage, 0, 0, null); // 设置画笔属性 Graphics2D g_2d = (Graphics2D) g; BasicStroke stroke = new BasicStroke( (float) (LineWidthBox.getSelectedIndex() + 1.0)); g_2d.setColor(color); g_2d.setStroke(stroke); MyImage_g.setColor(color); MyImage_g.setStroke(stroke); // 针对矩形和椭圆会用到 int realsx, realsy, realex, realey; realsx = startX < endX ? startX : endX; realex = startX > endX ? startX : endX; realsy = startY < endY ? startY : endY; realey = startY > endY ? startY : endY; if( (isBegin||isPainting) && !isEnd){ // 根据所选工具进行绘图 switch (paintmode) { case LINE: g_2d.drawLine(startX, startY, endX, endY); break; case RECTANGLE: g_2d.drawRect(realsx, realsy, realex - realsx, realey - realsy); break; case ELLIPSE: g_2d.drawOval(realsx, realsy, realex - realsx, realey - realsy); break; // 铅笔跟橡皮擦都需要边画边存 case PENCIL: g_2d.drawLine(startX, startY, endX, endY); MyImage_g.drawLine(startX, startY, endX, endY); if(RealTimeBtn.isSelected() && !isGetFromOther){ //如果允许实时同步 Graph temp = new Graph(userName,startX,startY,endX,endY,PaintMode.PENCIL,stroke.getLineWidth(),color); sendGraph(temp); } break; case RUBBER: MyImage_g.setColor(paperColor); g_2d.setColor(paperColor); g_2d.drawLine(startX, startY, endX, endY); MyImage_g.drawLine(startX, startY, endX, endY); if(RealTimeBtn.isSelected() && !isGetFromOther){ //如果允许实时同步 Graph temp = new Graph(userName,startX,startY,endX,endY,PaintMode.RUBBER,stroke.getLineWidth(),color); sendGraph(temp); } break; default: break; } } else if (isEnd) { switch (paintmode) { case LINE: g_2d.drawLine(startX, startY, endX, endY); MyImage_g.drawLine(startX, startY, endX, endY); if(RealTimeBtn.isSelected()&& !isGetFromOther){ //如果允许实时同步 Graph temp = new Graph(userName,startX,startY,endX,endY,PaintMode.LINE,stroke.getLineWidth(),color); sendGraph(temp); } break; case RECTANGLE: g_2d.drawRect(realsx, realsy, realex - realsx, realey - realsy); MyImage_g.drawRect(realsx, realsy, realex - realsx, realey - realsy); if(RealTimeBtn.isSelected()&& !isGetFromOther){ //如果允许实时同步 Graph temp = new Graph(userName,startX,startY,endX,endY,PaintMode.RECTANGLE,stroke.getLineWidth(),color); sendGraph(temp); } break; case ELLIPSE: g_2d.drawOval(realsx, realsy, realex - realsx, realey - realsy); MyImage_g.drawOval(realsx, realsy, realex - realsx, realey - realsy); if(RealTimeBtn.isSelected()&& !isGetFromOther){ //如果允许实时同步 Graph temp = new Graph(userName,startX,startY,endX,endY,PaintMode.ELLIPSE,stroke.getLineWidth(),color); sendGraph(temp); } break; // 铅笔跟橡皮擦不需要再保存了 default: break; } isBegin = false; isEnd = false; isPainting = false; } isGetFromOther=false; } @Override public void mouseDragged(MouseEvent arg0) { isBegin = false; isPainting = true; isEnd = false; if (paintmode == PaintMode.PENCIL || paintmode == PaintMode.RUBBER) { startX = endX; startY = endY; } endX = arg0.getX(); endY = arg0.getY(); repaint(); } @Override public void mouseMoved(MouseEvent arg0) { } @Override public void mouseClicked(MouseEvent arg0) { } @Override public void mouseEntered(MouseEvent arg0) { } @Override public void mouseExited(MouseEvent arg0) { } @Override public void mousePressed(MouseEvent arg0) { isBegin = true; isPainting = false; isEnd = false; startX = arg0.getX(); endX = startX; startY = arg0.getY(); endY = startY; System.out.println("坐标:"+startX+","+(startY==endY?startY:-1)); System.out.println("画笔宽度:"+(float) (LineWidthBox.getSelectedIndex() + 1.0)); repaint(); } @Override public void mouseReleased(MouseEvent arg0) { isBegin = false; isPainting = false; isEnd = true; endX = arg0.getX(); endY = arg0.getY(); repaint(); } public BufferedImage getImage() { return MyImage; } public void setImage(BufferedImage image) { // MyImage_g.clearRect(0, 0, WIDTH, HEIGHT); System.out.println("获得图像"); startX = startY = endX = endY = -1; MyImage = image; MyImage_g = image.createGraphics(); MyImage_g.setColor(paperColor); //MyImage_g.fillRect(0, 0, WIDTH, HEIGHT); MyImage_g.setColor(color); repaint(); } public void addGraph(Graph graph){ System.out.println(userName+":paintPanel添加Graph"); BasicStroke stroke = new BasicStroke( graph.penWidth); MyImage_g.setColor(graph.pencolor); System.out.println(userName+":画笔颜色,"+graph.pencolor);//MyImage_g.getColor()); MyImage_g.setStroke(stroke); int sx=graph.startX,sy=graph.startY,ex=graph.endX,ey=graph.endY; int realsx,realsy,realex,realey; // 针对矩形和椭圆会用到 realsx = sx < ex ? sx : ex; realex = sx > ex ? sx : ex; realsy = sy < ey ? sy : ey; realey = sy > ey ? sy : ey; switch(graph.paintmode){ case LINE: MyImage_g.drawLine(sx, sy, ex, ey);break; case RECTANGLE: MyImage_g.drawRect(realsx, realsy, realex-realsx, realey-realsy);break; case ELLIPSE: MyImage_g.drawOval(realsx, realsy, realex - realsx, realey - realsy);break; case PENCIL: MyImage_g.drawLine(sx, sy, ex, ey);break; case RUBBER: //橡皮擦颜色用本地画布的颜色 MyImage_g.setColor(paperColor); System.out.println(userName+":paintPanel的画布颜色:"+paperColor); MyImage_g.drawLine(sx, sy, ex, ey);break; default: break; } isGetFromOther=true; repaint(); } } }
/** * Copyright 2013-present febit.org (support@febit.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.febit.web.component; import org.febit.lang.Defaults; import org.febit.web.ActionConfig; import org.febit.web.ActionRequest; import org.febit.web.argument.ArgumentConfig; /** * * @author zqq90 */ public class DefaultActionInvoker implements Wrapper { @Override public Object invoke(final ActionRequest request) throws Exception { final ActionConfig actionConfig = request.actionConfig; final Object[] args = resolveArguments(request); return actionConfig.handler.invoke(actionConfig.action, args); } protected Object[] resolveArguments(final ActionRequest request) { final ArgumentConfig[] arguments = request.actionConfig.arguments; final int argsLen = arguments.length; if (argsLen == 0) { return Defaults.EMPTY_OBJECTS; } final Object[] args = new Object[argsLen]; for (int i = 0; i < argsLen; i++) { args[i] = arguments[i].resolve(request); } return args; } }
package cn.rongcloud.im.utils.googleApi; import android.util.Log; import java.util.HashMap; import java.util.List; import java.util.Map; import io.rong.imlib.model.Message; import io.rong.message.TextMessage; /** * Created by DELL on 2017/5/26. */ public class TransGoogleApi { private static final String TRANS_API_HOST = "https://www.googleapis.com/language/translate/v2"; private static StringBuilder sb = null; private String securityKey; public TransGoogleApi(String securityKey) { this.securityKey = securityKey; sb = new StringBuilder(); } public String getTransResult(List<Message> list, String to) { String afterUrl = buildParams(list, to); return HttpGet.get(TRANS_API_HOST, afterUrl); } ; private String buildParams(List<Message> list, String to) { if (list == null) return ""; if (list.size() <= 0) return ""; sb.append("?key="); sb.append(securityKey); sb.append("&target="); sb.append(to); for (int i = 0; i < list.size(); i++) { if (list.get(i).getContent() instanceof TextMessage) { TextMessage msg = (TextMessage) list.get(i).getContent(); String q = msg.getContent(); sb.append("&q="); sb.append(q); } } return sb.toString(); } }
import java.awt.Color; import java.util.ArrayList; import java.util.Collections; public class Board { ArrayList<Tile> tiles; int height, width; int fullHeight; ArrayList<Piece> next = new ArrayList<Piece>(); Piece activePiece; Piece held; int linesCleared; int points; Boolean alreadyHeld = false; Pos start = new Pos(3, 20); public static Tile outOfBounds = new Tile(new Pos(-1, -1), Color.black); public static Tile empty = new Tile(new Pos(-1, -1), Color.black); public BoardDisplay display; public boolean playing = true; public Board(int width, int height) { this.height = height; this.width = width; this.fullHeight = height + 5; tiles = new ArrayList<Tile>(); MakeNext(); } void MakeNext() { if (next.size() <= 7) { ArrayList<Piece> newTiles = new ArrayList<Piece>(); for (int i = 0; i < 7; i++) { Piece.Type t = Piece.Type.values()[i]; newTiles.add(new Piece(t, start, this)); } Collections.shuffle(newTiles); next.addAll(newTiles); } } public void LockActivePiece() { activePiece = null; for (int i = 0; i < height; i++) { ClearRow(i); } for (int i = 0; i < tiles.size(); i++) { if (tiles.get(i).pos.y > height) { Lose(); } } alreadyHeld = false; } public void Tick() { if (activePiece == null) { activePiece = next.get(0); AddPiece(activePiece); next.remove(0); MakeNext(); } else { activePiece.Move(Direction.Down, this); } } void AddPiece(Piece p) { for (int i = 0; i < 4; i++) { AddTile(p.GetTile(i)); } } void AddTile(Tile t) { tiles.add(t); } void ClearRow(int i) { if (!FullRow(i)) { return; } ArrayList<Tile> row = Row(i); if (row.size() >= width) { for (int x = 0; x < row.size(); x++) { tiles.remove(row.get(x)); } for (int y = i + 1; y < height; y++) { ArrayList<Tile> r = Row(y); for (int x = 0; x < width; x++) { Tile tile = GetTile(x, y); if (tile != empty) { tile.Move(Direction.Down); } } } linesCleared++; if (linesCleared % 10 == 0) { GameWindow.tt.SpeedUp(); } } } ArrayList<Tile> Row(int y) { ArrayList<Tile> row = new ArrayList<Tile>(); for (int i = 0; i < tiles.size(); i++) { Tile t = GetTile(i, y); if (t != empty && t != outOfBounds) { row.add(t); } } return row; } Boolean FullRow(int i) { for (int x = 0; x < width; x++) { if (GetTile(x, i) == empty) { return false; } } return true; } public Tile GetTile(int x, int y) { if (OutOfBounds(x, y)) { return outOfBounds; } for (int i = 0; i < tiles.size(); i++) { Tile t = tiles.get(i); if (t.pos.x == x && t.pos.y == y) { return t; } } return empty; } public Boolean OutOfBounds(Pos p) { return OutOfBounds(p.x, p.y); } public Boolean OutOfBounds(int x, int y) { return x < 0 || x > width - 1 || y < 1 || y > fullHeight; } public ArrayList<Tile> GetTiles() { return tiles; } public Piece GetActivePiece() { return activePiece; } public Tile GetTile(Pos p) { return GetTile(p.x, p.y); } public Boolean Empty(int x, int y) { return Empty(new Pos(x, y)); } public Boolean Empty(Pos p) { return GetTile(p) == empty; } void Hold() { if (alreadyHeld) { return; } Piece temp; if (held == null) { held = activePiece; for (int i = 0; i < 4; i++) { tiles.remove(activePiece.GetTile(i)); } activePiece = Piece.Random(start, this); AddPiece(activePiece); } else { temp = held; held = activePiece; for (int i = 0; i < 4; i++) { tiles.remove(activePiece.GetTile(i)); } activePiece = temp; activePiece.SetPos(start); AddPiece(activePiece); } alreadyHeld = true; } void Lose() { if (playing) { playing = false; display.Lose(linesCleared); } } }
//This file is part of JPACS. // // JPACS is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // JPACS is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with JPACS. If not, see <http://www.gnu.org/licenses/>. package br.pucminas.dcc.jpacs.gui; import br.pucminas.dcc.jpacs.*; import br.pucminas.dcc.jpacs.core.ItemRelatorio; import br.pucminas.dcc.jpacs.core.Processor; import java.awt.*; import java.util.*; import java.io.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.*; import java.net.URL; /** * Classe contendo o JFrame principal do JPACS */ public class MainFrame extends JFrame { static final Integer CAMADAAJUDA = new Integer(7); static final Integer CAMADACODIGO = new Integer(6); static final Integer CAMADAACESSO = new Integer(5); static final Integer CAMADAOUTROS = new Integer(4); protected JMenuBar MenuPrincipal; protected JToolBar BarraFerramentas; public JDesktopPane Desk; protected JTable Table1;//Tabela que contém a memoria ram protected JInternalFrame FrameRam;//Frame q mostra a tabela da ram protected JInternalFrame Output;//mostra o output da simulação protected JInternalFrame FrameCache;//Frame q mostra a cache protected JInternalFrame FramePro;//Frame q mosta os registradores e os flags protected HelpInternalFrame FrameAjuda;//Frame q mostra ajuda protected JInternalFrame FrameListCom;//frame q mostra lista dos comandas protected Vector Vet = new Vector(); protected Vector Backup; protected Vector Backup2; protected JTable Relatorio; protected JList Resultado = null; protected int Pass = 0;//indica em que linha está o passo protected Processor Processador = new Processor(); public JFileChooser EscolheArq; public String UltimoArquivo = Internacionalizacao.get("Default.File"); public String UltimoRelatorio = Internacionalizacao.get("Default.Report.File"); public JButton Proc; public boolean CacheOn = true; public static final int SimulaCache = 1; public static final int SimulaProcessador = 2; public static final int SimulaIntegrado = 3; JMenu MenuJanela; JCheckBoxMenuItem CheckMenuPrinc; JCheckBoxMenuItem CheckMenuCache; JCheckBoxMenuItem CheckMenuProc; JCheckBoxMenuItem CheckMenuRel; public MainFrame() { super("JPACS"); //chama construtor JFrame(String) getContentPane().setLayout(new BorderLayout()); CriarMenus();//cria o menu principal CriarFerramentas();//cria barra de ferramentas Desk = new JDesktopPane(); Processador.NovaMemoria(); ExibeRam(Processador.VisualizaRam());//cria o frame contendo a MemoriaRam ExibeCache(); ExibeSimula(); getContentPane().add(Desk, BorderLayout.CENTER); File Diretorio = new File("./files/"); EscolheArq = new JFileChooser(Diretorio); EscolheArq.addChoosableFileFilter(new TextFilter()); this.setIconImage(new ImageIcon(this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/JPACS.png")).getImage()); this.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); //encerra o programa se a janela for fechada //Dimension ScreenSize=Toolkit.getDefaultToolkit().getScreenSize(); //setBounds(0,0,ScreenSize.width,ScreenSize.height-30); //tamanho da janela setExtendedState(MainFrame.MAXIMIZED_BOTH); setVisible(true); } protected void CriarMenus() { MenuPrincipal = new JMenuBar(); MenuPrincipal.setOpaque(true); JMenu Arquivo = CriaMenuArquivo(); JMenu Simulacao = CriaMenuSimulacao(); JMenu Config = CriaMenuConfig(); MenuJanela = CriaMenuJanela(); JMenu Ajuda = CriaMenuAjuda(); MenuPrincipal.add(Arquivo); MenuPrincipal.add(Simulacao); MenuPrincipal.add(Config); MenuPrincipal.add(MenuJanela); MenuPrincipal.add(Ajuda); setJMenuBar(MenuPrincipal); } protected JMenu CriaMenuArquivo() { JMenu Arq = new JMenu(Internacionalizacao.get("Menu.File")); JMenu Novo = new JMenu(Internacionalizacao.get("Menu.File.New")); JMenuItem Abrir = new JMenuItem(Internacionalizacao.get("Menu.File.Open")); JMenuItem Salvar = new JMenuItem(Internacionalizacao.get("Menu.File.Save")); JMenuItem Sair = new JMenuItem(Internacionalizacao.get("Menu.File.Exit")); JMenuItem Assembly = new JMenuItem(Internacionalizacao.get("Menu.File.New.Assembly")); JMenuItem Acesso = new JMenuItem(Internacionalizacao.get("Menu.File.New.Access")); Arq.setMnemonic(Internacionalizacao.get("Menu.File.Mnemonic").charAt(0)); Novo.setMnemonic(Internacionalizacao.get("Menu.File.New.Mnemonic").charAt(0)); Abrir.setMnemonic(Internacionalizacao.get("Menu.File.Open.Mnemonic").charAt(0)); Salvar.setMnemonic(Internacionalizacao.get("Menu.File.Save.Mnemonic").charAt(0)); Sair.setMnemonic(Internacionalizacao.get("Menu.File.Exit.Mnemonic").charAt(0)); Assembly.setMnemonic(Internacionalizacao.get("Menu.File.New.Assembly.Mnemonic").charAt(0)); Acesso.setMnemonic(Internacionalizacao.get("Menu.File.New.Access.Mnemonic").charAt(0)); Abrir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AbrirJanela(); } }); Salvar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SalvarJanela(); } }); Sair.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); Assembly.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaNovoCodigo(); } }); Acesso.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaNovoAcesso(); } }); Novo.add(Assembly); Novo.add(Acesso); Arq.add(Novo); Arq.add(Abrir); Arq.add(Salvar); Arq.addSeparator(); Arq.add(Sair); return Arq; } protected JMenu CriaMenuSimulacao() { JMenu Simulacao = new JMenu(Internacionalizacao.get("Menu.Simulation")); JMenuItem Normal = new JMenuItem(Internacionalizacao.get("Menu.Simulation.Quick")); JMenuItem Passo = new JMenuItem(Internacionalizacao.get("Menu.Simulation.Step")); JMenuItem Salva = new JMenuItem(Internacionalizacao.get("Menu.Simulation.Report")); JMenuItem Config = new JMenuItem(Internacionalizacao.get("Menu.Simulation.Configuration")); JMenuItem Limp = new JMenuItem(Internacionalizacao.get("Menu.Simulation.Clean")); Simulacao.setMnemonic(Internacionalizacao.get("Menu.Simulation.Mnemonic").charAt(0)); Normal.setMnemonic(Internacionalizacao.get("Menu.Simulation.Quick.Mnemonic").charAt(0)); Passo.setMnemonic(Internacionalizacao.get("Menu.Simulation.Step.Mnemonic").charAt(0)); Salva.setMnemonic(Internacionalizacao.get("Menu.Simulation.Report.Mnemonic").charAt(0)); Config.setMnemonic(Internacionalizacao.get("Menu.Simulation.Configuration.Mnemonic").charAt(0)); Limp.setMnemonic(Internacionalizacao.get("Menu.Simulation.Clean.Mnemonic").charAt(0)); Normal.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaSimula(); } }); Passo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SimulaPasso(); } }); Salva.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SalvaSimula(); } }); Limp.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { LimpaTudo(); } }); Simulacao.add(Normal); Simulacao.add(Passo); Simulacao.addSeparator(); Simulacao.add(Salva); Simulacao.add(Limp); return Simulacao; } protected JMenu CriaMenuConfig() { JMenu Config = new JMenu(Internacionalizacao.get("Menu.Config")); JMenuItem Mem = new JMenuItem(Internacionalizacao.get("Menu.Config.Mem")); JMenuItem Inter = new JMenuItem(Internacionalizacao.get("Menu.Config.International")); Config.setMnemonic(Internacionalizacao.get("Menu.Config.Mnemonic").charAt(0)); Mem.setMnemonic(Internacionalizacao.get("Menu.Config.Mem.Mnemonic").charAt(0)); Inter.setMnemonic(Internacionalizacao.get("Menu.Config.International.Mnemonic").charAt(0)); Mem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaConfig(); } }); Inter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaInter(); } }); Config.add(Mem); Config.add(Inter); return Config; } protected JMenu CriaMenuJanela() { JMenu Janela = new JMenu(Internacionalizacao.get("Menu.Window")); CheckMenuPrinc = new JCheckBoxMenuItem(Internacionalizacao.get("Menu.Window.Memory")); CheckMenuCache = new JCheckBoxMenuItem(Internacionalizacao.get("Menu.Window.Cache")); CheckMenuProc = new JCheckBoxMenuItem(Internacionalizacao.get("Menu.Window.Processor")); CheckMenuRel = new JCheckBoxMenuItem(Internacionalizacao.get("Menu.Window.Report")); Janela.setMnemonic(Internacionalizacao.get("Menu.Window.Mnemonic").charAt(0)); CheckMenuPrinc.setMnemonic(Internacionalizacao.get("Menu.Window.Memory.Mnemonic").charAt(0)); CheckMenuCache.setMnemonic(Internacionalizacao.get("Menu.Window.Cache.Mnemonic").charAt(0)); CheckMenuProc.setMnemonic(Internacionalizacao.get("Menu.Window.Processor.Mnemonic").charAt(0)); CheckMenuRel.setMnemonic(Internacionalizacao.get("Menu.Window.Report.Mnemonic").charAt(0)); CheckMenuPrinc.setState(true); CheckMenuCache.setState(true); CheckMenuProc.setState(true); CheckMenuRel.setState(true); CheckMenuPrinc.addActionListener(new CheckMenuListener(CheckMenuPrinc) { @Override public void actionPerformed(ActionEvent e) { FrameRam.setVisible(Owner.getState()); } }); CheckMenuCache.addActionListener(new CheckMenuListener(CheckMenuCache) { @Override public void actionPerformed(ActionEvent e) { FrameCache.setVisible(Owner.getState()); } }); CheckMenuProc.addActionListener(new CheckMenuListener(CheckMenuProc) { @Override public void actionPerformed(ActionEvent e) { FramePro.setVisible(Owner.getState()); } }); CheckMenuRel.addActionListener(new CheckMenuListener(CheckMenuRel) { @Override public void actionPerformed(ActionEvent e) { Output.setVisible(Owner.getState()); } }); Janela.add(CheckMenuPrinc); Janela.add(CheckMenuCache); Janela.add(CheckMenuProc); Janela.add(CheckMenuRel); return Janela; } protected JMenu CriaMenuAjuda() { JMenu Ajuda = new JMenu(Internacionalizacao.get("Menu.Help")); JMenuItem Topicos = new JMenuItem(Internacionalizacao.get("Menu.Help.Topics")); JMenuItem Comand = new JMenuItem(Internacionalizacao.get("Menu.Help.Assembly")); JMenuItem Sobre = new JMenuItem(Internacionalizacao.get("Menu.Help.About")); Ajuda.setMnemonic(Internacionalizacao.get("Menu.Help.Mnemonic").charAt(0)); Topicos.setMnemonic(Internacionalizacao.get("Menu.Help.Topics.Mnemonic").charAt(0)); Comand.setMnemonic(Internacionalizacao.get("Menu.Help.Assembly.Mnemonic").charAt(0)); Sobre.setMnemonic(Internacionalizacao.get("Menu.Help.About.Mnemonic").charAt(0)); Topicos.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AjudaTopicos(); } }); Comand.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AjudaComandos(); } }); Sobre.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AjudaSobre(); } }); Ajuda.add(Topicos); Ajuda.add(Comand); Ajuda.addSeparator(); Ajuda.add(Sobre); return Ajuda; } public void CriarFerramentas() { BarraFerramentas = new JToolBar(); URL Path; Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/novo.png"); JButton Novo = new JButton(new ImageIcon(Path)); Novo.setToolTipText(Internacionalizacao.get("Toolbar.Button.New.Access")); Novo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaNovoAcesso(); } }); Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/novoA.png"); JButton NovoA = new JButton(new ImageIcon(Path)); NovoA.setToolTipText(Internacionalizacao.get("Toolbar.Button.New.Assembly")); NovoA.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaNovoCodigo(); } }); Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/abrir.png"); JButton Abre = new JButton(new ImageIcon(Path)); Abre.setToolTipText(Internacionalizacao.get("Toolbar.Button.Open")); Abre.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AbrirJanela(); } }); Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/salvar.png"); JButton Salva = new JButton(new ImageIcon(Path)); Salva.setToolTipText(Internacionalizacao.get("Toolbar.Button.Save")); Salva.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SalvarJanela(); } }); Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/config.png"); JButton Config = new JButton(new ImageIcon(Path)); Config.setToolTipText(Internacionalizacao.get("Toolbar.Button.Configuration")); Config.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JanelaConfig(); } }); Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/refaz.png"); JButton Limpa = new JButton(new ImageIcon(Path)); Limpa.setToolTipText(Internacionalizacao.get("Toolbar.Button.Clean")); Limpa.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { LimpaTudo(); } }); Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/procOff.png"); Proc = new JButton(new ImageIcon(Path)); Proc.setToolTipText(Internacionalizacao.get("Editor.Toolbar.Proc.Off")); Proc.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ProcClick(); } }); BarraFerramentas.add(Novo); BarraFerramentas.add(NovoA); BarraFerramentas.addSeparator(); BarraFerramentas.add(Abre); BarraFerramentas.add(Salva); BarraFerramentas.addSeparator(); BarraFerramentas.add(Config); BarraFerramentas.add(Limpa); BarraFerramentas.add(Proc); getContentPane().add(BarraFerramentas, BorderLayout.NORTH); } public void ProcClick() { CacheOn = !CacheOn; try { URL Path; if (CacheOn) { Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/procOff.png"); Proc.setIcon(new ImageIcon(Path)); Proc.setToolTipText(Internacionalizacao.get("Editor.Toolbar.Proc.Off")); FrameCache.setVisible(true); Output.setVisible(true); } else { Path = this.getClass().getResource("/br/pucminas/dcc/jpacs/resources/procOn.png"); Proc.setIcon(new ImageIcon(Path)); Proc.setToolTipText(Internacionalizacao.get("Editor.Toolbar.Proc.On")); FrameCache.setVisible(false); Output.setVisible(false); } } catch (Exception e) { System.out.println(e); } } public void JanelaInter() { InternationalDialog Inter = new InternationalDialog(this); Inter.setVisible(true); if (Inter.ok()) { Internacionalizacao.create(Inter.idioma(), Inter.local()); Internacionalizacao.writeToFile("JPACS.lang"); JOptionPane.showMessageDialog(this, Internacionalizacao.get("Config.Inter.Warning"), Internacionalizacao.get("Warning.Title"), JOptionPane.WARNING_MESSAGE); } } public void JanelaConfig() { JanelaConfig(false); } public void JanelaConfig(boolean Rec) { ConfigDialog Config = new ConfigDialog(this); if (Rec) { Config.Cancelar.setEnabled(false); Config.Salvar.setEnabled(false); } Config.setVisible(true); try { LimpaTudo(); } catch (OutOfMemoryError e) { JOptionPane.showMessageDialog(this, Internacionalizacao.get("Error.Out.Of.Memory"), Internacionalizacao.get("Error.Title"), JOptionPane.ERROR_MESSAGE); System.gc(); JanelaConfig(true); } } public void LimpaTudo() { JInternalFrame Selecionado = Desk.getSelectedFrame(); Resultado = null; Vet = new Vector(); Processador.LimpaProcessador(); ExibeRam(Processador.VisualizaRam()); ExibeCache(); ExibeSimula(); Desk.repaint(); this.setVisible(true); try { Selecionado.setSelected(true); } catch (Exception e) { } } public void JanelaNovoCodigo() { EditorInternalFrame N = new EditorInternalFrame(this);//novo frame N.SyntaxHighlight(); Desk.add(N, CAMADACODIGO);//adiciona frame ao frame principal try { N.setVisible(true); N.setSelected(true); //seleciona o frame criado } catch (java.beans.PropertyVetoException e2) { } } public void SalvarJanela() { JInternalFrame Frames[] = Desk.getAllFramesInLayer(CAMADACODIGO.intValue());//pega InternalFrame atual int Resp; String Titulo, Texto, Extensao; File Saida;//Arquivo a ser salvo EscolheArq.resetChoosableFileFilters(); if (Frames.length == 0 || !Frames[0].isSelected()) // não existe frame selecionado em camada de codigo { Frames = Desk.getAllFramesInLayer(CAMADAACESSO.intValue());//pega InternalFrame atual if (Frames.length == 0 || !Frames[0].isSelected()) // não existe frame selecionado em camada de acesso { JOptionPane.showMessageDialog(this, Internacionalizacao.get("Error.Select.Frame"), Internacionalizacao.get("Error.Title"), JOptionPane.ERROR_MESSAGE); return; } else //frame é de acesso direto { EscolheArq.addChoosableFileFilter(new TextFilter()); EscolheArq.setDialogTitle(Internacionalizacao.get("Save.Access.Title"));//titulo do Dialog Titulo = Internacionalizacao.get("Editor.Access.Title") + ": "; Extensao = ".txt"; } } else //frame é de codigo assembly { EscolheArq.addChoosableFileFilter(new AsmFilter()); EscolheArq.setDialogTitle(Internacionalizacao.get("Save.Assembly.Title"));//titulo do Dialog Titulo = Internacionalizacao.get("Editor.Assembly.Title") + ": "; Extensao = ".asm"; } Saida = new File(EscolheArq.getCurrentDirectory(), UltimoArquivo); EscolheArq.setSelectedFile(Saida); Resp = EscolheArq.showSaveDialog(this);//executa o dialog if (Resp == JFileChooser.APPROVE_OPTION)//clicou em ok { Saida = EscolheArq.getSelectedFile();//pega arquivo escolhido if (Saida.getName().lastIndexOf(".") < 0) //sem extensao { Saida = new File(Saida.toString() + Extensao); //adiciona exdtensao } UltimoArquivo = Saida.getName(); Titulo = Titulo + Saida.getName();//pega o nome do arquivo try { Frames[0].setTitle(Titulo);//altera o titulo do frame Texto = Frames[0].toString();//pega o texto FileWriter F = new FileWriter(Saida); F.write(Texto);//grava o texto F.close(); } catch (IOException e) { System.out.println(e); } } } public void AbrirJanela() { String Titulo; File Entrada;//arquivo a ser lido int Rep; EscolheArq.setDialogTitle(Internacionalizacao.get("Open.Title"));//titulo do Dialog EscolheArq.resetChoosableFileFilters(); EscolheArq.addChoosableFileFilter(new TextFilter()); EscolheArq.addChoosableFileFilter(new AsmFilter()); Entrada = new File(EscolheArq.getCurrentDirectory(), UltimoArquivo); EscolheArq.setSelectedFile(Entrada); Rep = EscolheArq.showOpenDialog(this);//executa o dialog if (Rep == JFileChooser.APPROVE_OPTION)//clicou em ok { Entrada = EscolheArq.getSelectedFile();//pega arquivo escolhido Titulo = Entrada.getName();//pega o nome do arquivo UltimoArquivo = Entrada.getName(); EditorInternalFrame Aberto = new EditorInternalFrame(Titulo, this);//cria um frame if (Titulo.substring(Titulo.length() - 4).compareToIgnoreCase(".ASM") == 0) //compara extens�o { Aberto.SyntaxHighlight(); Desk.add(Aberto, CAMADACODIGO);//adiciona o frame ao frame principal Titulo = Internacionalizacao.get("Editor.Assembly.Title") + ": " + Titulo; } else { Desk.add(Aberto, CAMADAACESSO);//adiciona o frame ao frame principal Titulo = Internacionalizacao.get("Editor.Access.Title") + ": " + Titulo; } try { Aberto.setVisible(true); Aberto.setSelected(true); Aberto.LerDoArquivo(Entrada);//lê do arquivo Aberto.setTitle(Titulo); } catch (java.beans.PropertyVetoException e2) { } } } public void JanelaCompCodigo() { JInternalFrame Codigo[]; int Erros[]; int i; String Texto; try { Codigo = Desk.getAllFramesInLayer(CAMADACODIGO.intValue());//pega InternalFrame selecionado na camada certa Texto = Codigo[0].toString();//pega o programa fonte try { Erros = Processador.Compilador(Texto);//compila o programa fonte for (i = 0; i < Erros.length && Erros[i] > 0; i++) //cria mensagem de erro { if (i == 0) { Texto = Internacionalizacao.get("Warning.Invalid.Instruction"); } Texto += Integer.toString(Erros[i]) + " "; } if (i > 0) //houve erros { JOptionPane.showMessageDialog(this, Texto, Internacionalizacao.get("Warning.Title"), JOptionPane.WARNING_MESSAGE); } } catch (Exception e) { System.out.println(e); JOptionPane.showMessageDialog(this, e, Internacionalizacao.get("Error.Title"), JOptionPane.ERROR_MESSAGE); } ExibeRam(Processador.VisualizaRam()); ExibeSimula(); if (!CacheOn) { Output.setVisible(false); } } catch (java.lang.ArrayIndexOutOfBoundsException e) { } } public void ExibeRam(Vector Ram)//cria ou atualiza o frame contendo a MemoriaRam { int i; Vector Tabela = new Vector(); Vector Titulo = new Vector(); Vector Linha; Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); Titulo.add(Internacionalizacao.get("Memory.Position.Abreviation")); Titulo.add(Internacionalizacao.get("Memory.Item.Abreviation")); for (i = 0; i < Ram.size(); i++) { Linha = new Vector(); Linha.add(new Integer(i));//posicao da mem Linha.add(Ram.get(i));//conteúdo da mem Tabela.add(Linha); } if (FrameRam == null)//caso não exista o frame ram { FrameRam = new JInternalFrame(Internacionalizacao.get("Memory.Title"), true, false, false, true) { @Override public void setVisible(boolean b) { super.setVisible(b); try { CheckMenuPrinc.setState(b); } catch (Exception e) { } } }; FrameRam.setBounds(0, 10, 170, ScreenSize.height - 170);//posição e tamanho do frame Desk.add(FrameRam, CAMADAOUTROS);//adiciona frame ao Frame principal } ModeloTabela Modelo = new ModeloTabela(Tabela, Titulo); Table1 = new JTable(Modelo);//cria a tabela JScrollPane T = new JScrollPane(Table1);//cria barra de rolagem FrameRam.getContentPane().removeAll(); //remove todos componentes do Frame FrameRam.getContentPane().add(T);//adiciona Tabela ao InternalFrame try { FrameRam.setVisible(true);//torna frame visivel FrameRam.setSelected(true);//seleciona o frame } catch (java.beans.PropertyVetoException e2) { System.out.println(e2); } Desk.repaint(); this.setVisible(true); } public void ExibeCache() { if (FrameCache == null) { FrameCache = new JInternalFrame(Internacionalizacao.get("Cache.Title"), true, false, false, true) { @Override public void setVisible(boolean b) { super.setVisible(b); try { CheckMenuCache.setState(b); } catch (Exception e) { } } }; FrameCache.setBounds(180, 10, 300, 200); Desk.add(FrameCache, CAMADAOUTROS); } FrameCache.getContentPane().removeAll(); FrameCache.getContentPane().add(new CachePanel(Processador.VisualizaCache())); try { FrameCache.setVisible(true); FrameCache.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e); } Desk.repaint(); this.setVisible(true); } public void ExibeSimula() { Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); if (Output == null) { Output = new JInternalFrame(Internacionalizacao.get("Report.Title"), true, false, false, true) { @Override public void setVisible(boolean b) { super.setVisible(b); try { CheckMenuRel.setState(b); } catch (Exception e) { } } }; Output.setBounds(490, 10, ScreenSize.width - 510, ScreenSize.height - 170); Desk.add(Output, CAMADAOUTROS); } ModeloTabelaRelatorio Mtr = new ModeloTabelaRelatorio(Vet); Relatorio = new JTable(Mtr); TableColumn column = null; for (int i = 0; i < 7; i++) { column = Relatorio.getColumnModel().getColumn(i); if (i == 0) { column.setPreferredWidth(10); //primeira coluna é menor } else { column.setPreferredWidth(50); } if (i == 2 || i == 5) { column.setCellRenderer(new Renderizador(JLabel.CENTER)); } else if (i == 6) { column.setCellRenderer(new Renderizador(JLabel.RIGHT)); } } JScrollPane Scroll = new JScrollPane(Relatorio); Output.getContentPane().removeAll(); if (Resultado == null) { Output.getContentPane().add(Scroll); } else { Resultado.setFont(new Font("Courier New", Font.PLAIN, 12)); JScrollPane Scroll2 = new JScrollPane(Resultado); Scroll2.setBorder(new TitledBorder(Internacionalizacao.get("Report.Results"))); JSplitPane Split = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true); Split.setLeftComponent(Scroll); Split.setRightComponent(Scroll2); Split.setDividerLocation(ScreenSize.height / 2); Split.setOneTouchExpandable(true); Output.getContentPane().add(Split); } if (FramePro == null) { FramePro = new JInternalFrame(Internacionalizacao.get("Processor.Title"), true, false, false, true) { @Override public void setVisible(boolean b) { super.setVisible(b); try { CheckMenuProc.setState(b); } catch (Exception e) { } } }; FramePro.setBounds(180, 220, 300, ScreenSize.height - 380); Desk.add(FramePro, CAMADAOUTROS); } FramePro.getContentPane().removeAll(); FramePro.getContentPane().add(new ProcessorPanel(Processador)); try { FramePro.setVisible(true); FramePro.setSelected(true); Output.setVisible(true); Output.setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e); } FramePro.show(); Desk.repaint(); this.setVisible(true); } public void JanelaSimula() { String Texto = ""; String N[] = new String[30]; String Enderecos[]; JInternalFrame Ac[]; Vector Acessos; int i; int Estado = 0; Ac = Desk.getAllFramesInLayer(CAMADAACESSO.intValue()); try { //se existir janela na camada código selecionada, simule-a if (Ac.length != 0 && Ac[0].isSelected())//caso esteja selecionado { Texto = Ac[0].toString();//pega os endereços a serem acessados Estado = SimulaCache; //simula somente a cache desligando o processador Processador.ZeraCalculos(); Enderecos = Processor.SeparaEmLinhas(Texto);//separa as linhas for (i = 0; i < Enderecos.length; i++) { Acessos = Processador.Acessando(Enderecos[i]); //Acessa posicão de memória Vet.addAll(Acessos);//adiciona Cache Hit ou Miss } } else//simular executando programa da Ram { if (CacheOn) { Estado = SimulaIntegrado; } else { Estado = SimulaProcessador; } Acessos = Processador.Processando();//executa instrução e pega seus resultados while (!Processador.Finis() && Acessos != null)//até q o processador para { Vet.addAll(Acessos);//inclui Acessos = Processador.Processando();//executa instrução e pega seus resultados } if (Acessos != null) { Vet.addAll(Acessos);//inclui } } } catch (Exception e) { System.out.println("Error. MainFrame.JanelaSimula()->" + e); } Texto = Processador.Calcula();//calcula HitRatio, Tempo Medio de Acesso e etc... N = Processor.SeparaEmLinhas(Texto);//separa em linhas Backup2 = new Vector(); for (i = 0; i < N.length; i++) { Backup2.addElement(N[i]);//adiciona } Resultado = new JList(Backup2); ExibeSimula();//refaz a janela com o resultado da simulação ExibeCache();//refaz a janela que exibe a cache ExibeRam(Processador.VisualizaRam()); //refaz a janela que exibe a ram switch (Estado) { case SimulaCache: FramePro.setVisible(false); break; case SimulaProcessador: FrameCache.setVisible(false); Output.setVisible(false); break; case SimulaIntegrado: break; } Backup = Vet; Vet = new Vector();//deixa preparado pro próximo Processador.ZeraCalculos(); } public void SimulaPasso() { String Texto = ""; String N[] = new String[30]; String Enderecos[]; JInternalFrame Ac[]; Vector Acessos; int i, Estouro = -1; int Estado = 0; Ac = Desk.getAllFramesInLayer(CAMADAACESSO.intValue()); Resultado = null; try { if (Ac.length != 0 && Ac[0].isSelected())//caso esteja selecionado { Texto = Ac[0].toString();//pega os endereços a serem acessados Estado = SimulaCache; //simula somente a cache desligando o processador i = Pass++; if (Texto == null || Texto.length() == 0) { return; } Enderecos = Processor.SeparaEmLinhas(Texto);//separa as linhas Estouro = Enderecos.length; //indica quando termina a simulação Acessos = Processador.Acessando(Enderecos[i]); //Acessa posição de memória Vet.addAll(Acessos);//adiciona Cache Hit ou Miss } else { if (CacheOn) { Estado = SimulaIntegrado; } else { Estado = SimulaProcessador; } if (!Processador.Finis()) { Acessos = Processador.Processando(); Vet.addAll(Acessos); } else //terminou simulação { Estouro = Pass; } } } catch (Exception e) { System.out.println("Error. MainFrame.SimulaPasso()->" + e); } ExibeSimula(); if (Pass == Estouro) { Texto = Processador.Calcula(); N = Processor.SeparaEmLinhas(Texto); Backup2 = new Vector(); for (i = 0; i < N.length; i++) { Backup2.addElement(N[i]); } Resultado = new JList(Backup2); Pass = 0; ExibeSimula(); Processador.ZeraCalculos(); Backup = Vet; Vet = new Vector(); } ExibeCache(); ExibeRam(Processador.VisualizaRam()); switch (Estado) { case SimulaCache: FramePro.setVisible(false); break; case SimulaProcessador: FrameCache.setVisible(false); Output.setVisible(false); break; case SimulaIntegrado: break; } } public void AjudaComandos() { int i = 0; JLabel Comandos[] = new JLabel[26]; Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Main")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Prog")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Mov")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Mvi")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Inc")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Dec")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Add")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Sub")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Or")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.And")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Cmp")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Ldi")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Sti")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Ldr")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Str")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Jmp")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Jnz")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Jz")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Call")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Ret")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Push")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Pop")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Nop")); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Halt")); Comandos[i++] = new JLabel(" "); Comandos[i++] = new JLabel(Internacionalizacao.get("Help.Commands.Regs")); if (FrameListCom != null) { Desk.remove(FrameListCom); } FrameListCom = new JInternalFrame(Internacionalizacao.get("Help.Commands.Title"), true, true, true, true); JPanel P = new JPanel(new GridLayout(Comandos.length, 1)); P.setBorder(new TitledBorder(Internacionalizacao.get("Help.Commands.List"))); for (i = 0; i < Comandos.length; i++) { P.add(Comandos[i]); } FrameListCom.getContentPane().add(new JScrollPane(P)); FrameListCom.setDefaultCloseOperation(DISPOSE_ON_CLOSE); FrameListCom.setBounds(100, 100, 300, 300); FrameListCom.pack(); Desk.add(FrameListCom, CAMADAAJUDA); try { FrameListCom.setVisible(true); FrameListCom.setSelected(true); } catch (Exception e) { System.out.println(e); } } public void AjudaSobre() { String Texto; Texto = "JPACS: Java Processor And Cache Simulator - Version 1.6.1\n\n"; Texto += "Daniel de Carvalho\n"; Texto += "Gladyston Batista\n"; Texto += "Henrique Rocha\n"; Texto += "Leonan Vasconcelos\n"; JOptionPane.showMessageDialog(this, Texto, Internacionalizacao.get("Help.About.Title"), 1); } public void SalvaSimula() { File Arq; int i; int Rep; String Titulo; EscolheArq.setDialogTitle(Internacionalizacao.get("Save.Report.Title"));//titulo do Dialog EscolheArq.resetChoosableFileFilters(); EscolheArq.addChoosableFileFilter(new TextFilter()); EscolheArq.addChoosableFileFilter(new XmlFilter()); Arq = new File(EscolheArq.getCurrentDirectory(), UltimoRelatorio); EscolheArq.setSelectedFile(Arq); Rep = EscolheArq.showSaveDialog(this);//executa o dialog if (Rep == JFileChooser.APPROVE_OPTION)//clicou em ok e existe frame selecionado { Arq = EscolheArq.getSelectedFile();//pega arquivo escolhido Titulo = Arq.getName(); UltimoRelatorio = Titulo; if (EscolheArq.getFileFilter().getDescription().equals(Internacionalizacao.get("File.Filter.Xml.Description"))) { if (Titulo.lastIndexOf(".") < 0) { Titulo += ".xml"; Arq = new File(Arq.getPath() + ".xml"); } } else if (EscolheArq.getFileFilter().getDescription().equals(Internacionalizacao.get("File.Filter.Text.Description"))) { if (Titulo.lastIndexOf(".") < 0) { Titulo += ".txt"; Arq = new File(Arq.getPath() + ".txt"); } } try { FileWriter Saida = new FileWriter(Arq); if (Titulo.substring(Titulo.length() - 4).compareToIgnoreCase(".XML") == 0) //compara extensão { JPACSSaxParser Config = new JPACSSaxParser(); Config.parse(ConfigDialog.ConfigFile); String Rel = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!DOCTYPE JPACS SYSTEM \"" + JPACSSaxParser.DtdFileName + "\">" + "\n" + "\n<JPACS>" + Config.toString() + "\n\t<relatorio>"; for (i = 0; i < Backup.size(); i++) { Rel += "\n\t\t" + ((ItemRelatorio) Backup.elementAt(i)).toXml(); } Rel += "\n" + Processador.EstatisticasXml() + "\n\t</relatorio>" + "\n</JPACS>"; Saida.write(Rel); Config.salvarArquivoDtd(Arq.getParent()); } else { Saida.write(Internacionalizacao.get("Report.Access.History") + ": \n\n"); for (i = 0; i < Backup.size(); i++) { Saida.write(Backup.elementAt(i).toString()); Saida.write("\n"); } Saida.write("\n" + Internacionalizacao.get("Report.Results") + ": \n\n"); for (i = 0; i < Backup2.size(); i++) { Saida.write(Backup2.elementAt(i).toString()); Saida.write("\n"); } } Saida.close(); } catch (IOException e1) { System.out.println(e1); } catch (Exception e2) { System.out.println(e2); } } } public void AjudaTopicos() { if (FrameAjuda != null) { Desk.remove(FrameAjuda); } FrameAjuda = new HelpInternalFrame(); Desk.add(FrameAjuda, CAMADAAJUDA); Desk.repaint(); this.setVisible(true); } public void JanelaNovoAcesso() { EditorInternalFrame N = new EditorInternalFrame(this);//novo frame N.setTitle(Internacionalizacao.get("Editor.Access.Title.Default") + " " + N.QuantidadeDeFrames()); Desk.add(N, CAMADAACESSO);//adiciona frame ao frame principal try { N.setVisible(true); N.setSelected(true); //seleciona o frame criado } catch (java.beans.PropertyVetoException e2) { } } }; /** * Filtro para arquivos Texto para os FileChoosers */ class TextFilter extends javax.swing.filechooser.FileFilter { public boolean accept(File f) { String Extensao; int Pos; if (f.isDirectory()) { return true; //mostrar se for um diretorio //não é diretorio, verificar a extensão } Pos = f.toString().lastIndexOf("."); if (Pos >= 0) //possue extensão { Extensao = f.toString().substring(Pos); if (Extensao.compareToIgnoreCase(".TXT") == 0) { return true; //extensão eh txt, aceitar } } //não possue extensão return false; } public String getDescription() { return Internacionalizacao.get("File.Filter.Text.Description"); } }; /** * Filtro para arquivos Assembly para os FileChoosers */ class AsmFilter extends javax.swing.filechooser.FileFilter { public boolean accept(File f) { String Extensao; int Pos; if (f.isDirectory()) { return true; //mostrar se for um diretorio //não é diretorio, verificar a extens�o } Pos = f.toString().lastIndexOf("."); if (Pos >= 0) //possue extensão { Extensao = f.toString().substring(Pos); if (Extensao.compareToIgnoreCase(".ASM") == 0) { return true; //extensão eh asm, aceitar } } //não possue extensão return false; } public String getDescription() { return Internacionalizacao.get("File.Filter.Asm.Description"); } }; /** * Renderizador da tabela de Histórico, faz diferenciação cromática entre Erros, Acertos, Leitura e Gravação */ class Renderizador extends DefaultTableCellRenderer { protected int Align; public Renderizador(int Align) { this.Align = Align; } @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component Comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); try { String V = (String) value; JLabel Lab = (JLabel) Comp; Lab.setHorizontalAlignment(Align); if (V.equals(Internacionalizacao.get("Report.Miss"))) { Lab.setForeground(new Color(128, 0, 0)); } else if (V.equals(Internacionalizacao.get("Report.Hit"))) { Lab.setForeground(new Color(0, 128, 50)); } else if (V.equals(Internacionalizacao.get("Report.Read"))) { Lab.setForeground(new Color(0, 102, 204)); } else if (V.equals(Internacionalizacao.get("Report.Write"))) { Lab.setForeground(new Color(170, 20, 220)); } return Lab; } catch (Exception e) { } return Comp; } }; /** * Listener padrão para o menu de janelas */ class CheckMenuListener implements ActionListener { public JCheckBoxMenuItem Owner; public CheckMenuListener(JCheckBoxMenuItem O) { Owner = O; } public void actionPerformed(ActionEvent e) { } };
package com.isen.regardecommeilfaitbeau; import com.isen.regardecommeilfaitbeau.api.Prevision; import com.isen.regardecommeilfaitbeau.api.meteo.Alert; import com.isen.regardecommeilfaitbeau.api.meteo.Currently; import com.isen.regardecommeilfaitbeau.api.meteo.MeteoDay; import com.isen.regardecommeilfaitbeau.api.meteo.MeteoHour; import com.isen.regardecommeilfaitbeau.exception.NumberHoursOfDayException; import org.json.JSONException; import org.junit.Before; import org.junit.Test; import java.util.ArrayList; import static org.junit.Assert.assertEquals; public class PrevisionTest { private Prevision previsionCoordonate; private Prevision previsionCity; @Before public void makePrevision() throws JSONException, NumberHoursOfDayException { previsionCoordonate = new Prevision(50.72301, 2.73896); previsionCity = new Prevision("Bailleul"); } @Test public void currentlyTest(){ System.out.println("Test Currently"); Currently currentlyCoordonate = previsionCoordonate.getCurrently(); System.out.println(currentlyCoordonate.getSummary()); System.out.println(currentlyCoordonate.getIcon()); Currently currentlyCity = previsionCity.getCurrently(); System.out.println(currentlyCity.getSummary()); System.out.println(currentlyCity.getIcon()); } @Test public void alertsTest(){ System.out.println("Test Alerts"); ArrayList<Alert> alertsCoordonate = previsionCoordonate.getAlerts(); System.out.println(alertsCoordonate.size()); if(!alertsCoordonate.isEmpty()){ System.out.println(alertsCoordonate.get(0).getTitle()); } ArrayList<Alert> alertsCity = previsionCity.getAlerts(); System.out.println(alertsCity.size()); if(!alertsCity.isEmpty()){ System.out.println(alertsCity.get(0).getTitle()); } } @Test public void previsionTest(){ System.out.println("Test Previsions"); ArrayList<MeteoDay> dailyCoordonate = previsionCoordonate.getMeteoDay(); assertEquals(7, dailyCoordonate.size()); for(MeteoDay i:dailyCoordonate){ assertEquals(24, i.getHourByHour().size()); } ArrayList<MeteoDay> dailyCity = previsionCity.getMeteoDay(); assertEquals(7, dailyCity.size()); for(MeteoDay i:dailyCity){ assertEquals(24, i.getHourByHour().size()); } } }
package webmail.managers.emailManagers; import webmail.managers.Manager; import webmail.pages.InboxPage; import webmail.pages.SentPage; import webmail.pages.TrashPage; import webmail.pages.UserFolderPage; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by JOKER on 12/1/14. */ public class RightManager extends Manager { public RightManager(HttpServletRequest request, HttpServletResponse response) { super(request, response); } @Override public void run() { // no right bound now String folder = request.getParameter("folder"); if (folder.equals("inbox")){ InboxPage.increseInbox_pageNum(); try { response.sendRedirect("/"+folder+"?order="+OrderbyManager.order); } catch (IOException e) { e.printStackTrace(); } } if (folder.equals("sent")){ SentPage.increseSent_pageNum(); try { response.sendRedirect("/"+folder+"?order="+OrderbyManager.order); } catch (IOException e) { e.printStackTrace(); } } if (folder.equals("trash")){ TrashPage.increseTrash_pageNum(); try { response.sendRedirect("/"+folder+"?order="+OrderbyManager.order); } catch (IOException e) { e.printStackTrace(); } } if (!folder.equals("inbox") && !folder.equals("sent") && !folder.equals("trash")){ UserFolderPage.increseUserFolder_pageNum(); try { response.sendRedirect("/userFolder?folder="+folder+"&order="+OrderbyManager.order); } catch (IOException e) { e.printStackTrace(); } } } }
package com.smartwerkz.bytecode.vm.methods; import com.smartwerkz.bytecode.primitives.JavaObject; import com.smartwerkz.bytecode.vm.Frame; import com.smartwerkz.bytecode.vm.OperandStack; import com.smartwerkz.bytecode.vm.RuntimeDataArea; public class ClassClone implements NativeMethod { @Override public void execute(RuntimeDataArea rda, Frame frame, OperandStack otherOperandStack) { JavaObject thisObject = frame.getLocalVariables().getLocalVariable(0); JavaObject copy = thisObject.copy(); otherOperandStack.push(copy); } }
package com.jim.multipos.ui.mainpospage.presenter; import com.jim.multipos.core.Presenter; import com.jim.multipos.data.db.model.customer.Customer; import com.jim.multipos.data.db.model.customer.Debt; import com.jim.multipos.data.db.model.order.Order; import com.jim.multipos.data.db.model.order.PayedPartitions; import java.util.List; /** * Created by Portable-Acer on 27.10.2017. */ public interface PaymentPresenter extends Presenter { void onDebtBorrowClicked(); void changePayment(int positionPayment); void removePayedPart(int removedPayedPart); void incomeNewData(Order order, List<PayedPartitions> payedPartitions); void typedPayment(double paymentTyped); void pressFirstOptional(); void pressSecondOptional(); void pressAllAmount(); void payButtonPressed(); void setCustomer(Customer customer); void onDebtSave(Debt debt); void onClickedTips(); void onNewOrder(); void sendDataToPaymentFragmentWhenEdit(Order order, List<PayedPartitions> payedPartitions, Debt debt); void onHoldOrderClicked(); }
package com.ua.serg.alex.buy.any.things.services.impl; import com.ua.serg.alex.buy.any.things.dao.ShoppingCartDao; import com.ua.serg.alex.buy.any.things.model.User; import com.ua.serg.alex.buy.any.things.model.ShoppingCart; import com.ua.serg.alex.buy.any.things.model.ShoppingCartDetail; import com.ua.serg.alex.buy.any.things.services.ShoppingCartService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Transactional @Service public class ShoppingCartServiceImpl implements ShoppingCartService { @Autowired private ShoppingCartDao shoppingCartDao; @Override public List<ShoppingCart> findAllShoppingCarts() { return shoppingCartDao.getAllShoppingCarts(); } @Override public ShoppingCart findShoppingCart(int id) { return shoppingCartDao.getShoppingCartById(id); } @Override public ShoppingCart findUserShoppingCart(User user) { return shoppingCartDao.getUserShoppingCart(user); } @Override public ShoppingCartDetail findShoppingCartDetail(int id) { return shoppingCartDao.getShoppingCartDetail(id); } @Override public void removeShoppingCart(ShoppingCart shoppingCart) { shoppingCartDao.deleteShoppingCart(shoppingCart); } }
package sample; import javafx.animation.Timeline; import javafx.scene.Group; import java.io.Serializable; public abstract class Obstacle implements Serializable { protected Ball ball; protected Game g; protected double pos; protected transient Group grp; protected transient Timeline timeline; protected transient Timeline hit; Obstacle(Ball ball,Game g,double pos){ this.grp=new Group(); this.ball=ball; this.g=g; this.pos=pos; this.timeline=new Timeline(); this.hit=new Timeline(); } public Ball getBall() { return ball; } public Game getG() { return g; } public double getPos() { return pos; } public Group getGrp() { return grp; } public Timeline getTimeline() { return timeline; } public Timeline getHit() { return hit; } public void animation_pause(){ timeline.pause(); } public void animation_play(){ timeline.play(); } public abstract void create(); public abstract void detect_hit(); }
package parser; import java.util.regex.MatchResult; import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexParser implements Parser<MatchResult> { private final Pattern pattern; public RegexParser(Pattern pattern) { this.pattern = pattern; } public ParseResult<MatchResult> parse(String in) { Matcher matcher = pattern.matcher(in); if (matcher.lookingAt()) { return new ParseResult<>(matcher.toMatchResult(), in.substring(matcher.end())); } else { throw new RuntimeException("got '" + in + "'; expected '" + pattern.pattern() + "'"); } } }
package org.springframework.data.rest.webmvc.u2ware.multipart; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.net.URLConnection; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; //import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.util.FileCopyUtils; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.util.UriComponentsBuilder; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Charsets; public class MultipartService { protected Log logger = LogFactory.getLog(getClass()); private ObjectMapper objectMapper; private String location; public MultipartService(String location){ this.location = location; this.objectMapper = new ObjectMapper(); this.objectMapper.configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true); } //////////////////////////////////////// // //////////////////////////////////////// public Multipart upload(MultipartFile src, String... paths) throws Exception{ return upload(src.getOriginalFilename(), src, paths); } public Multipart upload(String name, MultipartFile src, String... paths) throws Exception{ File metadata = metadata(paths); Multipart m = metadata.exists() ? objectMapper.readValue(metadata, Multipart.class) : new Multipart(); File resource = resource(paths); copyFile(src.getInputStream(), resource); m.setId(paths(paths)); m.setName(name); m.setSize(src.getSize()); m.setType(src.getContentType()); m.setLastModified(resource.lastModified()); objectMapper.writeValue(metadata, m); logger.info("UPLOAD: "+m.toString()); logger.info("UPLOAD: "+resource.getAbsolutePath()); return m; } public Multipart upload(Resource src, String... paths) throws Exception{ return upload(src.getFilename(), src, paths); } public Multipart upload(String name, Resource src, String... paths) throws Exception{ File metadata = metadata(paths); Multipart m = metadata.exists() ? objectMapper.readValue(metadata, Multipart.class) : new Multipart(); File resource = resource(paths); copyFile(src.getInputStream(), resource); m.setId(paths(paths)); m.setName(name); m.setType(URLConnection.guessContentTypeFromName(src.getFilename())); m.setSize(resource.length()); m.setLastModified(resource.lastModified()); objectMapper.writeValue(metadata, m); logger.info("UPLOAD: "+m.toString()); logger.info("UPLOAD: "+resource.getAbsolutePath()); return m; } public Multipart upload(MultipartContent src, String... paths) throws Exception{ return upload(src.getName(), src, paths); } public Multipart upload(String name, MultipartContent src, String... paths) throws Exception{ File metadata = metadata(paths); Multipart m = metadata.exists() ? objectMapper.readValue(metadata, Multipart.class) : new Multipart(); File resource = resource(paths); copyFile(new ByteArrayInputStream(src.getContent().getBytes(Charsets.UTF_8)), resource); m.setId(paths(paths)); if(name != null) m.setName(name); if(src.getType() != null) m.setType(src.getType()); m.setSize(resource.length()); m.setLastModified(resource.lastModified()); objectMapper.writeValue(metadata, m); logger.info("UPLOAD: "+m.toString()); logger.info("UPLOAD: "+resource.getAbsolutePath()); return m; } //////////////////////////////////////// // //////////////////////////////////////// public Multipart download(String... paths) throws Exception{ File metadata = metadata(paths); if(! metadata.exists()) throw new FileNotFoundException(); Multipart m = objectMapper.readValue(metadata, Multipart.class); File resource = resource(paths); if(! resource.exists()) throw new FileNotFoundException(); m.setId(paths(paths)); m.setResource(new FileSystemResource(resource, m.getName())); logger.info("DOWNLOAD: "+m.toString()); logger.info("DOWNLOAD: "+resource.getAbsolutePath()); return m; } public List<Multipart> downloads(String... paths) throws Exception{ List<Multipart> r = new ArrayList<Multipart>(); File metadata = metadata(paths); if(metadata.exists()) { Multipart m = objectMapper.readValue(metadata, Multipart.class); m.setId(paths(paths)); r.add(m); } File root = location(paths); File[] childs = root.listFiles(); for(File child : childs){ String[] childPaths = Arrays.copyOf(paths, paths.length+1); childPaths[paths.length] = child.getName(); metadata = metadata(childPaths); if(metadata.exists()) { Multipart m = objectMapper.readValue(metadata, Multipart.class); m.setId(paths(childPaths)); r.add(m); } } return r; } public Multipart delete(String... paths) throws Exception { File metadata = metadata(paths); if(! metadata.exists()) throw new FileNotFoundException(); Multipart m = objectMapper.readValue(metadata, Multipart.class); File location = location(paths); deleteFile(location); logger.info("DELETE: "+m.toString()); logger.info("DELETE: "+location.getAbsolutePath()); m.setId(paths(paths)); return m; } //////////////////////////////////////// // //////////////////////////////////////// protected String paths(String... paths){ UriComponentsBuilder builder = UriComponentsBuilder.newInstance(); builder.pathSegment(paths); return builder.toUriString(); } protected File location(String... paths){ return new File(new File(location), paths(paths)); } protected File metadata(String... paths){ return new File(location(paths), "metadata"); } protected File resource(String... paths){ return new File(location(paths), "resource"); } private boolean copyFile(InputStream in, File out) throws Exception{ File dir = out.getParentFile(); if(! dir.exists()){ dir.mkdirs(); } FileCopyUtils.copy(in, new FileOutputStream(out)); return true; } private boolean deleteFile(File path) throws Exception{ if(!path.exists()) { return false; } File[] files = path.listFiles(); for (File file : files) { if (file.isDirectory()) { deleteFile(file); } else { file.delete(); } } return path.delete(); } }
package com.example.shivam.erpsystem.Fragment; import android.app.Activity; import android.app.Dialog; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.app.Fragment; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.TextView; import com.example.shivam.erpsystem.Adapter.CategoryAdapter; import com.example.shivam.erpsystem.Adapter.CustomerAdapter; import com.example.shivam.erpsystem.Model.CategoryModel; import com.example.shivam.erpsystem.Model.CustomerModel; import com.example.shivam.erpsystem.R; import java.util.ArrayList; import java.util.List; public class CustomerFragment extends Fragment{ private RecyclerView recyclerView; private CustomerAdapter adapter; private List<CustomerModel> albumList; EditText CustomerName,CustomerEmailId, CustomerAddress, CustomerMobileNo, CustomerGSTNo, CustomerPancarNo; TextView CustomerDetails; public CustomerFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View customerfragment = inflater.inflate(R.layout.fragment_customer, container, false); CustomerName = customerfragment.findViewById(R.id.Add_Customer_Name); CustomerEmailId = customerfragment.findViewById(R.id.Add_Customer_EmailId); CustomerAddress = customerfragment.findViewById(R.id.Add_Customer_Address); CustomerMobileNo = customerfragment.findViewById(R.id.Add_Customer_Mobile_Number); CustomerGSTNo = customerfragment.findViewById(R.id.Add_Supplier_GST_Number); CustomerPancarNo = customerfragment.findViewById(R.id.Add_Customer_PAN_Card_Number); FloatingActionButton fab = (FloatingActionButton)customerfragment.findViewById(R.id.FabButton);fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Dialog addcustomer=new Dialog(getActivity()); addcustomer.setContentView(R.layout.customeraddlayout); addcustomer.show(); } }); recyclerView = customerfragment.findViewById(R.id.customerRecycler); albumList = new ArrayList<>(); adapter = new CustomerAdapter(getActivity(), albumList); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.setHasFixedSize(true); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setAdapter(adapter); CustomerModel customerModel = new CustomerModel(1, "yogita" ,47683 , "nagar",7673,3546); albumList.add(customerModel); customerModel = new CustomerModel(1, "yogita" ,47683 , "nagar",7673,3546); albumList.add(customerModel); customerModel = new CustomerModel(1, "yogita" ,47683 , "nagar",7673,3546); albumList.add(customerModel); customerModel = new CustomerModel(1, "yogita" ,47683 , "nagar",7673,3546); albumList.add(customerModel); customerModel = new CustomerModel(1, "yogita" ,47683 , "nagar",7673,3546); albumList.add(customerModel); return customerfragment; } }
package com.tencent.mm.plugin.search.b.a.a; import android.content.Context; import android.content.Intent; import com.tencent.mm.bg.d; import com.tencent.mm.kernel.g; import com.tencent.mm.plugin.appbrand.n.e; import com.tencent.mm.plugin.fts.a.d.a.b; import com.tencent.mm.plugin.fts.a.n; import com.tencent.mm.plugin.fts.ui.a.j; public final class a implements b { public final boolean a(Context context, com.tencent.mm.plugin.fts.a.d.a.a aVar) { j jVar = (j) aVar; ((n) g.n(n.class)).updateTopHitsRank(jVar.jrx.jrV, jVar.fyJ, 0); if (!((e) g.l(e.class)).uo(jVar.jyt.field_url)) { Intent intent; if (jVar.jyt.field_actionType == 2) { intent = new Intent(); intent.putExtra("rawUrl", jVar.jyt.field_url); d.b(context, "webview", ".ui.tools.WebViewUI", intent); } else if (!com.tencent.mm.plugin.search.a.a.L(context, jVar.jyt.field_featureId)) { intent = new Intent(); intent.putExtra("rawUrl", jVar.jyt.field_updateUrl); d.b(context, "webview", ".ui.tools.WebViewUI", intent); } } return true; } }
import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.PrintWriter; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; import java.util.Base64; import java.util.Date; import java.util.HashMap; import java.util.concurrent.ConcurrentLinkedQueue; public class BlockchainCatchUpRunnable implements Runnable { private ServerInfo server; private Blockchain blockchain; String message; private ConcurrentLinkedQueue<Block> waitingBlocks; public BlockchainCatchUpRunnable(ServerInfo server, Blockchain blockchain, String message, ConcurrentLinkedQueue<Block> waitingBlocks) { this.blockchain = blockchain; this.server = server; this.message = message; this.waitingBlocks = waitingBlocks; } @Override public void run() { try { if(message.equals("cu")){ Socket localSocket = new Socket(); localSocket.connect(new InetSocketAddress(server.getHost(), server.getPort())); PrintWriter printWriter = new PrintWriter(localSocket.getOutputStream(), true); printWriter.println(message); ObjectOutputStream oos = new ObjectOutputStream(localSocket.getOutputStream()); ObjectInputStream ois = new ObjectInputStream(localSocket.getInputStream()); Block returnBlock = (Block) ois.readObject(); if(returnBlock == null) { localSocket.close(); ois.close(); return; } blockchain.setHead(returnBlock); int length = blockchain.getLength()+1; blockchain.setLength(length); ois.close(); localSocket.close(); } } catch (Exception e) { // TODO Auto-generated catch block } } }
package jc.sugar.JiaHui.entity; import org.apache.jmeter.samplers.SampleResult; import java.util.Date; import java.util.concurrent.ConcurrentLinkedDeque; /** * @Code 谢良基 2021/7/2 */ public class SugarReport { private Integer id; private String name; private Integer testPlanId; private Date startTime; private Date endTime; private Integer creatorId; private SugarAccount creator; private Date createTime; private SugarTestPlan testPlan; private ReportStatus status; private String sampleResults; private String description; private ConcurrentLinkedDeque<SampleResult> sampleResultDeque; public SugarReport(){ this.sampleResultDeque = new ConcurrentLinkedDeque<>(); } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getTestPlanId() { return testPlanId; } public void setTestPlanId(Integer testPlanId) { this.testPlanId = testPlanId; } public Date getStartTime() { return startTime; } public void setStartTime(Date startTime) { this.startTime = startTime; } public Date getEndTime() { return endTime; } public void setEndTime(Date endTime) { this.endTime = endTime; } public Integer getCreatorId() { return creatorId; } public void setCreatorId(Integer creatorId) { this.creatorId = creatorId; } public SugarAccount getCreator() { return creator; } public void setCreator(SugarAccount creator) { this.creator = creator; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public SugarTestPlan getTestPlan() { return testPlan; } public void setTestPlan(SugarTestPlan testPlan) { this.testPlan = testPlan; } public ReportStatus getStatus() { return status; } public void setStatus(ReportStatus status) { this.status = status; } public String getSampleResults() { return sampleResults; } public void setSampleResults(String sampleResults) { this.sampleResults = sampleResults; } public ConcurrentLinkedDeque<SampleResult> getSampleResultDeque() { return sampleResultDeque; } public void setSampleResultDeque(ConcurrentLinkedDeque<SampleResult> sampleResultDeque) { this.sampleResultDeque = sampleResultDeque; } public enum ReportStatus{ FAIL, SUCCESS } }
package com.moon.institution.serviceimpl; import org.junit.Test; import org.junit.Before; import org.junit.After; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * Copyright (c) by www.leya920.com * All right reserved. * Create Date: //TODO need edit * Create Author: //TODO need edit * Last version: 1.0 * Last Update Date: //TODO need edit * Last Update Log: //TODO need edit * Comment: InstitutionServiceImpl Tester. **/ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath*:/META-INF/config/spring/spring-service.xml" }) public class InstitutionServiceImplTest { @Before public void before() throws Exception { } @After public void after() throws Exception { } /** * * Method: getInstitutionByItem(String id) * */ @Test public void testGetInstitutionByItem() throws Exception { //TODO: Test goes here... } }
package com.spbsu.flamestream.runtime.master.acker.api.commit; import com.spbsu.flamestream.core.data.meta.GlobalTime; public class Prepare { private final GlobalTime globalTime; public Prepare(GlobalTime globalTime) { this.globalTime = globalTime; } public GlobalTime globalTime() { return globalTime; } @Override public String toString() { return "Prepare{" + "globalTime=" + globalTime + '}'; } }
package com.itheima.redbaby.ui; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.opengl.Visibility; import android.view.View; import android.view.View.OnClickListener; import android.widget.RelativeLayout; import android.widget.TextView; import com.itheima.redbaby.ConstantValue; import com.itheima.redbaby.GloableParameters; import com.itheima.redbaby.R; import com.itheima.redbaby.bean.Version; import com.itheima.redbaby.bean.VersionItem; import com.itheima.redbaby.engine.CheckVersionEngine; import com.itheima.redbaby.ui.manager.BaseView; import com.itheima.redbaby.ui.manager.MiddleManager; import com.itheima.redbaby.utils.BeanFactory; import com.itheima.redbaby.utils.Logger; import com.itheima.redbaby.utils.PromptManager; /** * 账户中心 * * @author zl 用户登录、注册、订单管理、地址管理、检查升级和收藏夹的入口 */ public class MyCountView extends BaseView implements OnClickListener { private static final String TAG = "MyCountView"; private RelativeLayout login; private RelativeLayout register; private RelativeLayout order_list; private RelativeLayout address_manage; private RelativeLayout favorites; private RelativeLayout rl_update; private RelativeLayout login_title; private RelativeLayout logout_title; private RelativeLayout dl_logout; private RelativeLayout logout; private TextView my_name; private TextView my_bonus; private TextView my_level; public MyCountView(Context context) { super(context); } @Override protected void loadMiddleLayout() { middleView = View.inflate(context, R.layout.dl_mycount, null); } @Override protected void findViewById() { getView(); } private void getView() { login = (RelativeLayout) middleView.findViewById(R.id.dl_my_login_manage); register = (RelativeLayout) middleView.findViewById(R.id.dl_my_register_manage); order_list = (RelativeLayout) middleView.findViewById(R.id.dl_my_count_center); address_manage = (RelativeLayout) middleView.findViewById(R.id.dl_my_address_manage); favorites = (RelativeLayout) middleView.findViewById(R.id.dl_my_favorites_manage); rl_update = (RelativeLayout) middleView.findViewById(R.id.dl_check_update); dl_logout = (RelativeLayout) middleView.findViewById(R.id.dl_logout); } @Override protected void setListener() { login.setOnClickListener(this); register.setOnClickListener(this); order_list.setOnClickListener(this); address_manage.setOnClickListener(this); favorites.setOnClickListener(this); rl_update.setOnClickListener(this); dl_logout.setOnClickListener(this);//退出登录点击监听 } @Override public void onClick(View v) { switch (v.getId()) { //退出登录 case R.id.dl_logout: Logger.i(TAG,"退出登录!"); GloableParameters.USER_ID = 0; MiddleManager.getInstance().changeView(HomeView.class, null); PromptManager.showToast(context, "退出登录!"); break; // 进入登录页面 case R.id.dl_my_login_manage: MiddleManager.getInstance().changeView(LoginView.class, null); break; // 进入注册页面 case R.id.dl_my_register_manage: MiddleManager.getInstance().changeView(RegisterView.class, null); break; // 进入 订单中心 case R.id.dl_my_count_center: if (GloableParameters.USER_ID > 0) { MiddleManager.getInstance().changeView(OrderView.class, null); } else { PromptManager.showToast(context, "您还未登录,请登录!"); MiddleManager.getInstance().changeView(LoginView.class, null); } break; // 进入地址管理 case R.id.dl_my_address_manage: if (GloableParameters.USER_ID > 0) { MiddleManager.getInstance().changeView(MyAddressList.class, null); } else { PromptManager.showToast(context, "您还未登录,请登录!"); MiddleManager.getInstance().changeView(LoginView.class, null); } break; // 进入收藏夹 case R.id.dl_my_favorites_manage: if (GloableParameters.USER_ID > 0) { MiddleManager.getInstance().changeView(FavoriteView.class, null); } else { PromptManager.showToast(context, "您还未登录,请登录!"); MiddleManager.getInstance().changeView(LoginView.class, null); } break; // 进入检查升级 case R.id.dl_check_update: // if (GloableParameters.USER_ID > 0) { // MiddleManager.getInstance().changeView(CheckUpdate.class, null); String currentVersion = GloableParameters.VERSION; Logger.i(TAG, "当前的版本号是:"+currentVersion); new MyHttpTask<Void>() { protected void onPreExecute() { PromptManager.showToast(context, "正在检查版本更新..."); }; @Override protected Object doInBackground(Void... params) { CheckVersionEngine checkVersionEngine = BeanFactory.getFactory().getInstance(CheckVersionEngine.class); return checkVersionEngine.getVersion(); } protected void onPostExecute(Object result) { Version version = (Version) result; VersionItem versionItem = version.getVersion(); if ("true".equals(versionItem.getIsnew())) { // 是有新版本 downNewVersion(versionItem.getUrl()); } else { // 没有新版本 PromptManager.showToast(context, "当前是最新版本"); } } }.executeProxy(); // } else { // PromptManager.showToast(context, "您还未登录,请登录!"); // MiddleManager.getInstance().changeView(LoginView.class, null); // } break; } } @Override protected void processEngine() { // TODO Auto-generated method stub } @Override protected int getID() { return ConstantValue.MYCOUNTVIEW; } /* * @Override public void onClick(View v) { switch (v.getId()) { case * R.id.tv_my_address_in: //点击进入我的地址 * MiddleManager.getInstance().changeView(MyNewAddress.class, null); * * break; * * default: break; } * * } */ private void downNewVersion(String url) { // TODO Auto-generated method stub AlertDialog.Builder builder = new Builder(context); builder.setTitle("更新提示"); builder.setCancelable(false); builder.setMessage("有新版本是否更新?"); builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.setNegativeButton("取消", null); builder.show(); }; /** * 登录后,显示用户信息 */ @Override public void onResume() { Logger.i(TAG,GloableParameters.USER_ID+""); login_title = (RelativeLayout) middleView.findViewById(R.id.dl_my_account_login_title); logout_title = (RelativeLayout) middleView.findViewById(R.id.dl_my_account_logout_title); dl_logout = (RelativeLayout) middleView.findViewById(R.id.dl_logout); my_name = (TextView) middleView.findViewById(R.id.dl_my_name_text); my_name = (TextView) middleView.findViewById(R.id.dl_my_name_text); my_bonus = (TextView) middleView.findViewById(R.id.dl_my_bonus_text); my_level = (TextView) middleView.findViewById(R.id.dl_my_level_text); if(GloableParameters.USER_ID>0){ Logger.i(TAG,"登录成功,跳转至主页!"); // middleView = View.inflate(context, R.layout.dl_mycount, null); login_title.setVisibility(View.VISIBLE); logout_title.setVisibility(View.GONE); dl_logout.setVisibility(View.VISIBLE); my_name.setText(GloableParameters.USER_NAME); my_bonus.setText(String.valueOf(GloableParameters.BONUS)); my_level.setText(String.valueOf(GloableParameters.LEVEL)); }else{ login_title.setVisibility(View.GONE); logout_title.setVisibility(View.VISIBLE); dl_logout.setVisibility(View.GONE); } super.onResume(); } }
package com.chenyou.noveleditor.data; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annotation.Nullable; public class BookDatabase extends SQLiteOpenHelper { public static final String TABLE_NAME = "books";//用书籍名称作为表名 public static final String BOOK_ICON = "book_icon";//书籍封面图片的路径 public static final String BOOK_NAME = "book_name";//用书籍名称作为表名 public static final String BOOK_NEWCHAPTER = "book_newchapter";//最新章节名称 public static final String BOOK_DATE = "book_date";//日期 public static final String BOOK_PATH = "book_path";//书籍保存路径 public static final String ID = "_id";//表格的id,主键的字符必须子在前面加上_ private Context context; /** * 方式1 * 创建表格 */ public static final String CREATE_BOOK = "CREATE TABLE " + TABLE_NAME + "(" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + BOOK_ICON + " TEXT," + BOOK_NAME + " TEXT," + BOOK_NEWCHAPTER + " TEXT," + BOOK_DATE + " TEXT," + BOOK_PATH + " TEXT )"; public BookDatabase(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) { super(context, name, null, version); this.context = context; } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_BOOK); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }
package com.tencent.mm.plugin.webview.fts; import android.os.Bundle; import android.os.RemoteException; import com.tencent.mm.plugin.webview.ui.tools.jsapi.g; import com.tencent.mm.plugin.webview.ui.tools.jsapi.h; import com.tencent.mm.sdk.platformtools.x; import java.util.ArrayList; class d$2 implements Runnable { final /* synthetic */ d pOF; final /* synthetic */ String pOJ; final /* synthetic */ ArrayList pOK; d$2(d dVar, String str, ArrayList arrayList) { this.pOF = dVar; this.pOJ = str; this.pOK = arrayList; } public final void run() { g Bh = h.Bh(this.pOF.pOy.dFC.bWo); String str = this.pOF.pOy.dFC.bHt; String str2 = this.pOJ; x.i("MicroMsg.MsgHandler", "onSearchSuggestCallback: %s", new Object[]{this.pOK.toString()}); Bundle bundle = new Bundle(); bundle.putString("query", str); bundle.putString("suggestionId", str2); bundle.putStringArrayList("result", r3); try { if (Bh.pRY != null) { Bh.pRY.c(127, bundle); } } catch (RemoteException e) { x.w("MicroMsg.MsgHandler", "onSearchSuggestCallback exception" + e.getMessage()); } } }
package org.jboss.perf.test.client.monitor; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.log4j.Logger; import org.jboss.perf.test.client.communicator.Communicator; import org.jboss.perf.test.client.communicator.Method; import org.jboss.perf.test.client.config.BaseConfig; import com.google.gson.Gson; import org.jboss.perf.test.objects.constants.Format; import org.jboss.perf.test.objects.constants.RelURL; import org.jboss.perf.test.objects.objects.AttrResultData; import org.jboss.perf.test.objects.objects.Attribute; import org.jboss.perf.test.objects.objects.LastTestRunData; import org.jboss.perf.test.objects.objects.Result; public class MonitorCore { private static final Logger logger = Logger.getLogger(MonitorCore.class); private static MonitorCore core; private Communicator communicator; private BaseConfig config; private Long testRunId; private Long testSuiteRunId; private final Gson gson; private final SimpleDateFormat sdf; private AttrResultData attrResultData; // buffer public MonitorCore() { communicator = new Communicator(); gson = new Gson(); sdf = new SimpleDateFormat(Format.DATE_TIME); attrResultData = new AttrResultData(); } public static synchronized MonitorCore getInstance() { if (core == null) { core = new MonitorCore(); } return core; } public MonitorCore initialize(BaseConfig config) { this.config = config; return this; } public BaseConfig getConfig() { return config; } public Communicator getCommunicator() { return communicator; } public Long getTestRunId() { return testRunId; } public void setTestRunId(Long testRunId) { this.testRunId = testRunId; } public Long getTestSuiteRunId() { return testSuiteRunId; } public void setTestSuiteRunId(Long testSuiteRunId) { this.testSuiteRunId = testSuiteRunId; } public Gson getGson() { return gson; } public SimpleDateFormat getSdf() { return sdf; } public AttrResultData getAttrResultData() { return attrResultData; } public void setAttrResultData(AttrResultData attrResultData) { this.attrResultData = attrResultData; } public void addMeasuredAttributeToAttrResultData(String att, String unit, Double value) { Attribute attribute = new Attribute(unit); attribute.getResults().add(new Result(sdf.format(new Date()), value)); attrResultData.getAttrResult().put(att, attribute); } public void sendLastTestRunData(String description, boolean success, String error, String parameters) { LastTestRunData lastTestRunData = new LastTestRunData(description, success, error, parameters); String data = gson.toJson(lastTestRunData, LastTestRunData.class); communicator.setUpConnection(config.getRepUrl() + RelURL.TEST_RUN_FINISH + testRunId, Method.POST); logger.debug("SEND LAST METHOD DATA"); // answer is always null communicator.sendDataAndReceiveAnswer(data); } }