leila.patterns
Class Bridge

java.lang.Object
  extended by leila.patterns.Bridge
All Implemented Interfaces:
java.io.Serializable

public final class Bridge
extends java.lang.Object
implements java.io.Serializable

This class is part of LEILA (http://mpii.de/yago-naga/leila). It is licensed under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0) by the author Fabian M. Suchanek (http://suchanek.name).

Bridge.java stores a bridge, i.e. a list of Links. The only difference to a List is the implementation of hashCode() and equals(), which do not take into account the last word. This is a Wrapper Class, i.e. no deep copies are made.

See Also:
Serialized Form

Field Summary
 java.util.List<Link> links
          Holds the links
 
Constructor Summary
Bridge(java.util.List<Link> l)
          Constructs a Bridge
 
Method Summary
 boolean equals(java.lang.Object o)
          Two Bridges are equal if their links are the same (except for the last destination word)
 Bridge essentialize()
          Returns a new Bridge with all Links essentialized
 int hashCode()
          Returns a hashCode for this Bridge
 java.lang.String toString()
          Returns a String representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

links

public java.util.List<Link> links
Holds the links

Constructor Detail

Bridge

public Bridge(java.util.List<Link> l)
Constructs a Bridge

Method Detail

hashCode

public int hashCode()
Returns a hashCode for this Bridge

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two Bridges are equal if their links are the same (except for the last destination word)

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a String representation

Overrides:
toString in class java.lang.Object

essentialize

public Bridge essentialize()
Returns a new Bridge with all Links essentialized