## Python to Java

Hello,
i get quite short code of algorithm in python, but i need to translate it to Java. I didnt find any program to do that, so i will really appreciate to help translating it.

I learned python a little to know how algorithm work.

The biggest problem is because in python all is object and some things are made really very confuzing. At first i dont know which structure to take in java.

code is:
Code:
class FlowNetwork(object):
def __init__(self):

def get_edges(self, v):

self.flow[(u,v)] = self.flow[(v,u)] = 0

def find_path(self, source, sink, path):
if source == sink:
return path
for vertex, capacity in self.get_edges(source):
residual = capacity - self.flow[(source,vertex)]
edge = (source,vertex,residual)
if residual > 0 and not edge in path:
result = self.find_path(vertex, sink, path + [edge])
if result != None:
return result

def max_flow(self, source, sink):
path = self.find_path(source, sink, [])
while path != None:
flow = min(r for u,v,r in path)
for u,v,_ in path:
self.flow[(u,v)] += flow
self.flow[(v,u)] -= flow
path = self.find_path(source, sink, [])
return sum(self.flow[(source, vertex)] for vertex, capacity in self.get_edges(source))

g = FlowNetwork()