Menu

OverloadHandler more specific

Help
eRom
2005-01-14
2013-04-17
  • eRom

    eRom - 2005-01-14

    Hi,

    I test some cases with Overloading concept....
    Very cool tool !

    Is there any possibility to build an OverloadHanlder for :
    - Null or undefined arguments
    - one or multi arguments.....

    Exemple, if I have a small test class like that :
    class TryOverload
    {
         function TryOverload() {
             var overload:Overload = new Overload(this);
        overload.addHandler([Number], setNumber);
        overload.addHandler([String], setString);
        overload.forward(arguments);
         }
    }

    In myfla I try a
    var test = new TryOverload(10,10,10,20,30);
    or
    var test = new TryOverload(10,10);
    or
    var test = new TryOverload();

    How can I build OverloadHandler ?

    Thanks ;)

    eRom.

     
    • eRom

      eRom - 2005-01-16

      Okay I've got the solution in RFE

      Thanks.

       
    • Simon Wacker

      Simon Wacker - 2005-01-17

      Okay you already got it. ;)
      You must create a new class that extends the OverloadHandler class and add this class via the appropriate method to an instance of class Overload.

       
    • Simon Wacker

      Simon Wacker - 2005-01-17

      The Overload Handler from the CVS supports null and undefined arguments.
      Multiple Arguments probably won't be supported.

       
    • eRom

      eRom - 2005-01-17

      "Multiple Arguments probably won't be supported."

      Okay...the solution is to Test for arguments length between overloading so....
      However it should be cool for constructing, for exemple,  an Array with Array instance or list of elements....

      But indeed it is a very specific situation ;)

      Thanks.

      eRom

       
    • Simon Wacker

      Simon Wacker - 2005-01-17

      Okay. I'll add it to my todo list. ;)
      I'll implement it the way Java does.

      Cheers
      Simon

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.