代码之家  ›  专栏  ›  技术社区  ›  Edelcom

在Java(Android)语言中,Delphi是否有类似TSTRIGLIST的内容?

  •  0
  • Edelcom  · 技术社区  · 14 年前

    我开始 在Android中开发 决定去本地玩 JAVA语言 .

    当开始使用新语言时,我倾向于创建一个代码库,创建具有相同名称的例程,这些例程执行的功能与我已经拥有的库中的相同。

    在我的经典ASP库中,我有一个intToStr()。函数,它相当于delphi的inttostr(),尽管我知道vbscript不需要这样的函数-它使不同语言的代码更易于阅读,从而更容易在语言之间切换。

    来自A Delphi背景 我有很多Delphi的库代码 列表列表 类。

    爪哇有什么等价物吗? ?或者你如何解决这个问题?

    4 回复  |  直到 11 年前
        1
  •  1
  •   alexoffspring    14 年前

        2
  •  4
  •   Andreas Dolk    14 年前

    Map TreeMap HashMap

    public class TStringList {  // unconventional Java name, but you like to keep the delphi names
      private class Entry {
        String key;
        Object value;  // to keep it flexible
      }
      private List<Entry> entries = new ArrayList<Entry>();
    
      // add some constructors
    
      // implement methods of delphis StringList
    }
    

    List

        3
  •  2
  •   thejh    14 年前

    LinkedList<String> myStrings = new LinkedList<String>();
    myStrings.add("hello");
    String s = myStrings.get(0);
    
        4
  •  0
  •   Fabricio Araujo    14 年前