由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - how to implement destructor in java?
相关主题
画多边形怎么实现?怎么在application实现delay?
can applet implements runnable?Stack Frame of your JVM implementation
问一个特别土的问题The shape of JVM stack frame
Timer and TimerTaskHow does a client find and connect to a specific
jvm是怎么implement monitor的?Re: Can create a Interface object, why?
interface和implementation classRe: print problem, GUI guru please come in
为什么java没有destructorRe: JPanel help!
Don't call virtual functions in constructor/destructorRe: How to use abstract class?
相关话题的讨论汇总
话题: implement话题: destructor话题: java话题: map话题: edges
进入Java版参与讨论
1 (共1页)
l*********s
发帖数: 5409
1
Say, to implement a directed map of G(vertex,arcs) with adjacency lists.
Naturally, one would like to deleted all the edges associated with a given
node when trying to delete it.
Without explicit call of destructor, how to do this in Java?
g*****g
发帖数: 34805
2
Map.remove doesn't do it for you?

【在 l*********s 的大作中提到】
: Say, to implement a directed map of G(vertex,arcs) with adjacency lists.
: Naturally, one would like to deleted all the edges associated with a given
: node when trying to delete it.
: Without explicit call of destructor, how to do this in Java?

l*********s
发帖数: 5409
3
We are asked to implement the map and associated algorithm as exercises,
thus java's prepackaged data structures cannot be used. So your suggestion
is to manually dereference all the edges from a vertex from the Map class,
right?

【在 g*****g 的大作中提到】
: Map.remove doesn't do it for you?
g*****g
发帖数: 34805
4
No, the edges are a list for value, the vertex is the key, remove the key
and
it's all done. If you have to implement map, then implement one.

【在 l*********s 的大作中提到】
: We are asked to implement the map and associated algorithm as exercises,
: thus java's prepackaged data structures cannot be used. So your suggestion
: is to manually dereference all the edges from a vertex from the Map class,
: right?

l*********s
发帖数: 5409
5
明白了,谢谢好虫!

【在 g*****g 的大作中提到】
: No, the edges are a list for value, the vertex is the key, remove the key
: and
: it's all done. If you have to implement map, then implement one.

1 (共1页)
进入Java版参与讨论
相关主题
Re: How to use abstract class?jvm是怎么implement monitor的?
Is this a Bug or not?interface和implementation class
Re: real time control in java为什么java没有destructor
Re: How to showStatus in Applet?Don't call virtual functions in constructor/destructor
画多边形怎么实现?怎么在application实现delay?
can applet implements runnable?Stack Frame of your JVM implementation
问一个特别土的问题The shape of JVM stack frame
Timer and TimerTaskHow does a client find and connect to a specific
相关话题的讨论汇总
话题: implement话题: destructor话题: java话题: map话题: edges