com.hp.hpl.jena.util.iterator
Class Relation

java.lang.Object
  extended bycom.hp.hpl.jena.util.iterator.Relation

public class Relation
extends java.lang.Object

A sparse 2 dimensional array of boolean indexed by Object. Complete with transitive closure algorithm.

Version:
Release='$Name: $' Revision='$Revision: 1.1.1.1 $' Date='$Date: 2002/12/19 19:21:21 $'
Author:
jjc

Constructor Summary
Relation()
          The empty Relation.
 
Method Summary
 java.util.Set backward(java.lang.Object b)
          The set of a such that a is related to b.
 void clear(java.lang.Object a, java.lang.Object b)
          a is now not related to b
 java.util.Set forward(java.lang.Object a)
          The set of b such that a is related to b.
 boolean get(java.lang.Object a, java.lang.Object b)
          Is a related to b?
 java.util.Set getDiagonal()
          The set of a such that a is related to a.
 java.util.Iterator iterator()
          An Iterator over the pairs of the Relation.
 void set(java.lang.Object a, java.lang.Object b)
          a is now related to b
 void set11(java.lang.Object a, java.lang.Object b)
          Uniquely a is now related to uniquely b.
 void set1N(java.lang.Object a, java.lang.Object b)
          Uniquely a is now related to b.
 void setN1(java.lang.Object a, java.lang.Object b)
          a is now related to uniquely b.
 void setNN(java.lang.Object a, java.lang.Object b)
          a is now related to b
 void transitiveClosure()
          Takes this to its transitive closure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Relation

public Relation()
The empty Relation.

Method Detail

set

public void set(java.lang.Object a,
                java.lang.Object b)
a is now related to b


set11

public void set11(java.lang.Object a,
                  java.lang.Object b)
Uniquely a is now related to uniquely b. When this is called any other a related to this b is removed. When this is called any other b related to this a is removed.


set1N

public void set1N(java.lang.Object a,
                  java.lang.Object b)
Uniquely a is now related to b. Many b's can be related to each a. When this is called any other a related to this b is removed.


setN1

public void setN1(java.lang.Object a,
                  java.lang.Object b)
a is now related to uniquely b. Many a's can be related to each b. When this is called any other b related to this a is removed.


setNN

public void setNN(java.lang.Object a,
                  java.lang.Object b)
a is now related to b


clear

public void clear(java.lang.Object a,
                  java.lang.Object b)
a is now not related to b


get

public boolean get(java.lang.Object a,
                   java.lang.Object b)
Is a related to b?


transitiveClosure

public void transitiveClosure()
Takes this to its transitive closure. See B. Roy. Transitivité et connexité. C.R. Acad. Sci. Paris 249, 1959 pp 216-218. or S. Warshall, A theorem on Boolean matrices, Journal of the ACM, 9(1), 1962, pp11-12


getDiagonal

public java.util.Set getDiagonal()
The set of a such that a is related to a.


forward

public java.util.Set forward(java.lang.Object a)
The set of b such that a is related to b.


backward

public java.util.Set backward(java.lang.Object b)
The set of a such that a is related to b.


iterator

public java.util.Iterator iterator()
An Iterator over the pairs of the Relation. Each pair is returned as a java.util.Map.Entry. The first element is accessed through getKey(), the second through getValue().

See Also:
Map.Entry


Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.