leila.patterns
Class Link

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

public final class Link
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).

Link.java represents a link from one LinkageWord to another.

See Also:
Serialized Form

Nested Class Summary
static class Link.Connector
          Type of all connectors
static class Link.Direction
          Link direction type
 
Field Summary
 Link.Connector connector
          Contains the connector
static java.lang.String[] connectorDescription
          Contains adescription for each connector
 LinkageWord destination
          Points where the link points
 Link.Direction direction
          Link direction
static int MAXINT
          The number of bits required to store a Link
 
Constructor Summary
Link(Link.Connector t, Link.Direction r, LinkageWord p)
          Creates a Link from a connector, a direction and a destination
Link(java.lang.String t, Link.Direction r, LinkageWord p)
          Creates a Link from a connector (as String) , a direction and a destination
 
Method Summary
static Link.Connector connectorFor(java.lang.String t)
          Returns a connector for a string
 boolean equals(java.lang.Object o)
          Two links are equal if connector, direction and destination are equal
 Link essentialize()
          Returns this link with an essentialized destination
 int hashCode()
          Returns a hashCode
 double similarity(Link l)
          Returns a similarity measure
 int toInt()
          Returns a (lossy) integer representation of this link
 java.lang.String toString()
          Returns a String representation (for debugging)
static Link.Connector unInt(int i)
          Returns the Connector for an int
 boolean wequals(java.lang.Object o)
          Two links are weakly equal if connector and direction are equal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAXINT

public static final int MAXINT
The number of bits required to store a Link


connector

public Link.Connector connector
Contains the connector


destination

public LinkageWord destination
Points where the link points


direction

public Link.Direction direction
Link direction


connectorDescription

public static java.lang.String[] connectorDescription
Contains adescription for each connector

Constructor Detail

Link

public Link(java.lang.String t,
            Link.Direction r,
            LinkageWord p)
Creates a Link from a connector (as String) , a direction and a destination


Link

public Link(Link.Connector t,
            Link.Direction r,
            LinkageWord p)
Creates a Link from a connector, a direction and a destination

Method Detail

connectorFor

public static Link.Connector connectorFor(java.lang.String t)
Returns a connector for a string


toString

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

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two links are equal if connector, direction and destination are equal

Overrides:
equals in class java.lang.Object

wequals

public boolean wequals(java.lang.Object o)
Two links are weakly equal if connector and direction are equal


similarity

public double similarity(Link l)
Returns a similarity measure


essentialize

public Link essentialize()
Returns this link with an essentialized destination


toInt

public int toInt()
Returns a (lossy) integer representation of this link


unInt

public static Link.Connector unInt(int i)
Returns the Connector for an int


hashCode

public int hashCode()
Returns a hashCode

Overrides:
hashCode in class java.lang.Object