6 Replies Latest reply on Nov 16, 2010 10:47 AM by JoshBeall

    How can I extend the Vector class?

    JoshBeall Level 1

      Hi All,

       

      I'm trying to extend the Vector class so I can get add a .remove(item:T) method to the class.  I've tried this:

       

      public class VectorCollection extends Vector.<T>

       

      That gives me the compile error "1017: The definition of base class Vector was not found"

       

      So then I tried:

       

      public class VectorCollection extends Vector

       

      Which gives me the compile error "1016: Base class is final."

       

      There must be some way to extend the Vector class, though, as on the Vector's official docs page it says:

       

      Note: To override this method in a subclass of Vector, use ...args for the parameters, as this example shows:
           public override function splice(...args) {
             // your statements here
           }
      
      

       

      So there must be a way to extend the Vector class.  What am I doing wrong?