java.lang.Override Java Examples
The following examples show how to use
java.lang.Override.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NullableValueVectors.java From Bats with Apache License 2.0 | 6 votes |
@Override public void copyEntry(int toIndex, ValueVector from, int fromIndex) { <#if type.major == "VarLen"> mutator.fillEmpties(toIndex); </#if> // Handle the case of not-nullable copied into a nullable if (from instanceof ${minor.class}Vector) { bits.getMutator().setSafe(toIndex,1); values.copyFromSafe(fromIndex,toIndex,(${minor.class}Vector)from); return; } Nullable${minor.class}Vector fromVector = (Nullable${minor.class}Vector) from; <#if type.major == "VarLen"> // This method is to be called only for loading the vector // sequentially, so there should be no empties to fill. </#if> bits.copyFromSafe(fromIndex, toIndex, fromVector.bits); values.copyFromSafe(fromIndex, toIndex, fromVector.values); }
Example #2
Source File: LaunchActivity.java From tysq-android with GNU General Public License v3.0 | 6 votes |
@Override public void onGetUpdateInfo(UpdateResp value) { if (value.getUpdateType() == Constant.UpdateType.NONE) { goToMainActivity(); return; } UpdateDialog fragment = UpdateDialog.newInstance(); fragment.setVersion("V" + value.getLatestVersion()); StringBuilder featureBuilder = new StringBuilder(); for (int i = 0; i < value.getNewFeatures().size(); i++) { featureBuilder.append(value.getNewFeatures().get(i)); if (i < value.getNewFeatures().size() - 1) { featureBuilder.append("\n"); } } fragment.setVersionFeature(featureBuilder.toString()); int updateType = value.getUpdateType(); fragment.setShowClose(updateType == Constant.UpdateType.ORDINARY); fragment.show(this); }
Example #3
Source File: VariableLengthVectors.java From Bats with Apache License 2.0 | 6 votes |
@Override public int getPayloadByteCount(int valueCount) { if (valueCount == 0) { return 0; } // If 1 or more values, then the last value is set to // the offset of the next value, which is the same as // the length of existing values. // In addition to the actual data bytes, we must also // include the "overhead" bytes: the offset vector entries // that accompany each column value. Thus, total payload // size is consumed text bytes + consumed offset vector // bytes. return offsetVector.getAccessor().get(valueCount) + offsetVector.getPayloadByteCount(valueCount); }
Example #4
Source File: InterfaceOk2Derived_LifecycleAdapter.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
@Override public void callMethods(LifecycleOwner owner, Lifecycle.Event event, boolean onAny, MethodCallsLogger logger) { boolean hasLogger = logger != null; if (onAny) { return; } if (event == Lifecycle.Event.ON_STOP) { if (!hasLogger || logger.approveCall("onStop1", 2)) { mReceiver.onStop1(owner); } if (!hasLogger || logger.approveCall("onStop2", 2)) { mReceiver.onStop2(owner); } if (!hasLogger || logger.approveCall("onStop3", 2)) { mReceiver.onStop3(owner); } return; } }
Example #5
Source File: StringOutputRecordWriter.java From Bats with Apache License 2.0 | 5 votes |
@Override public void writeField() throws IOException { <#if mode.prefix == "Nullable" > if (!reader.isSet()) { addField(fieldId, null); return; } <#elseif mode.prefix == "Repeated" > throw new UnsupportedOperationException("Repeated types are not supported."); }
Example #6
Source File: SocksIPv6Test.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@BeforeClass public void setUp() throws Exception { shouldRun = ensureInet6AddressFamily() && ensureIPv6OnLoopback(); server = HttpServer.create(new InetSocketAddress(0), 0); server.createContext("/", ex -> { ex.sendResponseHeaders(200, response.length()); try (BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(ex.getResponseBody(), "UTF-8"))) { writer.write(response); } ex.close(); }); server.start(); socks = new SocksServer(0, false); socks.addUser("user", "pass"); socks.start(); Authenticator.setDefault(new Authenticator() { @Override protected java.net.PasswordAuthentication getPasswordAuthentication() { return new java.net.PasswordAuthentication( "user", "pass".toCharArray()); } }); }
Example #7
Source File: RepeatedValueVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public void allocateNew(int valueCount, int innerValueCount) { clear(); try { offsets.allocateNew(valueCount + 1); values.allocateNew(innerValueCount); } catch(OutOfMemoryException e){ clear(); throw e; } offsets.zeroVector(); mutator.reset(); }
Example #8
Source File: RepeatedValueVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public void generateTestData(final int valCount) { final int[] sizes = {1, 2, 0, 6}; int size = 0; int runningOffset = 0; final UInt4Vector.Mutator offsetsMutator = offsets.getMutator(); for(int i = 1; i < valCount + 1; i++, size++) { runningOffset += sizes[size % sizes.length]; offsetsMutator.set(i, runningOffset); } values.getMutator().generateTestData(valCount * 9); setValueCount(size); }
Example #9
Source File: MyCoinFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override public void onGetCoin(MyCoinDetailResp value, boolean isFirst) { myCoinResp.setCount(TyUtils.formatDotNum(value.getTotalNumber())); myCoinResp.setCountNum(value.getTotalNumber()); onHandleResponseData(value.getDetailsInfo(), isFirst); }
Example #10
Source File: RepeatedValueVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public void allocateNew() { try { offsets.allocateNew(); values.allocateNew(); } catch (OutOfMemoryException e) { clear(); throw e; } offsets.zeroVector(); mutator.reset(); }
Example #11
Source File: ReportDetailFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override public void getReportDetail(ReportDetailResp resp) { tvArticleTitle.setText(resp.getTitle()); tvReportContent.setText(resp.getType()); tvReportDescription.setText(resp.getNote()); tvReportResult.setText(resp.getResult()); tvResultDescription.setText(resp.getProcessReason()); if (resp.getProcessReason().trim().length() <= 0){ llHandelResult.setVisibility(View.GONE); } tvReportNum.setText(resp.getReportId()); mArticleId = resp.getArticleId(); }
Example #12
Source File: CloudUploadingFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override protected void registerDagger() { DaggerCloudUploadingComponent.builder() .appComponent(TyApplication.getAppComponent()) .cloudUploadingModule(new CloudUploadingModule(this)) .build() .inject(this); }
Example #13
Source File: VariableLengthVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public int getBufferSize(){ if (getAccessor().getValueCount() == 0) { return 0; } return offsetVector.getBufferSize() + data.writerIndex(); }
Example #14
Source File: VariableLengthVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public int getBufferSizeFor(final int valueCount) { if (valueCount == 0) { return 0; } final int idx = offsetVector.getAccessor().get(valueCount); return offsetVector.getBufferSizeFor(valueCount + 1) + idx; }
Example #15
Source File: ForbidListFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override public void handleEmptyViewHolder(BitFrameAdapter.EmptyViewHolder holder) { TextView tvTip = holder.itemView.findViewById(R.id.tv_tip); ImageView ivBlank = holder.itemView.findViewById(R.id.iv_blank); if (TextUtils.isEmpty(content)) { tvTip.setText(getString(R.string.blank_empty_data_log)); } else { tvTip.setText(getString(R.string.blank_empty_search_log)); ivBlank.setImageResource(R.drawable.ic_search_blank); } }
Example #16
Source File: InheritanceOk3Derived_LifecycleAdapter.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void callMethods(LifecycleOwner owner, Lifecycle.Event event, boolean onAny, MethodCallsLogger logger) { boolean hasLogger = logger != null; if (onAny) { return; } if (event == Lifecycle.Event.ON_STOP) { if (!hasLogger || logger.approveCall("onStop", 2)) { mReceiver.onStop(owner); } return; } }
Example #17
Source File: NullableValueVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public void exchange(ValueVector.Mutator other) { final Mutator target = (Mutator) other; int temp = setCount; setCount = target.setCount; target.setCount = temp; }
Example #18
Source File: InterfaceOk2Interface_LifecycleAdapter.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void callMethods(LifecycleOwner owner, Lifecycle.Event event, boolean onAny, MethodCallsLogger logger) { boolean hasLogger = logger != null; if (onAny) { return; } if (event == Lifecycle.Event.ON_STOP) { if (!hasLogger || logger.approveCall("onStop2", 2)) { mReceiver.onStop2(owner); } return; } }
Example #19
Source File: InviteFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override protected void registerDagger() { DaggerInviteComponent.builder() .appComponent(TyApplication.getAppComponent()) .inviteModule(new InviteModule(this)) .build() .inject(this); }
Example #20
Source File: ForbidListFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override protected void registerDagger() { DaggerForbidListComponent.builder() .appComponent(TyApplication.getAppComponent()) .forbidListModule(new ForbidListModule(this)) .build() .inject(this); }
Example #21
Source File: InheritanceOk2Base_LifecycleAdapter.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void callMethods(LifecycleOwner owner, Lifecycle.Event event, boolean onAny, MethodCallsLogger logger) { boolean hasLogger = logger != null; if (onAny) { return; } if (event == Lifecycle.Event.ON_STOP) { if (!hasLogger || logger.approveCall("onStop", 2)) { mReceiver.onStop(owner); } return; } }
Example #22
Source File: MyRankFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override public void onLoadRankDetail(RankDetailResp value, boolean isFirst) { // 设置积分 myRankResp.setCount(TyUtils.formatDotNum(value.getTotalCount())); onHandleResponseData(value.getScoresList(), isFirst); }
Example #23
Source File: NullableValueVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public DrillBuf[] getBuffers(boolean clear) { final DrillBuf[] buffers = ObjectArrays.concat(bits.getBuffers(false), values.getBuffers(false), DrillBuf.class); if (clear) { for (final DrillBuf buffer:buffers) { buffer.retain(1); } clear(); } return buffers; }
Example #24
Source File: MyCoinFragment.java From tysq-android with GNU General Public License v3.0 | 5 votes |
@Override protected void registerDagger() { DaggerMyCoinComponent.builder() .appComponent(TyApplication.getAppComponent()) .myCoinModule(new MyCoinModule(this)) .build() .inject(this); }
Example #25
Source File: NullableValueVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public void reset() { bits.zeroVector(); mutator.reset(); accessor.reset(); super.reset(); }
Example #26
Source File: VariableLengthVectors.java From Bats with Apache License 2.0 | 5 votes |
@Override public boolean allocateNewSafe() { long curAllocationSize = allocationSizeInBytes; if (allocationMonitor > 10) { curAllocationSize = Math.max(MIN_BYTE_COUNT, curAllocationSize / 2); allocationMonitor = 0; } else if (allocationMonitor < -2) { curAllocationSize = curAllocationSize * 2L; allocationMonitor = 0; } if (curAllocationSize > MAX_ALLOCATION_SIZE) { return false; } clear(); /* Boolean to keep track if all the memory allocations were successful * Used in the case of composite vectors when we need to allocate multiple * buffers for multiple vectors. If one of the allocations failed we need to * clear all the memory that we allocated */ try { final int requestedSize = (int)curAllocationSize; data = allocator.buffer(requestedSize); allocationSizeInBytes = requestedSize; offsetVector.allocateNew(); } catch (OutOfMemoryException e) { clear(); return false; } data.readerIndex(0); offsetVector.zeroVector(); return true; }
Example #27
Source File: ForbidListFragment.java From tysq-android with GNU General Public License v3.0 | 4 votes |
@Override protected View onCreateFragmentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_forbid_review_list, container, false); }
Example #28
Source File: NullableValueVectors.java From Bats with Apache License 2.0 | 4 votes |
@Override public void close() { bits.close(); values.close(); super.close(); }
Example #29
Source File: TopArticleListFragment.java From tysq-android with GNU General Public License v3.0 | 4 votes |
@Override protected void initArgs(Bundle arguments) { super.initArgs(arguments); mSelTopId = arguments.getInt(TyConfig.TOP_CATEGORY); mSelSubId = arguments.getInt(TyConfig.SUB_CATEGORY); }
Example #30
Source File: AdminCenterFragment.java From tysq-android with GNU General Public License v3.0 | 4 votes |
@Override public int getTitleId() { return R.string.admin_center; }