Added validIndex() static method to Component.