No, App Inventor does not have the ability to add custom classes. It is an entry level Android compiler that has a limited tool box. However, a programmer can create a plug in to do something like that if you build an App Inventor personal server. The plug in would work with your personal server but not with MIT App Inventor. How can you do this? App Inventor source is OpenSource
http://appinventor.mit.edu/appinventor-sources/ , if you are comfortable programming in Java using Eclipse or Android Studio, you can make your own plug ins.
Regards,
Steve