public class Vertices<T extends java.io.Serializable>
extends java.lang.Object
| Constructor and Description |
|---|
Vertices()
Constructor
|
Vertices(int cap)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addVertex(T t)
Adds a new vertex
|
void |
deleteVertex(int pos)
Deletes a vertex
|
int |
getNumVertices()
Returns the number of vertices
|
int |
getPositionOfVertex(T o)
Returns the position of a vertex
|
T |
getVertex(int i)
Returns the data of a vertex
|
java.util.Iterator<T> |
iterator() |
static <T extends java.io.Serializable> |
readVertices(java.lang.String fich)
Reads the information of a file to create a list of vertex with this
information
|
void |
saveVertices(java.lang.String fich)
Saves the information of the vertices into a file, so that you can
reconstruct the vertex with this file
|
public Vertices()
public Vertices(int cap)
cap - the number of verticespublic int getNumVertices()
public T getVertex(int i)
i - , the position of the vertexpublic void deleteVertex(int pos)
pos - the position of the vertexpublic int getPositionOfVertex(T o)
o - , the data of the vertexpublic void addVertex(T t)
t - the data of the new vertexpublic void saveVertices(java.lang.String fich)
throws java.io.IOException
fich - the name of the filejava.io.IOExceptionpublic static <T extends java.io.Serializable> Vertices<T> readVertices(java.lang.String fich) throws java.lang.Exception
fich - the name of the filejava.lang.Exceptionpublic java.util.Iterator<T> iterator()