cz.cuni.amis.pogamut.ut2004.agent.module.sensor
Class NavLinkPair

Package class diagram package NavLinkPair
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.module.sensor.NavLinkPair

public class NavLinkPair
extends Object

NavLinkPair representing info about links between two navpoints, such info comprises of 1 or 2 NavPointNeighbourLink. hashCode() and equals(Object) overridden.

Author:
Jimmy

Constructor Summary
NavLinkPair(NavPointNeighbourLink first)
           
NavLinkPair(NavPointNeighbourLink first, NavPointNeighbourLink second)
          If 'first' is NULL and 'second' is NULL ...
 
Method Summary
 boolean equals(Object obj)
           
 double getDistance(ILocated point)
          Distance "point" from "link".
 Location getFirstVector()
          Get vector of the first link.
 NavPointNeighbourLink getLinkComingFrom(NavPoint navPointLinkIsComingFrom)
          Returns link that originates in 'navPointLinkIsComingFrom', if such exists.
 NavPointNeighbourLink getLinkComingFrom(UnrealId navPointLinkIsComingFromId)
          Returns link that originates in 'navPointLinkIsComingFromId', if such exists.
 NavPointNeighbourLink getLinkLeadingTo(NavPoint navPointLinkEndsIn)
          Returns link that ends in 'navPointLinkEndsIn', if such exists.
 NavPointNeighbourLink getLinkLeadingTo(UnrealId navPointLinkEndsInId)
          Returns link that ends in 'navPointLinkEndsInId', if such exists.
 NavPointNeighbourLink getNavLink1()
          Returns first NavPointNeighbourLink, this is NEVER NULL.
 NavPointNeighbourLink getNavLink2()
          Returns second NavPointNeighbourLink, may be null.
 NavPoint getNavPoint1()
          Returns first's NavPointNeighbourLink.getFromNavPoint(), this is NEVER NULL.
 NavPoint getNavPoint2()
          Returns first's NavPointNeighbourLink.getToNavPoint(), this is NEVER NULL.
 Location getSecondVector()
          Get vector of the second link.
 int hashCode()
           
 boolean isLinkNavPoint(NavPoint navPoint)
          Does this NavLinkPair contains (as either end) 'navPoint'.
 boolean isLinkNavPoint(UnrealId navPointId)
          Does this NavLinkPair contains (as either end) 'navPoint'.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavLinkPair

public NavLinkPair(NavPointNeighbourLink first)

NavLinkPair

public NavLinkPair(NavPointNeighbourLink first,
                   NavPointNeighbourLink second)
If 'first' is NULL and 'second' is NULL ... throws IllegalArgumentException. If 'first' is NULL and 'second' is NOT ... it swaps 'first' and 'second'. If 'first' is NOT NULL and 'second' is NOT NULL ... it may swap them to satisfy hashCode() implementation.

Parameters:
first -
second -
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getNavLink1

public NavPointNeighbourLink getNavLink1()
Returns first NavPointNeighbourLink, this is NEVER NULL.

Returns:

getNavLink2

public NavPointNeighbourLink getNavLink2()
Returns second NavPointNeighbourLink, may be null.

Returns:

getNavPoint1

public NavPoint getNavPoint1()
Returns first's NavPointNeighbourLink.getFromNavPoint(), this is NEVER NULL.

Returns:

getNavPoint2

public NavPoint getNavPoint2()
Returns first's NavPointNeighbourLink.getToNavPoint(), this is NEVER NULL.

Returns:

isLinkNavPoint

public boolean isLinkNavPoint(NavPoint navPoint)
Does this NavLinkPair contains (as either end) 'navPoint'.

Parameters:
navPoint -
Returns:

isLinkNavPoint

public boolean isLinkNavPoint(UnrealId navPointId)
Does this NavLinkPair contains (as either end) 'navPoint'.

Parameters:
navPoint -
Returns:

getLinkLeadingTo

public NavPointNeighbourLink getLinkLeadingTo(UnrealId navPointLinkEndsInId)
Returns link that ends in 'navPointLinkEndsInId', if such exists.

Parameters:
navPointLinkEndsInId -
Returns:

getLinkComingFrom

public NavPointNeighbourLink getLinkComingFrom(UnrealId navPointLinkIsComingFromId)
Returns link that originates in 'navPointLinkIsComingFromId', if such exists.

Parameters:
navPointLinkIsComingFromId -
Returns:

getLinkLeadingTo

public NavPointNeighbourLink getLinkLeadingTo(NavPoint navPointLinkEndsIn)
Returns link that ends in 'navPointLinkEndsIn', if such exists.

Parameters:
navPointLinkEndsIn -
Returns:

getLinkComingFrom

public NavPointNeighbourLink getLinkComingFrom(NavPoint navPointLinkIsComingFrom)
Returns link that originates in 'navPointLinkIsComingFrom', if such exists.

Parameters:
navPointLinkIsComingFrom -
Returns:

getFirstVector

public Location getFirstVector()
Get vector of the first link.

Returns:

getSecondVector

public Location getSecondVector()
Get vector of the second link.

Returns:

getDistance

public double getDistance(ILocated point)
Distance "point" from "link". See: http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html

Parameters:
point -
Returns:


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.