图的设计与实现(四)

2014-11-24 11:59:54 · 作者: · 浏览: 118
{
return false;
}
public int setWeight(T v1, T v2)
{
return 0;
}
private Set vSet=null;
public Set vertexSet()
{
if(vSet==null)
{
vSet=new Set()
{
public int size()
{
return vtxMap.size();
}
public boolean isEmpty()
{
return vtxMap.isEmpty();
}
public boolean contains(Object o)
{
return vtxMap.containsKey((T)o);
}
public Iterator iterator()
{
return new IteratorImpl();
}
@Override
public Object[] toArray() {
// TODO Auto-generated method stub
return null;
}
@Override
public T[] toArray(T[] a) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean add(T e) {
// TODO Auto-generated method stub
return false;
}
public boolean remove(Object item)
{
if(vtxMap.containsKey(item))
{
removeVertex(item);
return true;
}
return false;
}
@Override
public boolean containsAll(Collection< > c) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean addAll(Collection< extends T> c) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean retainAll(Collection< > c) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean removeAll(Collection< > c) {
// TODO Auto-generated method stub
return false;
}
@Override
public void clear() {
// TODO Auto-generated method stub
}
};
}
return vSet;
}
}
[java]
package deno.Graphics;
import java.util.LinkedList;
public class VertexInfo
{
public T vertex;
public LinkedList edgeList;
public int inDegree;
public boolean occupied;
public VertexColor Color;
public int dataValue;
public T parent;
public VertexInfo(T v)
{
vertex=v;
edgeList=new LinkedList();
inDegree=0;
occupied=false;
}
}
[java]
package deno.Graphics;
public enum Vert