Tag:Subclass

  • C + + foundation-6-inheritance

    Time:2022-5-4

    6. Succession 1 #include 2 using namespace std; 3 4 5 class Base { 6 public: 7 Base() { 8 m_A = 10; 9 } 10 int m_A; 11 12 }; 13 14 class Son: public Base { 15 public: 16 Son() { 17 m_A = 20; 18 } 19 int m_A; 20 }; 21 […]

  • Python class – collections abc

    Time:2022-5-2

    Classes are very important for our daily programming. You will find that we define classes most of the time. Class contains data and uses methods to describe the interaction between data. Therefore, from a certain level, classes in Python are containers used to encapsulate attributes and functions. Python built-in container types:list tuple set dict, you […]

  • Talk about claudib’s keys command

    Time:2022-5-2

    order This paper mainly studies the keys command of claudib KeysCommand claudb-1.7.1/src/main/java/com/github/tonivade/claudb/command/key/KeysCommand.java @ReadOnly @Command(“keys”) @ParamLength(1) public class KeysCommand implements DBCommand { @Override public RedisToken execute(Database db, Request request) { GlobPattern pattern = createPattern(request.getParam(0)); ImmutableSet<SafeString> keys = db.entrySet() .filter(matchPattern(pattern)) .filter(filterExpired(Instant.now()).negate()) .map(Tuple2::get1) .map(DatabaseKey::getValue); return convert(keys); } private GlobPattern createPattern(SafeString param) { return new GlobPattern(param.toString()); } private Matcher1<Tuple2<DatabaseKey, […]

  • Actuator of mybatis

    Time:2022-4-30

    In this article, let’s talk about the executors of mybatis, and see how to use different executors in different scenarios and the implementation principle of different executors (based on mybatis 3.4.6). Knowledge points What is an actuator Mybatis actuator type and when to use it Implementation principle of each actuator What is an actuator As […]

  • On virtual function table

    Time:2022-4-29

    Author: Snow Mountain fat fish Time: 22:50, 20210825 Objective: to understand the virtual function table Position of virtual function Virtual functions have no fixed position and should be related to the compiler. In vs2017 and G + +, it is at the beginning of the object #include <iostream> using namespace std; class A { public: […]

  • Java polymorphic parent class reference points to subclass object (upward transformation)

    Time:2022-4-28

    For example, I have a parent class animal , and a subclass cat , cat class inherits animal, which is the subclass inherits the parent class Animal a = new cat() what does that mean? This is to create a parent class reference to a child class object. What are the benefits of doing so? […]

  • Introduction to typescript mixins

    Time:2022-4-27

    Mixins In addition to the traditional OO hierarchy, another popular way to build classes from reusable components is to build them by combining simpler partial classes. You may be familiar with the idea of mixins or features in languages such as Scala, and this pattern is also popular in the JavaScript community. The pattern relies […]

  • Custom control

    Time:2022-4-26

    Android window custom view bitmap 1. Why customize controls: existing controls can’t meet our needs or achieve the effect we want 2. A custom control is to inherit view or a derived class of view, and then override the internal methods in the class. Generally speaking, there are three types of custom controls: 1. Custom […]

  • Without programming, generate crud, add, delete, modify and check restful API interface based on PostgreSQL zero code

    Time:2022-4-25

    Without programming, generate crud, add, delete, modify and check restful API interface based on PostgreSQL zero code review In the previous article, the main functions and usage of crudapi have been introduced. Crudapi 1.2.0 only supports MySQL database. In order to support more databases, the code is reconstructed and the abstract factory design mode is […]

  • Detailed explanation of typescript class, inheritance and modifiers public, private and protected

    Time:2022-4-24

    1. Class I understand Class can be understood as a template through which a specific object can be instantiated For example: we define an animal class, This animal template can be instantiated into a cat or other specific animals 2. Basic use of class We need to create an animal class; This animal has a […]

  • Solid principle of software design pattern

    Time:2022-4-23

    Solid principle of software design pattern By: guest granting QQ: 1033553122 #Single responsibility principle (SRP) Definition: any software module is only responsible for a certain type of actors Note: in most cases, the “software module” here can be simply defined as a source code file, a class, a group of closely related functions and data […]

  • PHP core feature – trait

    Time:2022-4-23

    The trail syntax of PHP is very simple, and it is more important to understand the usage scenario of trail. propose Why does PHP introduce trail? Let’s first look at two common code reuse modes in software development,inheritandcombination。 Inheritance: EmphasisParent and child classesThat is, the subclass is a special type of the parent class; Combination: […]