Robin008

这是从hadoop源码中间截取的一个片段,你看看你能不能看懂:如果不能看懂,说明你的javase基础很差。

private static class GroupFactory

extends CounterGroupFactory<Counter, CounterGroup> {

@Override
protected <T extends Enum<T>>
FrameworkGroupFactory<CounterGroup>
newFrameworkGroupFactory(final Class<T> cls) {

       return new FrameworkGroupFactory<CounterGroup>() {
              @Override 
              public CounterGroup newGroup(String name) {
                        return new FrameworkGroupImpl<T>(cls); // impl in this package
              }
          }; //这是一个匿名类的写法。
   }

@Override
protected CounterGroup newGenericGroup(String name, String displayName,
Limits limits) {
         return new GenericGroup(name, displayName, limits);
       }

@Override
protected CounterGroup newFileSystemGroup() {
      return new FileSystemGroup();
      }
}

  

分类:

技术点:

相关文章:

  • 2021-10-10
  • 2021-07-07
  • 2021-05-13
  • 2021-11-26
  • 2021-11-18
  • 2021-11-06
  • 2021-06-28
  • 2021-06-12
猜你喜欢
  • 2021-04-04
  • 2021-07-19
  • 2021-04-20
  • 2022-01-07
  • 2021-04-25
  • 2022-01-16
相关资源
相似解决方案