

from org.gvsig.fmap.mapcontext.layers import FLayers as JFLayers


def __call(self):
  return self

def __iter(self):
  for i in range(0,self.getLayersCount()):
    layer = self.getLayer(i)
    yield layer

def __len(self):
  return self.getLayersCount()

def __getitem(self, index):
  return self.getLayer(index)

#
# Inject new methods in the class JFLayers
#

JFLayers.__call__ = __call
JFLayers.__iter__ = __iter
JFLayers.__len__ = __len
JFLayers.__getitem__ = __getitem

