|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.algorithms.NetworkVertex
public final class NetworkVertex
Nested Class Summary | |
---|---|
static class |
NetworkVertex.StationType
|
static class |
NetworkVertex.ValueOrder
|
static class |
NetworkVertex.VertexType
|
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
NetworkVertex(MapHex hex,
int side)
constructor for side on mapHex |
|
NetworkVertex(MapHex hex,
Station station)
constructor for station on mapHex |
|
NetworkVertex(PublicCompanyI company)
constructor for public company hq |
Method Summary | |
---|---|
(package private) void |
addToRevenueCalculator(RevenueCalculator rc,
int vertexId)
|
int |
compareTo(NetworkVertex otherVertex)
|
static NetworkVertex |
duplicateVertex(org.jgrapht.graph.SimpleGraph<NetworkVertex,NetworkEdge> graph,
NetworkVertex vertex,
java.lang.String newIdentifier,
boolean addOldVertexAsHidden)
creates a new virtual vertex with identical properties and links |
City |
getCity()
|
java.lang.String |
getCityName()
|
MapHex |
getHex()
|
java.lang.String |
getIdentifier()
|
int |
getSide()
|
Station |
getStation()
|
NetworkVertex.StationType |
getStationType()
|
NetworkVertex.VertexType |
getType()
|
int |
getValue()
|
int |
getValueByTrain(NetworkTrain train)
|
static NetworkVertex |
getVertexByIdentifier(java.util.Collection<NetworkVertex> vertices,
java.lang.String identifier)
|
static java.awt.Rectangle |
getVertexMapCoverage(HexMap map,
java.util.Collection<NetworkVertex> vertices)
|
static java.awt.geom.Point2D |
getVertexPoint2D(HexMap map,
NetworkVertex vertex)
|
static java.util.Set<NetworkVertex> |
getVerticesByHex(java.util.Collection<NetworkVertex> vertices,
MapHex hex)
Returns all vertices for a specified hex |
static java.util.Set<NetworkVertex> |
getVerticesByHexes(java.util.Collection<NetworkVertex> vertices,
java.util.Collection<MapHex> hexes)
Filters all vertices from a collection of vertices that lay in a specified collection of hexes |
static NetworkVertex |
getVirtualVertex(NetworkVertex.VertexType type,
java.lang.String name)
factory method for virtual vertex |
static void |
initAllRailsVertices(java.util.Collection<NetworkVertex> vertices,
PublicCompanyI company,
PhaseI phase)
|
void |
initRailsVertex(PublicCompanyI company)
Initialize for rails vertexes |
boolean |
isHQ()
|
boolean |
isMajor()
|
boolean |
isMinor()
|
boolean |
isOfType(NetworkVertex.VertexType vertexType,
NetworkVertex.StationType stationType)
|
boolean |
isSide()
|
boolean |
isSink()
|
boolean |
isStation()
|
boolean |
isVirtual()
|
static int |
maxVertexValue(java.util.Collection<NetworkVertex> vertices)
Returns the maximum positive value (lower bound zero) |
static int |
numberOfVertexType(java.util.Collection<NetworkVertex> vertices,
NetworkVertex.VertexType vertexType,
NetworkVertex.StationType stationType)
Returns the number of specified vertex type in a vertex collection If station then specify station type |
static boolean |
replaceVertex(org.jgrapht.graph.SimpleGraph<NetworkVertex,NetworkEdge> graph,
NetworkVertex oldVertex,
NetworkVertex newVertex)
replaces one vertex by another for a network graph copies all edges |
NetworkVertex |
setCityName(java.lang.String locationName)
|
void |
setRailsVertexValue(PhaseI phase)
|
NetworkVertex |
setSink(boolean sink)
|
NetworkVertex |
setStationType(NetworkVertex.StationType stationType)
|
NetworkVertex |
setValue(int value)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
Constructor Detail |
---|
public NetworkVertex(MapHex hex, Station station)
public NetworkVertex(MapHex hex, int side)
public NetworkVertex(PublicCompanyI company)
Method Detail |
---|
public static NetworkVertex getVirtualVertex(NetworkVertex.VertexType type, java.lang.String name)
void addToRevenueCalculator(RevenueCalculator rc, int vertexId)
public java.lang.String getIdentifier()
public boolean isVirtual()
public boolean isStation()
public boolean isSide()
public boolean isHQ()
public NetworkVertex.VertexType getType()
public boolean isMajor()
public boolean isMinor()
public NetworkVertex.StationType getStationType()
public NetworkVertex setStationType(NetworkVertex.StationType stationType)
public int getValue()
public int getValueByTrain(NetworkTrain train)
public NetworkVertex setValue(int value)
public boolean isSink()
public NetworkVertex setSink(boolean sink)
public java.lang.String getCityName()
public NetworkVertex setCityName(java.lang.String locationName)
public MapHex getHex()
public Station getStation()
public City getCity()
public int getSide()
public boolean isOfType(NetworkVertex.VertexType vertexType, NetworkVertex.StationType stationType)
public void initRailsVertex(PublicCompanyI company)
public void setRailsVertexValue(PhaseI phase)
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(NetworkVertex otherVertex)
compareTo
in interface java.lang.Comparable<NetworkVertex>
public static void initAllRailsVertices(java.util.Collection<NetworkVertex> vertices, PublicCompanyI company, PhaseI phase)
public static int maxVertexValue(java.util.Collection<NetworkVertex> vertices)
public static int numberOfVertexType(java.util.Collection<NetworkVertex> vertices, NetworkVertex.VertexType vertexType, NetworkVertex.StationType stationType)
public static NetworkVertex duplicateVertex(org.jgrapht.graph.SimpleGraph<NetworkVertex,NetworkEdge> graph, NetworkVertex vertex, java.lang.String newIdentifier, boolean addOldVertexAsHidden)
public static boolean replaceVertex(org.jgrapht.graph.SimpleGraph<NetworkVertex,NetworkEdge> graph, NetworkVertex oldVertex, NetworkVertex newVertex)
public static java.util.Set<NetworkVertex> getVerticesByHexes(java.util.Collection<NetworkVertex> vertices, java.util.Collection<MapHex> hexes)
public static java.util.Set<NetworkVertex> getVerticesByHex(java.util.Collection<NetworkVertex> vertices, MapHex hex)
public static NetworkVertex getVertexByIdentifier(java.util.Collection<NetworkVertex> vertices, java.lang.String identifier)
public static java.awt.geom.Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex)
public static java.awt.Rectangle getVertexMapCoverage(HexMap map, java.util.Collection<NetworkVertex> vertices)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |