精华内容
下载资源
问答
  • tkinter学习-- 控件entry

    2021-01-29 01:48:28
    Entry控件Python Tkinter 文本框用来让用户输入一行文本字符串。你如果需要输入多行文本,可以使用Text组件。你如果需要显示一行或多行文本且不允许用户修改,你可以使用Label组件。语法语法格式如下:w =Entry...

    Entry控件

    Python Tkinter 文本框用来让用户输入一行文本字符串。

    你如果需要输入多行文本,可以使用 Text 组件。

    你如果需要显示一行或多行文本且不允许用户修改,你可以使用 Label 组件。

    语法

    语法格式如下:

    w =Entry(master,option,...)

    master: 按钮的父容器。

    options: 可选项,即该按钮的可设置的属性。这些选项可以用键 = 值的形式设置,并以逗号分隔。

    序号可选项 & 描述

    1

    bg

    输入框背景颜色

    2

    bd

    边框的大小,默认为 2 个像素

    3

    cursor

    光标的形状设定,如arrow, circle, cross, plus 等

    4

    font

    文本字体

    5

    exportselection

    默认情况下,你如果在输入框中选中文本,默认会复制到粘贴板,如果要忽略这个功能刻工艺设置 exportselection=0。

    6

    fg

    文字颜色。值为颜色或为颜色代码,如:'red','#ff0000'

    7

    highlightcolor

    文本框高亮边框颜色,当文本框获取焦点时显示

    8

    justify

    显示多行文本的时候,设置不同行之间的对齐方式,可选项包括LEFT, RIGHT, CENTER

    9

    relief

    边框样式,设置控件3D效果,可选的有:FLAT、SUNKEN、RAISED、GROOVE、RIDGE。默认为 FLAT。

    10

    selectbackground

    选中文字的背景颜色

    11

    selectborderwidth

    选中文字的背景边框宽度

    12

    selectforeground

    选中文字的颜色

    13

    show

    指定文本框内容显示为字符,值随意,满足字符即可。如密码可以将值设为 show="*"

    14

    state

    默认为 state=NORMAL, 文框状态,分为只读和可写,值为:normal/disabled

    15

    textvariable

    文本框的值,是一个StringVar()对象

    16

    width

    文本框宽度

    17

    xscrollcommand

    设置水平方向滚动条,一般在用户输入的文本框内容宽度大于文本框显示的宽度时使用。

    #Entry文本框的使用

    windows=tk.Tk()

    windows.title('测试Entry文本框')

    windows.geometry('600x600')

    #文本框属性:

    #width=文本框宽度(可以觉得文本框是大小)

    # bd=文本框的边框大小(边界框)

    # bg、fg=文本框默认背景色、前景色

    Entry(width='20',bd='20',bg='yellow',fg='black').grid(row=0,column=0)

    #框体限定如斜体font= 字体字形、文字字号、文字字形、字形有overstrike/italic/bold/underline

    Entry(font=('宋体','10','overstrike')).grid(row=1,column=0) #划线

    Entry(font=('黑体','20','italic')).grid(row=2,column=0) #斜体

    Entry(font=('宋体','30','bold')).grid(row=3,column=0)#加粗

    Entry(font=('宋体','40','underline')).grid(row=4,column=0) #下划线

    #文本框样式:文本框风格,如凹陷、凸起

    Label(text='FLAT').grid(row=5,column=0)

    Entry(relief=FLAT,bg='red',bd=10).grid(row=5,column=1)

    Label(text='sunken').grid(row=6,column=0)

    Entry(relief=SUNKEN,bg='yellow',bd=10).grid(row=6,column=1)

    Label(text='raised').grid(row=7,column=0)

    Entry(relief=RAISED,bg='orange',bd=10).grid(row=7,column=1)

    Label(text='groove').grid(row=8,column=0)

    Entry(relief=GROOVE,bg='pink',bd=10).grid(row=8,column=1)

    #文本框状态:state禁用状态,正常状态

    Label(text='禁用状态').grid(row=9,column=0)

    Entry(windows,state=DISABLED).grid(row=9,column=1) # 静止写入

    Label(text='正常').grid(row=10,column=0)

    Entry(windows,state=NORMAL).grid(row=10,column=1) #正常

    #对文本框内文字的设定

    # Entry(windows,font=20,bd=5,highlightcolor='black').pack()#设置文本框点击后的边框颜色

    Label(text='点击后文本框变化').grid(row=11,column=0)

    Entry(windows,font=20,highlightthickness=10).grid(row=11,column=1) #设置文本框点击后的边框大小

    Label(text='设置选中文字的背景颜色').grid(row=12,column=0)

    Entry(windows,selectbackgroun='green').grid(row=12,column=1)#设置选中文字的背景颜色

    Label(text='设置选中文字的背景边框宽度').grid(row=13,column=0)

    Entry(windows,selectborderwidth=10).grid(row=13,column=1) #设置选中文字的背景边框宽度

    Label(text='设置选中文字的颜色').grid(row=14,column=0)

    Entry(windows,selectforeground='red').grid(row=14,column=1) #设置选中文字的颜色

    windows.mainloop()

    #Entry显示输入值如显示(*)

    root=tk.Tk()

    Label(text='设置show的值').grid(row=15,column=0)

    Entry(width=10,show='*').grid(row=15,column=1)

    root.mainloop()

    #Entryinsert的用法

    windows=tk.Tk()

    entry1=Entry(windows,width=8,show='#')

    entry1.insert(2,'today')

    entry1.pack()

    windows.mainloop()

    79adace5dc6e8e5114256a4c7c44b530.png

    9614651f7ea7a0b3b6057629dce638de.png

    8e4a440d0170a900502220996683e7c6.png

    c7bf41a492e4a25bd84d3fa7d742d51f.png

    b7493bdd0df2c74cd1c3d1db2325d73e.png

    entry的方法:

    1.获取文本框的输入值,借助tk模块中的StringVar的实例化对象来实现

    textvariale=StringVar()这里StringVar()是不会返回entry中的的值,需要使用get()方法获取

    StringVar().set('设置某值')

    StringVar().get('获取某值')

    #Entry 获取输入框的值 textvariable 这个参数很重要

    #通过实例化对象StringVar()来进行值得传导,点击按钮即可实现变化

    windows=tk.Tk()

    landString=StringVar()

    entry1=Entry(windows,width=10,textvariable=landString)

    entry1.pack()

    resulting=StringVar()

    Label(textvariable=resulting).pack()

    def change_func():

    resulting.set('{}'.format(landString.get()))

    Button(text='获取输入的值',command=change_func).pack()

    windows.mainloop()

    51208240071cba9e280aae0fdebc54ab.png

    2.获取文本框输入值,通过Entry()实例对象的get方法来实现

    def change_value():

    print(entry1.get())

    win=tk.Tk()

    entry1=Entry(win,width=10)

    entry1.pack()

    Button(win,text='点击改变',width=10,command=change_value).pack()

    win.mainloop()

    ac2aa2ff01b8af9073a75fe1fec2047a.png

    3..获取文本框输入值:通过Variable类的实例化,来实现entry内值的传递 ;通过messagebox里的showinfo函数显示展示功能

    #通过Variable类的实例化,来实现entry内值的传递

    #通过messagebox里的showinfo函数显示展示功能

    from tkinter.messagebox import showinfo

    windows=tk.Tk()

    a=Variable(windows,value='')

    e=Entry(windows,textvariable=a)

    b=Button(windows,text='get',command=lambda *args:showinfo(message=a.get()))

    e.pack()

    b.pack()

    windows.mainloop()

    0e435e507ecae8d6a37941d2650a9b64.png

    4.insert 与delete方法(但输入密码错误时可以清空文本)

    Entry().insert(插入位置=int,插入值=字符串)

    Entry().delete(删除起始位置=下标,删除结束位置=下标(END为最后一个默认0,end删除全部)))

    #Entry的delete方法和insert方法

    #insert方法通过StringVar()传递值

    windows=tk.Tk()

    cont=StringVar()

    entry=Entry(windows,width=15,textvariable=cont)

    def insert_func(choice):

    if choice==1:

    entry.insert(1,'tencent')

    elif choice ==2:

    entry.delete(0,END) # self.tk.call(self._w, 'delete', first, last)

    else:

    print('error')

    entry.pack()

    Button(windows,text='company',width=15,command=lambda :insert_func(1)).pack() #(command=lambda 传值事件)

    windows.mainloop()

    96c0f35a7dd56ecd82d4e20925fd29ce.png

    6a13df08d1ac13f93c3d02745a8aeca2.png

    6b08ab0fb2bb00934037dcccfd9c8076.png  

    d03cbb26e5b9b1ae06b2281da299093f.png

    4.简单的登录页面

    from tkinter import *

    from tkinter import messagebox

    class Application(Frame):

    def __init__(self,master=None):

    super().__init__(master)

    self.master=master

    self.grid()

    self.creatWidget()

    def creatWidget(self):

    self.label1=Label(self,text='登录')

    self.label1.grid(column=0,row=0)

    global login

    login=StringVar()

    self.entry1=Entry(self,bd='2',textvariable=login)

    self.entry1.grid(column=1,row=0)

    self.label2=Label(self,text='密码')

    self.label2.grid(column=0,row=1)

    global pw

    pw=StringVar()

    self.entry2=Entry(self,bd=2,textvariable=pw,show='*')

    self.entry2.grid(column=1,row=1)

    self.button=Button(self,text='登录',width=10,command=self.login)

    self.button.grid(row=2,columnspan=1,column=1)

    def login(self):

    username=self.entry1.get()

    pwd=self.entry2.get()

    print(login,pw) #PY_VAR0 PY_VAR1

    #如果这里想要 login,pw,这需要login.get() ,pw.get()

    #不会直接返回值

    print(login.get(),pw.get()) #qwe 12

    if username=='qwe'and pwd=='1':

    messagebox.showinfo('登录成功')

    else:

    messagebox.showinfo('未能成功登录')

    root=Tk()

    app=Application(master=root)

    root.mainloop()

    cacb34f3f4f85f8b4868c98c68289143.png

    e071acb5794cd3ef6ef787577856dc3b.png

    展开全文
  • Java Entry.getValue方法代碼示例

    千次阅读 2021-02-26 19:50:56
    本文整理匯總了Java中java.util.Map.Entry.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Entry.getValue方法的具體用法?Java Entry.getValue怎麽用?Java Entry.getValue使用的例子?那麽恭喜您, ...

    本文整理匯總了Java中java.util.Map.Entry.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Entry.getValue方法的具體用法?Java Entry.getValue怎麽用?Java Entry.getValue使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.Map.Entry的用法示例。

    在下文中一共展示了Entry.getValue方法的20個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

    示例1: save

    ​點讚 3

    import java.util.Map.Entry; //導入方法依賴的package包/類

    @Override

    public IStatus save() {

    try {

    final IEclipsePreferences node = InstanceScope.INSTANCE.getNode(QUALIFIER);

    for (final Entry entry : getOrCreateState().entrySet()) {

    final URI path = entry.getValue();

    if (null != path) {

    final File file = new File(path);

    if (file.isDirectory()) {

    node.put(entry.getKey().getId(), file.getAbsolutePath());

    }

    } else {

    // Set to default.

    node.put(entry.getKey().getId(), "");

    }

    }

    node.flush();

    return OK_STATUS;

    } catch (final BackingStoreException e) {

    final String message = "Unexpected error when trying to persist binary preferences.";

    LOGGER.error(message, e);

    return statusHelper.createError(message, e);

    }

    }

    開發者ID:eclipse,項目名稱:n4js,代碼行數:25,

    示例2: processNode

    ​點讚 3

    import java.util.Map.Entry; //導入方法依賴的package包/類

    @Override

    protected void processNode(Node node) {

    if (node instanceof GuardNode) {

    processGuard(node);

    } else if (node instanceof Access) {

    processAccess((Access) node);

    }

    if (node instanceof StateSplit && ((StateSplit) node).stateAfter() != null) {

    nullGuarded.clear();

    } else {

    Iterator> it = nullGuarded.entrySet().iterator();

    while (it.hasNext()) {

    Entry entry = it.next();

    GuardNode guard = entry.getValue();

    if (guard.usages().contains(node)) {

    it.remove();

    }

    }

    }

    }

    開發者ID:arodchen,項目名稱:MaxSim,代碼行數:21,

    示例3: showPostParams

    ​點讚 3

    import java.util.Map.Entry; //導入方法依賴的package包/類

    private static void showPostParams(int requestId, Map params) {

    String message = "Post." + requestId + ".Params:";

    StringBuilder stringBuilder = new StringBuilder();

    stringBuilder.append(message);

    String separator = "&";

    Iterator> it = params.entrySet().iterator();

    while (it.hasNext()) {

    Entry entry = it.next();

    String key = entry.getKey();

    Object value = entry.getValue();

    stringBuilder.append(separator);

    stringBuilder.append(String.format(Locale.getDefault(), "%s=%s", key, value));

    }

    //將第一個分隔符刪除

    int separatorIndex;

    if ((separatorIndex = stringBuilder.indexOf(separator)) != -1) {

    stringBuilder.deleteCharAt(separatorIndex);

    }

    LogUtils.info(stringBuilder.toString());

    }

    開發者ID:PlutoArchitecture,項目名稱:Pluto-Android,代碼行數:22,

    示例4: delete

    ​點讚 3

    import java.util.Map.Entry; //導入方法依賴的package包/類

    /**

    * Remove a {@link CatalogType} object from this collection.

    * @param name The name of the object to remove.

    */

    public boolean delete(String name) {

    try {

    if (m_items.containsKey(name) == false)

    throw new CatalogException("Catalog item '" + name + "' doesn't exists in " + m_parent);

    m_items.remove(name);

    // update versioning if needed

    updateVersioning();

    // assign a relative index to every child item

    int index = 1;

    for (Entry e : m_items.entrySet()) {

    e.getValue().m_relativeIndex = index++;

    }

    } catch (Exception ex) {

    throw new RuntimeException(ex);

    }

    m_fastArray = null;

    return (true);

    }

    開發者ID:s-store,項目名稱:s-store,代碼行數:27,

    示例5: getQueryString

    ​點讚 3

    import java.util.Map.Entry; //導入方法依賴的package包/類

    private String getQueryString(){

    StringBuilder query = new StringBuilder();

    for(Entry> param : queryParams.entrySet()){

    String key = param.getKey();

    if(key == null || key.trim().isEmpty()){

    continue;

    }

    String urlEncodedKey = urlEncode(key.trim());

    for(String value : param.getValue()){

    query.append('&').append(urlEncodedKey);

    if(value != null && !value.isEmpty()){

    query.append('=').append(urlEncode(value));

    }

    }

    }

    return "?" + query.substring(1);

    }

    開發者ID:hotpads,項目名稱:datarouter,代碼行數:18,

    示例6: cntByTimeString

    ​點讚 3

    import java.util.Map.Entry; //導入方法依賴的package包/類

    public String cntByTimeString() {

    DecimalFormat df = new DecimalFormat(DECIMAL_PATTERN);

    List millisStr = new LinkedList();

    Iterator >iter = millisMap.entrySet().iterator();

    while(iter.hasNext()) {

    Entry millisEntry = iter.next();

    Integer bucket = (Integer)millisEntry.getKey();

    Integer bucketCount = (Integer)millisEntry.getValue();

    int minMillis = bucket.intValue() * millisPerBucket;

    int maxMillis = (bucket.intValue() + 1) * millisPerBucket;

    millisStr.add(

    df.format(minMillis/MILLIS_PER_SECOND)+" s "+

    "- "+

    df.format(maxMillis/MILLIS_PER_SECOND)+" s "+

    "= " + bucketCount);

    }

    return millisStr.toString();

    }

    開發者ID:WillemJiang,項目名稱:acmeair,代碼行數:22,

    示例7: subMaps

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    public List> subMaps(final int size, boolean perMap) {

    final LinkedList> maps = new LinkedList>();

    int index = 0;

    int count = 0;

    for (final Entry> entry : entrySet()) {

    for (final T value : entry.getValue()) {

    if (index == maps.size()) {

    maps.add(new StringListMap());

    }

    maps.get(index).add(entry.getKey(), value);

    index = perMap ? (++count / size) : (++index % size);

    }

    }

    return maps;

    }

    開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:16,

    示例8: servicesByState

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    ImmutableMultimap servicesByState() {

    ImmutableSetMultimap.Builder builder = ImmutableSetMultimap.builder();

    monitor.enter();

    try {

    for (Entry entry : servicesByState.entries()) {

    if (!(entry.getValue() instanceof NoOpService)) {

    builder.put(entry);

    }

    }

    } finally {

    monitor.leave();

    }

    return builder.build();

    }

    開發者ID:paul-hammant,項目名稱:googles-monorepo-demo,代碼行數:15,

    示例9: getSettingsMap

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    public Map, Set> getSettingsMap()

    {

    Map, Set> settingsMap = Maps.newHashMap();

    for( Entry extEntry : settingsExtensions.getExtensionMap().entrySet() )

    {

    Extension settingExt = extEntry.getValue();

    Collection groupParams = settingExt.getParameters("grouping");

    AbstractParentSettingsSection> bean = settingsExtensions.getBeanByExtension(settingExt);

    if( !Check.isEmpty(groupParams) )

    {

    for( Parameter groupParam : groupParams )

    {

    Set groups = settingsMap.get(bean);

    if( groups == null )

    {

    groups = Sets.newHashSet();

    settingsMap.put(bean, groups);

    }

    groups.add(groupParam.valueAsString());

    }

    }

    else

    {

    settingsMap.put(bean, new HashSet());

    }

    }

    return settingsMap;

    }

    開發者ID:equella,項目名稱:Equella,代碼行數:31,

    示例10: write

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    @SuppressWarnings("unchecked")

    private void write(Map> map) throws IOException

    {

    this.updateIndent(true);

    int keys = map.entrySet().size();

    int k = 0;

    for (Entry> entry : map.entrySet())

    {

    k += 1;

    MutablePair pair = entry.getValue();

    String comment = pair.getLeft();

    Map> rightMap = (Map>) pair.getRight();

    int rightKeys = (rightMap == null) ? 0 : rightMap.size();

    boolean newLine = keys > 3;

    if (comment != null)

    {

    this.writeComment(comment);

    }

    String key = entry.getKey();

    this.writeKey(key);

    if (rightMap != null)

    {

    this.write(rightMap);

    }

    if (newLine)

    {

    this.writeNewLine(false);

    }

    }

    this.writeNewLine(false);

    this.updateIndent(false);

    }

    開發者ID:GotoFinal,項目名稱:diorite-configs-java8,代碼行數:35,

    示例11: getChangedTableEntries

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    public Collection

    Set

    for (Entry

    if (!other.table_entries.containsKey(e.getKey())) {

    changed.add(e.getKey());

    } else {

    TableEntry pe0 = e.getValue();

    TableEntry pe1 = other.table_entries.get(e.getKey());

    if (!pe0.equals(pe1))

    changed.add(e.getKey());

    }

    } // FOR

    return (changed);

    }

    開發者ID:s-store,項目名稱:s-store,代碼行數:15,

    示例12: testScanFilter_EXISTS

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    @Test

    public void testScanFilter_EXISTS() {

    ScanFilter ScanFilter = new ScanFilter("foo").exists();

    Entry ddbscanFilter = toAttributeCondition(ScanFilter);

    String ddbscanFilter_attrName = ddbscanFilter.getKey();

    Condition ddbscanFilter_value = ddbscanFilter.getValue();

    Assert.assertEquals("foo", ddbscanFilter_attrName);

    Assert.assertEquals(ComparisonOperator.NOT_NULL, ddbscanFilter_value.comparisonOperator());

    Assert.assertEquals(null, ddbscanFilter_value.attributeValueList());

    }

    開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:12,

    示例13: getHasUnitSubUnUnitTopicList

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    public byte[] getHasUnitSubUnUnitTopicList() {

    TopicList topicList = new TopicList();

    try {

    try {

    this.lock.readLock().lockInterruptibly();

    Iterator>> topicTableIt =

    this.topicQueueTable.entrySet().iterator();

    while (topicTableIt.hasNext()) {

    Entry> topicEntry = topicTableIt.next();

    String topic = topicEntry.getKey();

    List queueDatas = topicEntry.getValue();

    if (queueDatas != null && queueDatas.size() > 0

    && !TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSynFlag())

    && TopicSysFlag.hasUnitSubFlag(queueDatas.get(0).getTopicSynFlag())) {

    topicList.getTopicList().add(topic);

    }

    }

    }

    finally {

    this.lock.readLock().unlock();

    }

    }

    catch (Exception e) {

    log.error("getAllTopicList Exception", e);

    }

    return topicList.encode();

    }

    開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:29,

    示例14: isPrimitiveTypeMap

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    protected boolean isPrimitiveTypeMap(Object o) {

    if (!(o instanceof Map, ?>))

    return false;

    Map, ?> m = (Map, ?>) o;

    Set> eset = m.entrySet();

    for (Object entry : eset) {

    Entry, ?> e = (Entry, ?>) entry;

    if (e.getValue() != null && !isPrimitiveType(e.getValue().getClass().getName()))

    return false;

    }

    return true;

    }

    開發者ID:twosigma,項目名稱:beaker-notebook-archive,代碼行數:14,

    示例15: writeObject

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    /**

    * @serialData Null terminated list of VetoableChangeListeners.

    *

    * At serialization time we skip non-serializable listeners and

    * only serialize the serializable listeners.

    */

    private void writeObject(ObjectOutputStream s) throws IOException {

    Hashtable children = null;

    VetoableChangeListener[] listeners = null;

    synchronized (this.map) {

    for (Entry entry : this.map.getEntries()) {

    String property = entry.getKey();

    if (property == null) {

    listeners = entry.getValue();

    } else {

    if (children == null) {

    children = new Hashtable<>();

    }

    VetoableChangeSupport vcs = new VetoableChangeSupport(this.source);

    vcs.map.set(null, entry.getValue());

    children.put(property, vcs);

    }

    }

    }

    ObjectOutputStream.PutField fields = s.putFields();

    fields.put("children", children);

    fields.put("source", this.source);

    fields.put("vetoableChangeSupportSerializedDataVersion", 2);

    s.writeFields();

    if (listeners != null) {

    for (VetoableChangeListener l : listeners) {

    if (l instanceof Serializable) {

    s.writeObject(l);

    }

    }

    }

    s.writeObject(null);

    }

    開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:40,

    示例16: beforeCommit

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    @Override

    public void beforeCommit(boolean readOnly) {

    //flush all the logs and execute all the compensable methods before commit

    LogProcessContext logProcessContext = getLogProcessContext();

    logProcessContext.getLogCache().flush(false);

    logProcessContext.getExecuteManager().excuteCahcheMehods();

    Map, Exception> errorCalls = logProcessContext.getExecuteManager().getErrorCalls();

    if(errorCalls.size() != 0){

    Entry, Exception> next = errorCalls.entrySet().iterator().next();

    throw new RuntimeException("Exist compensable method call Exception,rollback now...",next.getValue());

    }

    }

    開發者ID:QNJR-GROUP,項目名稱:EasyTransaction,代碼行數:13,

    示例17: getServicedBy

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    private List getServicedBy(CmsRfcCI rfc) {

    List iaases = new ArrayList<>();

    CmsCI box = getBox(rfc.getCiId());

    List iaasList = cmProcessor.getFromCIRelations(box.getCiId(), "manifest.ServicedBy", "manifest.Iaas");

    for (CmsCIRelation rel : iaasList) {

    CmsRfcCI iaas = rfcUtil.mergeRfcAndCi(null, rel.getToCi(), "dj");

    iaas.getAttribute("services").setNewValue(rel.getAttribute("services").getDjValue());

    List keypairs = cmProcessor.getFromCIRelations(iaas.getCiId(), "manifest.Requires", "manifest.Keypair");

    if (keypairs.size() > 0) {

    CmsRfcAttribute prKeyAttr = new CmsRfcAttribute();

    prKeyAttr.setAttributeName("private_key");

    prKeyAttr.setNewValue(keypairs.get(0).getToCi().getAttribute("private").getDjValue());

    iaas.addAttribute(prKeyAttr);

    }

    //this is total HACK for Netscaler needs to be generalized

    List netscaler = cmProcessor.getFromCIRelations(iaas.getCiId(), "manifest.Requires", "manifest.Netscaler");

    if (netscaler.size() > 0) {

    for (Entry attrEntry : netscaler.get(0).getToCi().getAttributes().entrySet()) {

    CmsCIAttribute nsAttr = attrEntry.getValue();

    CmsRfcAttribute iaasNsAttr = new CmsRfcAttribute();

    iaasNsAttr.setAttributeName(nsAttr.getAttributeName());

    iaasNsAttr.setNewValue(nsAttr.getDjValue());

    iaas.addAttribute(iaasNsAttr);

    }

    }

    iaases.add(iaas);

    }

    return iaases;

    }

    開發者ID:oneops,項目名稱:oneops,代碼行數:33,

    示例18: JSONObject

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    /**

    * Construct a JSONObject from a Map.

    *

    * @param m

    * A map object that can be used to initialize the contents of

    * the JSONObject.

    */

    public JSONObject(Map, ?> m) {

    if (m == null) {

    this.map = new HashMap();

    } else {

    this.map = new HashMap(m.size());

    for (final Entry, ?> e : m.entrySet()) {

    final Object value = e.getValue();

    if (value != null) {

    this.map.put(String.valueOf(e.getKey()), wrap(value));

    }

    }

    }

    }

    開發者ID:andrenoberto,項目名稱:TrafficPetri,代碼行數:21,

    示例19: processResults

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    protected UT2004HideAndSeekResult processResults(UCCWrapper ucc, UT2004Server server, UT2004Analyzer analyzer, Bots bots, List winners, Map> botRecords) {

    if (log != null && log.isLoggable(Level.FINE)) {

    log.fine(config.getMatchId().getToken() + ": Processing results...");

    }

    config.getHsConfig().setFixedSeekerName(origFixedSeekerName);

    UT2004HideAndSeekResult result = new UT2004HideAndSeekResult();

    // BOTS

    result.setBots(MyCollections.asList(bots.botId2UnrealId.keySet()));

    // BOT IDS

    result.setBotIds(bots.botId2UnrealId);

    // BOT OBSERVERS

    for (Entry entry : bots.botObservers.entrySet()) {

    if (!(entry.getValue() instanceof UT2004AnalyzerObsStats)) {

    throw new PogamutException("There is an observer of wrong class, expecting UT2004AnalyzerObsStats, got " + entry.getValue().getClass().getSimpleName() + "!", log, this);

    }

    result.getBotObservers().put(entry.getKey(), (UT2004AnalyzerObsStats)entry.getValue());

    }

    // WINNERS

    result.setWinners(winners);

    // MATCH TIME

    result.setMatchTime(((double)bots.matchEnd - (double)bots.matchStart) / (1000));

    // SCORES

    result.setScoreDetails(botRecords);

    if (log != null && log.isLoggable(Level.WARNING)) {

    log.warning(config.getMatchId().getToken() + ": Results processed, #Winners = " + result.getWinners().size() + ", Winners score = " + result.getWinnerScore());

    }

    return result;

    }

    開發者ID:kefik,項目名稱:Pogamut3,代碼行數:39,

    示例20: startReading

    ​點讚 2

    import java.util.Map.Entry; //導入方法依賴的package包/類

    public void startReading() {

    StringBuilder sb = new StringBuilder();

    sb.append(" Started DiskReaderTasks for the following partions [ ");

    int idx = 0;

    if (logger.isLoggable(Level.FINEST)) {

    logger.log(Level.FINEST, " partitionsMap is: " + partitionsMap);

    }

    for (Entry> entry : partitionsMap.entrySet()) {

    final int partitionID = entry.getKey().intValue();

    LinkedList files = entry.getValue();

    int realReadersCount = (readersCount < files.size()) ? readersCount : files.size();

    ArrayList readersTasks = new ArrayList(realReadersCount);

    ArrayList> fileSessionsReaders = new ArrayList>(

    realReadersCount);

    if (logger.isLoggable(Level.FINE)) {

    logger.log(Level.FINE, " realReadersCount = " + realReadersCount + " for partitionID: " + partitionID);

    }

    if (realReadersCount > 1) {

    FileSession[] filesArray = files.toArray(new FileSession[files.size()]);

    Arrays.sort(filesArray, new FileSessionComparator());

    if (logger.isLoggable(Level.FINER)) {

    logger.log(Level.FINER, "Sorted FileSession-s array: " + Arrays.toString(filesArray));

    }

    int ci = 0;

    for (FileSession fs : filesArray) {

    LinkedList fsessions = (ci >= fileSessionsReaders.size()) ? null

    : fileSessionsReaders.get(ci);

    if (fsessions == null) {

    fsessions = new LinkedList();

    fileSessionsReaders.add(fsessions);

    }

    fsessions.add(fs);

    if (logger.isLoggable(Level.FINEST)) {

    logger.log(Level.FINEST, " Added FileSession: " + fs + " for DiskReaderTask idx = " + ci);

    }

    ci = (ci + 1) % realReadersCount;

    }

    } else {

    fileSessionsReaders.add(files);

    }

    execService = Utils.getStandardExecService("DiskReaderTask for " + toString(), partitionsMap.size(),

    (partitionsMap.size() * realReadersCount) + 5, Thread.NORM_PRIORITY);

    for (int i = 0; i < realReadersCount; i++) {

    final DiskReaderTask drTask = new DiskReaderTask(partitionID, idx++, fileSessionsReaders.get(i), this);

    readersTasks.add(drTask);

    execService.submit(drTask);

    }

    if (logger.isLoggable(Level.FINER)) {

    logger.log(Level.FINER, " ReadersTasks for partitionID: " + partitionID + ": " + readersTasks);

    }

    readersMap.put(partitionID, readersTasks);

    sb.append(partitionID).append(" ");

    }

    sb.append("] for FDTSession: ").append(sessionID);

    logger.log(Level.INFO, sb.toString());

    }

    開發者ID:fast-data-transfer,項目名稱:fdt,代碼行數:79,

    注:本文中的java.util.Map.Entry.getValue方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

    展开全文
  • Python tkinter,从类中清除Entry小部件

    千次阅读 2021-03-04 10:15:44
    这是我正在调用的类,并且是来自其他文件的函数class CalcFunc:def clearScreen(self):self.log("CLEAR (CE)")ent.delete(0, END)这是输入框ent = Entry(root, textvariable=clc.getBtn, justify=RIGHT, font=10, ...

    这是我正在调用的类,并且是来自其他文件的函数

    class CalcFunc:

    def clearScreen(self):

    self.log("CLEAR (CE)")

    ent.delete(0, END)

    这是输入框

    ent = Entry(root, textvariable=clc.getBtn, justify=RIGHT, font=10, relief=RIDGE, bd=2, width=15)

    ent.grid(row=0, columnspan=3, pady=10)

    这是我单击以清除输入框的按钮

    buttonCC = Button(root, text="CLEAR (CE)", height=1, width=20, bg='orange', command=clc.clearScreen)

    我不确定基本从类中清除Entry小部件的语法是什么。当我将其保存在同一文件中时,该代码有效,但是我的项目要求将其保存在单独的文件中。这是一个计算器的类项目,“清除”按钮清除了Entry小部件。如果有帮助,我可以发布我的整个代码。谢谢。

    - - 编辑 - -

    我的课

    import time

    class CalcFunc:

    def log(self, val):

    myFile = open(r".\log.dat", "a")

    myFile.write("%s\n" % val)

    myFile.close()

    def onScreen(self, iVal):

    self.log(iVal)

    currentTxt = self.getBtn.get()

    updateEnt = self.getBtn.set(currentTxt + iVal)

    def clearScreen(self):

    self.log("CLEAR (CE)")

    ent.delete(0, END)

    def evaL(self):

    self.log("=")

    self.getBtn.set(str(eval(self.getBtn.get())))

    self.log(self.getBtn.get())

    def logLbl(self):

    myFile = open(r".\log.dat", "a")

    myFile.write("\n==================================\n")

    myFile.write("Date: " + str(time.strftime("%m/%d/%Y")) + " -- Time: " + str(time.strftime("%I:%M:%S")))

    myFile.write("\n==================================\n")

    myFile.close()

    我的程序

    from tkinter import *

    import time

    import clcClass

    root = Tk()

    root.title('skClc v1')

    clc = clcClass.CalcFunc()

    clc.logLbl()

    clc.getBtn = StringVar()

    ent = Entry(root, textvariable=clc.getBtn, justify=RIGHT, font=10, relief=RIDGE, bd=2, width=15)

    ent.grid(row=0, columnspan=3, pady=10)

    button1 = Button(root, text="1", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('1'))

    button2 = Button(root, text="2", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('2'))

    button3 = Button(root, text="3", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('3'))

    button4 = Button(root, text="4", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('4'))

    button5 = Button(root, text="5", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('5'))

    button6 = Button(root, text="6", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('6'))

    button7 = Button(root, text="7", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('7'))

    button8 = Button(root, text="8", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('8'))

    button9 = Button(root, text="9", height=1, width=5, bg='light blue', command=lambda:clc.onScreen('9'))

    button0 = Button(root, text="0", height=1, width=5, bg='light blue', command=lambda:onScreen('0'))

    buttonP = Button(root, text="+", height=1, width=5, bg='gray', command=lambda:clc.onScreen('+'))

    buttonM = Button(root, text="-", height=1, width=5, bg='gray', command=lambda:clc.onScreen('-'))

    buttonMM = Button(root, text="x", height=1, width=5, bg='gray', command=lambda:clc.onScreen('*'))

    buttonDD = Button(root, text="÷", height=1, width=5, bg='gray', command=lambda:clc.onScreen('/'))

    buttonEE = Button(root, text="=", height=1, width=5, bg='light green', command=clc.evaL)

    buttonCC = Button(root, text="CLEAR (CE)", height=1, width=20, bg='orange', command=clc.clearScreen)

    button1.grid(row=1, column=0, pady=5)

    button2.grid(row=1, column=1, pady=5)

    button3.grid(row=1, column=2, pady=5)

    button4.grid(row=2, column=0, pady=5)

    button5.grid(row=2, column=1, pady=5)

    button6.grid(row=2, column=2, pady=5)

    button7.grid(row=3, column=0, pady=5)

    button8.grid(row=3, column=1, pady=5)

    button9.grid(row=3, column=2, pady=5)

    button0.grid(row=4, column=0, pady=5)

    buttonP.grid(row=4, column=1, pady=5)

    buttonM.grid(row=4, column=2, pady=5)

    buttonEE.grid(row=5, column=0, pady=5)

    buttonDD.grid(row=5, column=1, pady=5)

    buttonMM.grid(row=5, column=2, pady=5)

    buttonCC.grid(row=6, column=0, pady=5, columnspan=3)

    root.maxsize(140,245);

    root.minsize(140,245);

    root.mainloop()

    解决方案

    ent = Entry(root, ....)

    clc = clcClass.CalcFunc(ent)

    class CalcFunc:

    def __init__(self, entry):

    self.entry = entry

    def clearScreen(self):

    self.log("CLEAR (CE)")

    self.entry.delete(0, END)

    这是一个简短的示例:

    #my_entry.py

    from tkinter import END

    import time

    class EntryWithLogger:

    def __init__(self, entry):

    self.entry = entry

    def log(self, val):

    with open("log.dat", "a") as my_file: #Automatically closes the file--even if an exception occurs, which is not the case with my_file.close().

    my_file.write("%s\n" % val)

    def onScreen(self, i_val):

    self.log(i_val)

    self.entry.insert(END, i_val)

    def clearScreen(self):

    self.log("CLEAR (CE)")

    self.entry.delete(0, END)

    请注意,我没有使用StringVar(),这似乎不是必需的。如果需要,可以始终将其作为参数传递给__init__(),然后将其存储在上self。

    import my_entry as me

    import tkinter as tk

    root = tk.Tk()

    root.title("Calculator")

    root.geometry("+100+50") #("300x500+200+10") dimension, position

    entry = tk.Entry(root, justify=tk.RIGHT, font=10, relief=tk.RIDGE, bd=2, width=15)

    entry.grid(row=0, columnspan=3, pady=10)

    entry_with_logger = me.EntryWithLogger(entry)

    #Create the buttons in a loop:

    for i in range(10):

    row_num, col_num = divmod(i, 3) #divmod(7, 2) => (3, 1), divmod(0, 3) => (0, 0), divmod(4, 3) => (1, 1)

    row_num += 1

    button_text = str(i)

    tk.Button(root, text=button_text,

    height=1,

    width=5,

    bg='light blue',

    command=lambda x=button_text: entry_with_logger.onScreen(x)

    ).grid(row=row_num, column=col_num, pady=5)

    #Put the clear button at the bottom of the grid:

    tk.Button(root, text="CLEAR (CE)",

    height=1,

    width=20,

    bg='orange',

    command=entry_with_logger.clearScreen

    ).grid(row=row_num+1, columnspan=3) #columnspan tells grid() to use 3 cells for the button,

    #and the button will be centered by default.

    root.mainloop()

    或者,您可以这样做:

    #my_entry.py

    from tkinter import Entry, END

    import time

    class EntryWithLogger(Entry):

    #Because __init__() is not implemented, the parent class's __init__() gets

    #called, so you create an EntryWithLogger just like you would an Entry.

    def log(self, val):

    with open("log.dat", "a") as my_file: #Automatically closes the file--even if there is an exception, which is not the case with my_file.close().

    my_file.write("%s\n" % val)

    def onScreen(self, i_val):

    self.log(i_val)

    self.insert(END, i_val)

    def clearScreen(self):

    self.log("CLEAR (CE)")

    self.delete(0, END)

    import my_entry as me

    import tkinter as tk

    root = tk.Tk()

    root.title("Calculator")

    root.geometry("+100+50") #("300x500+200+10") dimension, position

    entry = me.EntryWithLogger(root, justify=tk.RIGHT, font=10, relief=tk.RIDGE, bd=2, width=15)

    entry.grid(row=0, columnspan=3, pady=10)

    #Create the buttons in a loop:

    for i in range(10):

    row_num, col_num = divmod(i, 3) #divmod(7, 2) => (3, 1), divmod(0, 3) => (0, 0), divmod(4, 3) => (1, 1)

    row_num += 1

    button_text = str(i)

    tk.Button(root, text=button_text,

    height=1,

    width=5,

    bg='LightBlue',

    command=lambda x=button_text: entry.onScreen(x)

    ).grid(row=row_num, column=col_num, pady=5)

    #Put the clear button at the bottom of the grid:

    tk.Button(root, text="CLEAR (CE)",

    height=1,

    width=20,

    bg='orange',

    command=entry.clearScreen

    ).grid(row=row_num+1, columnspan=3) #columnspan tells grid() to use 3 cells for the button,

    #and the button will be centered by default.

    root.mainloop()

    展开全文
  • 如果您正苦於以下問題:Java CanalEntry.Entry方法的具體用法?Java CanalEntry.Entry怎麽用?Java CanalEntry.Entry使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一...

    本文整理匯總了Java中com.alibaba.otter.canal.protocol.CanalEntry.Entry方法的典型用法代碼示例。如果您正苦於以下問題:Java CanalEntry.Entry方法的具體用法?Java CanalEntry.Entry怎麽用?Java CanalEntry.Entry使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.alibaba.otter.canal.protocol.CanalEntry的用法示例。

    在下文中一共展示了CanalEntry.Entry方法的34個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

    示例1: filter

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public boolean filter(CanalEntry.Entry entry) {

    //過濾掉事物頭尾等 非 row data 的 entry

    boolean rowData = entry.getEntryType() == CanalEntry.EntryType.ROWDATA;

    if (!rowData) {

    return false;

    }

    //隻保存 insert update delete 類型的 時間

    boolean eventType = filterEventType(entry.getHeader().getEventType());

    if (!eventType) {

    return false;

    }

    return true;

    }

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:20,

    示例2: printSummary

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    private void printSummary(Message message, long batchId, int size) {

    long memsize = 0;

    for (CanalEntry.Entry entry : message.getEntries()) {

    memsize += entry.getHeader().getEventLength();

    }

    String startPosition = null;

    String endPosition = null;

    if (!CollectionUtils.isEmpty(message.getEntries())) {

    startPosition = buildPositionForDump(message.getEntries().get(0));

    endPosition = buildPositionForDump(message.getEntries().get(message.getEntries().size() - 1));

    }

    logger.info(context_format, new Object[]{batchId, size, memsize, format.format(new Date()), startPosition,

    endPosition});

    }

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:17,

    示例3: consumerMessage

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    /**

    * 消費當前消息

    */

    private void consumerMessage(Message message) {

    log.debug("canal instance: " + handle.instanceName() + " get message entry size " + message.getEntries().size());

    try {

    for (CanalEntry.Entry e : message.getEntries()) {

    if (e.getEntryType() != CanalEntry.EntryType.ROWDATA || !e.hasStoreValue()) continue;

    CanalEntry.Header header = e.getHeader();

    if (header.getExecuteTime() < startRtTime

    || header.getEventType().getNumber() > CanalEntry.EventType.DELETE_VALUE

    || !handle.startHandle(header)) continue;

    try {

    CanalEntry.RowChange rowChange = CanalEntry.RowChange.parseFrom(e.getStoreValue());

    if (rowChange.getIsDdl()) continue;

    handle.rowChangeHandle(rowChange);

    } catch (InvalidProtocolBufferException e1) {

    log.error("canal instance: " + handle.instanceName() + " parse store value have exception: ", e1);

    }

    }

    handle.ack(message.getId());

    } finally {

    handle.finishMessageHandle();

    }

    }

    開發者ID:wxingyl,項目名稱:search-commons,代碼行數:26,

    示例4: put

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public void put(List list) throws InterruptedException, CanalStoreException {

    if (CollectionUtils.isNotEmpty(list)) {

    for (Event event : list) {

    CanalEntry.Entry entry = event.getEntry();

    try {

    CanalEntry.RowChange rowChange = CanalEntry.RowChange.parseFrom(entry.getStoreValue());

    CanalEntry.EventType eventType = rowChange.getEventType();

    if (eventType == CanalEntry.EventType.INSERT || eventType == CanalEntry.EventType.UPDATE || eventType == CanalEntry.EventType.DELETE) {

    List rowDatas = rowChange.getRowDatasList();

    for (CanalEntry.RowData rowData : rowDatas) {

    sendKafkaMsg(rowData, entry, eventType);

    }

    }

    } catch (InvalidProtocolBufferException e) {

    LOGGER.error(e.getMessage(), e);

    }

    }

    }

    }

    開發者ID:kevinKaiF,項目名稱:cango,代碼行數:22,

    示例5: AbstractEventParser

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public AbstractEventParser(){

    // 初始化一下

    transactionBuffer = new EventTransactionBuffer(new TransactionFlushCallback() {

    public void flush(List transaction) throws InterruptedException {

    boolean successed = consumeTheEventAndProfilingIfNecessary(transaction);

    if (!running) {

    return;

    }

    if (!successed) {

    throw new CanalParseException("consume failed!");

    }

    LogPosition position = buildLastTransactionPosition(transaction);

    if (position != null) { // 可能position為空

    logPositionManager.persistLogPosition(AbstractEventParser.this.destination, position);

    }

    }

    });

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:22,

    示例6: consumeTheEventAndProfilingIfNecessary

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    protected boolean consumeTheEventAndProfilingIfNecessary(List entrys) throws CanalSinkException,

    InterruptedException {

    long startTs = -1;

    boolean enabled = getProfilingEnabled();

    if (enabled) {

    startTs = System.currentTimeMillis();

    }

    boolean result = eventSink.sink(entrys, (runningInfo == null) ? null : runningInfo.getAddress(), destination);

    if (enabled) {

    this.processingInterval = System.currentTimeMillis() - startTs;

    }

    if (consumedEventCount.incrementAndGet() < 0) {

    consumedEventCount.set(0);

    }

    return result;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:21,

    示例7: parseAndProfilingIfNecessary

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    protected CanalEntry.Entry parseAndProfilingIfNecessary(EVENT bod, boolean isSeek) throws Exception {

    long startTs = -1;

    boolean enabled = getProfilingEnabled();

    if (enabled) {

    startTs = System.currentTimeMillis();

    }

    CanalEntry.Entry event = binlogParser.parse(bod, isSeek);

    if (enabled) {

    this.parsingInterval = System.currentTimeMillis() - startTs;

    }

    if (parsedEventCount.incrementAndGet() < 0) {

    parsedEventCount.set(0);

    }

    return event;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:17,

    示例8: processFullPullerMessage

    ​點讚 3

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public int processFullPullerMessage(Map> map, IGenericMessage obj) throws IOException {

    MysqlGenericMessage message = (MysqlGenericMessage) obj;

    CanalEntry.Entry entry = message.getEntry();

    CanalEntry.EventType eventType = entry.getHeader().getEventType();

    if(eventType != CanalEntry.EventType.INSERT) {

    //skip it.

    logger.info ("Skipped a FULL_PULL_REQUESTS message which is not INSERT Type! :" + eventType.toString());

    return -1;

    }

    CanalEntry.RowChange rowChange = CanalEntry.RowChange.parseFrom(entry.getStoreValue());

    List dataList = rowChange.getRowDatasList();

    if (dataList.size() != 1) {

    throw new RuntimeException(String.format("解壓FULL_PULL_REQUESTS 發現 %d 條bach數據,應該隻有一條", dataList.size()));

    }

    //為了向下兼容,使用PULL_REMARK 保存dsName

    String dsName = null;

    String schema = null;

    String table = null;

    List columns = dataList.get(0).getAfterColumnsList();

    for (CanalEntry.Column column : columns) {

    if (column.getName().equalsIgnoreCase("PULL_REMARK")) {

    dsName = column.getValue();

    } else if (column.getName().equalsIgnoreCase("SCHEMA_NAME")) {

    schema = column.getValue();

    } else if (column.getName().equalsIgnoreCase("TABLE_NAME")) {

    table = column.getValue();

    }

    }

    if (dsName == null || schema == null || table == null) {

    throw new RuntimeException("解壓FULL_PULL_REQUESTS 發現 dsName 或 schema 或 table為空.");

    }

    if (!dsName.equalsIgnoreCase(dsInfo.getDbSourceName())) {

    logger.info("Skipped other datasource FULL_PULL_REQUESTS! : {}.{}.{}" , dsName, schema, table);

    return -1;

    }

    logger.info(String.format("Get FULL_PULL_REQUESTS message : %s.%s.%s", dsName, schema, table));

    //單獨發送一條 拉全量的消息

    List subList = new ArrayList<>();

    subList.add(message);

    map.put(schema, subList);

    return 0;

    }

    開發者ID:BriData,項目名稱:DBus,代碼行數:51,

    示例9: unwrapMessages

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public List unwrapMessages(byte[] data) throws IOException {

    List list = new ArrayList<>();

    CanalPacket.Messages cMessage = CanalPacket.Messages.parseFrom(data);

    List strings = cMessage.getMessagesList();

    for (ByteString str : strings) {

    CanalEntry.Entry ent = CanalEntry.Entry.parseFrom(str);

    MysqlGenericMessage message = new MysqlGenericMessage(ent);

    list.add(message);

    }

    return list;

    }

    開發者ID:BriData,項目名稱:DBus,代碼行數:15,

    示例10: wrapMessages

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public byte[] wrapMessages(List list) throws IOException {

    CanalPacket.Messages.Builder builder = CanalPacket.Messages.newBuilder();

    builder.setBatchId(0);

    for (IGenericMessage obj : list) {

    MysqlGenericMessage message = (MysqlGenericMessage) obj;

    CanalEntry.Entry ent = message.getEntry();

    builder.addMessages(ent.toByteString());

    }

    CanalPacket.Messages cMessage = builder.build();

    return cMessage.toByteArray();

    }

    開發者ID:BriData,項目名稱:DBus,代碼行數:15,

    示例11: trans

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public ElasticsearchMetadata trans(Message message) {

    List entries = message.getEntries();

    ElasticsearchMetadata elasticsearchMetadata = TotoroObjectPool.esMetadata();

    elasticsearchMetadata.setBatchId(message.getId());

    elasticsearchMetadata.setTransForm(this);

    if (entries != null && entries.size() > 0) {

    EsEntryArrayList esEntryList = TotoroObjectPool.esEntryArrayList();

    entries.forEach(entry -> {

    if (messageFilterChain.filter(entry)) {

    try {

    ElasticsearchMetadata.EsEntry esEntry = getElasticsearchMetadata(entry);

    esEntryList.add(esEntry);

    } catch (InvalidProtocolBufferException e) {

    e.printStackTrace();

    }

    }

    });

    elasticsearchMetadata.setEsEntries(esEntryList);

    }

    logger.info("Trans form complete message id =====> {}", message.getId());

    if (logger.isDebugEnabled()) {

    logger.debug("Trans form complete elasticsearch metadata =====> {}", elasticsearchMetadata.toString());

    }

    return elasticsearchMetadata;

    }

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:30,

    示例12: getElasticsearchMetadata

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    private ElasticsearchMetadata.EsEntry getElasticsearchMetadata(CanalEntry.Entry entry) throws InvalidProtocolBufferException {

    final String database = entry.getHeader().getSchemaName(); // => index

    final String table = entry.getHeader().getTableName();// => type

    final CanalEntry.RowChange change = CanalEntry.RowChange.parseFrom(entry.getStoreValue());

    final List rowDataList = change.getRowDatasList();

    CanalEntry.EventType eventType = entry.getHeader().getEventType();

    final int esEventType = esAdapter.getEsEventType(eventType);

    EsRowDataArrayList esRowDataList = TotoroObjectPool.esRowDataArrayList();

    for (CanalEntry.RowData rowData : rowDataList) {

    List columnList = esAdapter.getColumnList(esEventType, rowData);

    ElasticsearchMetadata.EsRowData esRowData = TotoroObjectPool.esRowData();

    EsColumnHashMap columnMap = TotoroObjectPool.esColumnHashMap();

    columnList.forEach(column -> columnMap.put(column.getName(), column.getValue()));

    esRowData.setRowData(columnMap);

    esRowData.setIdColumn(esAdapter.getEsIdColumn(database, table));//獲取es對應的id Column

    esRowDataList.add(esRowData);

    }

    ElasticsearchMetadata.EsEntry esEntry = TotoroObjectPool.esEntry();

    esEntry.setIndex(database)

    .setType(table)

    .setEsRowDatas(esRowDataList)

    .setEventType(esEventType);

    return esEntry;

    }

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:33,

    示例13: sink

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public boolean sink(List entrys, InetSocketAddress remoteAddress, String destination)

    throws CanalSinkException,

    InterruptedException {

    List rowDatas = entrys;

    if (filterTransactionEntry) {

    rowDatas = new ArrayList();

    for (CanalEntry.Entry entry : entrys) {

    if (entry.getEntryType() == EntryType.ROWDATA) {

    rowDatas.add(entry);

    }

    }

    }

    return sinkData(rowDatas, remoteAddress);

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:16,

    示例14: sinkData

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    private boolean sinkData(List entrys, InetSocketAddress remoteAddress)

    throws InterruptedException {

    boolean hasRowData = false;

    boolean hasHeartBeat = false;

    List events = new ArrayList();

    for (CanalEntry.Entry entry : entrys) {

    Event event = new Event(new LogIdentity(remoteAddress, -1L), entry);

    if (!doFilter(event)) {

    continue;

    }

    events.add(event);

    hasRowData |= (entry.getEntryType() == EntryType.ROWDATA);

    hasHeartBeat |= (entry.getEntryType() == EntryType.HEARTBEAT);

    }

    if (hasRowData) {

    // 存在row記錄

    return doSink(events);

    } else if (hasHeartBeat) {

    // 存在heartbeat記錄,直接跳給後續處理

    return doSink(events);

    } else {

    // 需要過濾的數據

    if (filterEmtryTransactionEntry && !CollectionUtils.isEmpty(events)) {

    long currentTimestamp = events.get(0).getEntry().getHeader().getExecuteTime();

    // 基於一定的策略控製,放過空的事務頭和尾,便於及時更新數據庫位點,表明工作正常

    if (Math.abs(currentTimestamp - lastEmptyTransactionTimestamp) > emptyTransactionInterval

    || lastEmptyTransactionCount.incrementAndGet() > emptyTransctionThresold) {

    lastEmptyTransactionCount.set(0L);

    lastEmptyTransactionTimestamp = currentTimestamp;

    return doSink(events);

    }

    }

    // 直接返回true,忽略空的事務頭和尾

    return true;

    }

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:40,

    示例15: start

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public void start() throws CanalStoreException {

    super.start();

    if (Integer.bitCount(bufferSize) != 1) {

    throw new IllegalArgumentException("bufferSize must be a power of 2");

    }

    Assert.notNull(flushCallback, "flush callback is null!");

    indexMask = bufferSize - 1;

    entries = new CanalEntry.Entry[bufferSize];

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:11,

    示例16: put

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    private void put(CanalEntry.Entry data) throws InterruptedException {

    // 首先檢查是否有空位

    if (checkFreeSlotAt(putSequence.get() + 1)) {

    long current = putSequence.get();

    long next = current + 1;

    // 先寫數據,再更新對應的cursor,並發度高的情況,putSequence會被get請求可見,拿出了ringbuffer中的老的Entry值

    entries[getIndex(next)] = data;

    putSequence.set(next);

    } else {

    flush();// buffer區滿了,刷新一下

    put(data);// 繼續加一下新數據

    }

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:15,

    示例17: flush

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    private void flush() throws InterruptedException {

    long start = this.flushSequence.get() + 1;

    long end = this.putSequence.get();

    if (start <= end) {

    List transaction = new ArrayList();

    for (long next = start; next <= end; next++) {

    transaction.add(this.entries[getIndex(next)]);

    }

    flushCallback.flush(transaction);

    flushSequence.set(end);// flush成功後,更新flush位置

    }

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:15,

    示例18: buildLastPosition

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    protected LogPosition buildLastPosition(CanalEntry.Entry entry) { // 初始化一下

    LogPosition logPosition = new LogPosition();

    EntryPosition position = new EntryPosition();

    position.setJournalName(entry.getHeader().getLogfileName());

    position.setPosition(entry.getHeader().getLogfileOffset());

    position.setTimestamp(entry.getHeader().getExecuteTime());

    // add serverId at 2016-06-28

    position.setServerId(entry.getHeader().getServerId());

    logPosition.setPostion(position);

    LogIdentity identity = new LogIdentity(runningInfo.getAddress(), -1L);

    logPosition.setIdentity(identity);

    return logPosition;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:15,

    示例19: filter

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public boolean filter(CanalEntry.Entry entry) throws CanalFilterException {

    if (StringUtils.isEmpty(expression)) {

    return true;

    }

    Map env = new HashMap();

    env.put(ROOT_KEY, entry);

    return (Boolean) AviatorEvaluator.execute(expression, env);

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:10,

    示例20: checkPosition

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    /**

    * 判斷當前的entry和position是否相同

    */

    public static boolean checkPosition(Event event, LogPosition logPosition) {

    EntryPosition position = logPosition.getPostion();

    CanalEntry.Entry entry = event.getEntry();

    boolean result = position.getTimestamp().equals(entry.getHeader().getExecuteTime());

    boolean exactely = (StringUtils.isBlank(position.getJournalName()) && position.getPosition() == null);

    if (!exactely) {// 精確匹配

    result &= StringUtils.equals(entry.getHeader().getLogfileName(), position.getJournalName());

    result &= position.getPosition().equals(entry.getHeader().getLogfileOffset());

    }

    return result;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:17,

    示例21: SingleMessageHandler

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public SingleMessageHandler(List entrys) {

    this.entrys = entrys;

    }

    開發者ID:zhangtr,項目名稱:canal-mongo,代碼行數:4,

    示例22: processHeartBeatMessage

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public int processHeartBeatMessage(Map> map, IGenericMessage obj) throws IOException {

    MysqlGenericMessage message = (MysqlGenericMessage) obj;

    CanalEntry.Entry entry = message.getEntry();

    CanalEntry.EventType eventType = entry.getHeader().getEventType();

    if(eventType != CanalEntry.EventType.INSERT) {

    //skip it.

    logger.info ("Skipped a DB_HEARTBEAT_MONITOR message which is not INSERT Type! :" + eventType.toString());

    return -1;

    }

    CanalEntry.RowChange rowChange = CanalEntry.RowChange.parseFrom(entry.getStoreValue());

    List dataList = rowChange.getRowDatasList();

    if (dataList.size() != 1) {

    throw new RuntimeException(String.format("DB_HEARTBEAT_MONITOR 發現 %d 條bach數據,應該隻有一條", dataList.size()));

    }

    String dsName = null;

    String schemaName = null;

    String tableName = null;

    String packetJson = null;

    List columns = dataList.get(0).getAfterColumnsList();

    for (CanalEntry.Column column : columns) {

    if (column.getName().equalsIgnoreCase("DS_NAME")) {

    dsName = column.getValue();

    } else if (column.getName().equalsIgnoreCase("SCHEMA_NAME")) {

    schemaName = column.getValue();

    } else if (column.getName().equalsIgnoreCase("TABLE_NAME")) {

    tableName = column.getValue();

    } else if (column.getName().equalsIgnoreCase("PACKET"))

    packetJson = column.getValue();

    }

    if (dsName == null || schemaName == null || tableName == null || packetJson == null) {

    throw new RuntimeException("DB_HEARTBEAT_MONITOR 發現 dsName 或 schema 或 table, 或 packetJson 為空.");

    }

    if (!dsName.equalsIgnoreCase(dsInfo.getDbSourceName())) {

    logger.info("Skipped other datasource HeartBeat! : {}.{}.{}" , dsName, schemaName, tableName);

    return -1;

    }

    //logger.info(String.format("Get DB_HEARTBEAT_MONITOR message : %s.%s", schemaName, tableName));

    if (packetJson.indexOf("checkpoint") >= 0) {

    HeartBeatPacket packet = HeartBeatPacket.parse(packetJson);

    statMeter(schemaName, tableName, packet.getTime(), packet.getTxtime());

    }

    List subList = map.get(schemaName);

    if (subList != null) {

    subList.add(message);

    } else {

    subList = new ArrayList<>();

    subList.add(message);

    map.put(schemaName, subList);

    }

    return 0;

    }

    開發者ID:BriData,項目名稱:DBus,代碼行數:62,

    示例23: MysqlGenericMessage

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public MysqlGenericMessage(CanalEntry.Entry entry) {

    this.entry = entry;

    }

    開發者ID:BriData,項目名稱:DBus,代碼行數:4,

    示例24: getEntry

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public CanalEntry.Entry getEntry() {

    return entry;

    }

    開發者ID:BriData,項目名稱:DBus,代碼行數:4,

    示例25: filter

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    @Override

    public boolean filter(CanalEntry.Entry entry) {

    String database = entry.getHeader().getSchemaName();

    String table = entry.getHeader().getTableName();

    return acceptTable.contains(database + CONNECTOR_TEP + table);

    }

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:7,

    示例26: buildPositionForDump

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    protected String buildPositionForDump(CanalEntry.Entry entry) {

    long time = entry.getHeader().getExecuteTime();

    Date date = new Date(time);

    return entry.getHeader().getLogfileName() + ":" + entry.getHeader().getLogfileOffset() + ":"

    + entry.getHeader().getExecuteTime() + "(" + format.format(date) + ")";

    }

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:7,

    示例27: setEventSink

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public void setEventSink(CanalEventSink> eventSink) {

    this.eventSink = eventSink;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:4,

    示例28: getSchemaNameAndTableName

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    private String getSchemaNameAndTableName(CanalEntry.Entry entry) {

    return entry.getHeader().getSchemaName() + "." + entry.getHeader().getTableName();

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:4,

    示例29: add

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public void add(List entrys) throws InterruptedException {

    for (CanalEntry.Entry entry : entrys) {

    add(entry);

    }

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:6,

    示例30: setEntry

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public void setEntry(CanalEntry.Entry entry) {

    this.entry = entry;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:4,

    示例31: getEntry

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public CanalEntry.Entry getEntry() {

    return entry;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:4,

    示例32: Event

    ​點讚 2

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    public Event(LogIdentity logIdentity, CanalEntry.Entry entry){

    this.logIdentity = logIdentity;

    this.entry = entry;

    }

    開發者ID:alibaba,項目名稱:canal,代碼行數:5,

    示例33: filter

    ​點讚 1

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    boolean filter(CanalEntry.Entry entry);

    開發者ID:zhongchengxcr,項目名稱:canal-elasticsearch,代碼行數:2,

    示例34: parse

    ​點讚 1

    import com.alibaba.otter.canal.protocol.CanalEntry; //導入方法依賴的package包/類

    CanalEntry.Entry parse(T event, boolean isSeek) throws CanalParseException;

    開發者ID:alibaba,項目名稱:canal,代碼行數:2,

    注:本文中的com.alibaba.otter.canal.protocol.CanalEntry.Entry方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

    展开全文
  • Map.Entry<K,V>>, Map.Entry 是Map中的一个接口,他的用途是表示一个映射项(里面有Key和Value), 而Set<Map.Entry<K,V>>表示一个映射项的Set。 Map.Entry里有相应的getKey和getValue方法...
  • Python ---(六)Tkinter窗口组件:Entry

    千次阅读 2021-02-09 07:18:03
    The Tkinter Entry Widget##简介Entry(输入框)组件通常用于获取用户的输入文本。##何时使用 Entry 组件?Entry 组件仅允许用于输入一行文本,如果用于输入的字符串长度比该组件可显示空间更长,那内容将被滚动。这...
  • tkinter单行文本框Entry用代码讲解

    千次阅读 2021-11-16 19:45:33
    本篇文章我来讲解Entry单行文本框组件,以后会讲Text多行文本框组件。 单行文本框组件Entry的属性其实很多都是跟标签,按钮组件是一样的,所以,相同的属性我就简单地讲解了,如果不了解,请看我的前面写的关于标签...
  • Tkinter模块(3)-Entry

    2021-05-26 01:32:13
    1.Entry控件Entry控件的作用是在键盘输入的文本信息,它的语法格式如下:my_entry=Entry(容器,可选项)容器即内容放入的位置,可选项和上一节我们学习提到的Button中的可选项类似, 可选择的有:样式功能bg和bd背景...
  • Java Map.Entry的使用方法解析在Map类设计是,提供了一个嵌套接口(static修饰的接口):EntryEntry将键值对的对应关系封装成了对象,即键值对对象,这样我们在遍历Map集合时,就可以从每一个键值对(Entry)对象中...
  • java遍历map entry.set

    2021-04-18 07:49:34
    Java中Map的 entrySet() 详解以及用法(四种遍历map的方...2020年11月30日entrySet是 java中 键-值 对的集合,Set里面的类型是Map.Entry,一般可以通过map.entrySet()得到。 entrySet实现了Set接口,里面存放的是键值对...
  • Cadence Design Entry HDL 使用教程

    千次阅读 2021-01-19 15:42:23
    Cadence Design Entry HDL 使用教程 前言 cadence Design Entry HDL是cadence内部集成的一款板级的EDA设计工具,早期叫 concept HDL。其为cadence最早的原配板级电路图绘制工具,只不过由于后来cadence收购了orcad...
  • entry有进入;入口;条目等意思,那么entry的近义词都有哪些呢?entry的常用短语都有哪些?下面小编为大家带来entry的近义词辨析及常用短语,供大家参考学习!entry近义词:entrance, entry, admittance, admissionentry...
  • webpack entry入口

    2021-04-30 10:37:19
    创建后要对其进行配置,本节我们来看一下如何配置 webpack 中的入口,也就是 entry 属性。 entry 入口可以用于指定 webpack 是从哪个模块开始构建项目的,通过配置 entry 属性的值可以指定一个或多个入口起点,...
  • Python2.7.3 Tkinter Entry(文本框) 说明

    千次阅读 2021-01-13 04:04:59
    属性(Options)background(bg)Type: color说明:文本框的背景颜色#示例from Tkinter import *top = Tk()text = Entry(top, background = 'red')text.pack()mainloop()borderwidth(bd)Type: distance说明:文本框边框...
  • java Map及Map.Entry详解

    2021-02-12 19:23:26
    Map是java中的接口,Map.Entry是Map的一个内部接口。Map提供了一些常用方法,如keySet()、entrySet(),values()等方法。keySet()方法返回值是Map中key值的集合;entrySet()的返回值也是返回一个Set集合,此集合的...
  • Map.Entry用法

    2021-03-14 22:28:58
    Java Entry用法./*** 遍历Map的方式* @author MONEY*/public class test {public static void main(String[] arg0){Map map=new HashMap();map.put("1", "da");map.put("2", "jia");map.put("3", "hao");//第一种...
  • I'm developing a script that will build GUIs automatically after reading a python ... I'm having problems in getting the Entry objects that I build to accept a default value.I pass my method a dic...
  • gdb @entry= 是什么意思

    2021-12-17 19:36:24
    The @entry form refers to the value of the parameter when the function was entered. This isn't always available, but sometimes it is -- there is a DWARF extension for it, and GCC emits this when ...
  • Map和EntryMap和Entry是什么?Map源码Entry源码 Map和Entry是什么? Map是独立的接口,为所有映射结构(Key-Value)的数据提供了统一接口 Entry是Map的内部接口,用于存储键值 Map源码 下面的空格将源码分类:获取...
  • 一、Entry输入框的属性 关于验证详解 参考:https://blog.csdn.net/qq_41556318/article/details/85108328 由于查看了不少资料,很多在这里都没有解释清楚,所以这里单独列出来详细讲解下。 Entry 组件是...
  • 我们也可以将一个文件路径数组传递给 entry 属性,这将创建一个所谓的 "multi-main entry"。在你想要一次注入多个依赖文件,并且将它们的依赖关系绘制在一个 "chunk" 中时,这种方式就很有用。 module.exports =...
  • Map.Entry使用详解

    2021-03-15 10:39:36
    1.Map.Entry说明Map是java中的接口,Map.Entry是Map的一个内部接口。Map提供了一些常用方法,如keySet()、entrySet()等方法,keySet()方法返回值是Map中key值的集合;entrySet()的返回值也是返回一个Set集合,此集合...
  • 在conda python 的虚拟环境中,pip安装包的时候 由于pip的版本低,会出现 Cache entry deserialization failed, entry ignored. 问题解决: 更新pip的版本 在conda的对应的虚拟环境中,执行一下命令: python -m...
  • python中entry用法讲解

    千次阅读 2021-01-29 03:49:53
    小编之前向大家讲解了很多关于字符串的知识,大家也都知道字符串在python中的作用很大,那你知道在python中...1、Entry:用于接受用户Entry小窗口部件单行文本字符串2、使用 Entry 控件的语法w = Entry(master, opti...
  • 简单介绍python可视化模块tkinter的 ttk.Entry控件,主要包括控件的创建、值设置、值监控、密码框等功能。
  • 我在使用tkinter中的Entry box小部件时遇到了麻烦 . 我想在用户选择编辑 - > Backbone ...时打开一个新窗口 . 在这个窗口中,将显示许多Entry小部件(为简单起见,只有一个编码用于下面),它们显示存储在各种实例...
  • 简书的格式真的是有问题,导致复制内容显示问题。完整内容可参考 ...难道.*后面应该再加.*吗? java是怎么导入类的?import java.util.*;import java.util.Map.Entry;II. 具体应用在了map的遍历:for(Entryhou...
  • 展开全部ZipEntry类是java.util.zip包下的一个类,ZipEntry类用于表示 ZIP 文件条32313133353236313431303231363533e58685e5aeb931333337396230目。利用这个类压缩和解压zip文件具体压缩的例子如下:importjava.io....
  • java中的Entry是什么类型

    千次阅读 2021-03-14 14:43:10
    publicstaticinterfaceMap.Entry的API介绍如下:映射项(键-值对)。Map.entrySet方法返回映射的collection视图,其中的元素属于此类。获得映射项引用的唯一方法是通过此collection视图的迭代器来实现。这些Map.Entry...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 851,721
精华内容 340,688
关键字:

entry

友情链接: ULOCK.rar