vote
Class Substitution
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--vote.Substitution
- All Implemented Interfaces:
- Cloneable, Map, Serializable
- public class Substitution
- extends Hashtable
This class represents a substitution map between nodes.
- Author:
- P. URSO
- See Also:
Node
,
Serialized Form
Constructor Summary |
Substitution()
Constructs a new, empty substitution map. |
Substitution(vote.Node from,
vote.Node to)
Constructs a new substitution map with only one mapping and
very little capacity. |
Method Summary |
vote.Node |
getImage(Object node)
Returns the node to which the specified node is mapped. |
static vote.Substitution |
makeFilter(vote.Node from,
vote.Node to)
Returns a filter between two nodes, if possible. |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Substitution
public Substitution()
- Constructs a new, empty substitution map.
Substitution
public Substitution(vote.Node from,
vote.Node to)
- Constructs a new substitution map with only one mapping and
very little capacity.
- Parameters:
from
- the origin node.
getImage
public vote.Node getImage(Object node)
- Returns the node to which the specified node is mapped.
- Parameters:
node
- the node.
- Returns:
- the node to which the specified node is mapped.
makeFilter
public static vote.Substitution makeFilter(vote.Node from,
vote.Node to)
- Returns a filter between two nodes, if possible.
- Parameters:
from
- the origin node.to
- the image node.
- Returns:
- the substitution map if such a filter exists, null otherwise.