/[fenfire]/fenfire/org/fenfire/loom/Cursor.java
ViewVC logotype

Diff of /fenfire/org/fenfire/loom/Cursor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by benja, Tue Mar 4 11:17:19 2003 UTC revision 1.4 by benja, Tue Mar 4 12:28:39 2003 UTC
# Line 45  public class Cursor { Line 45  public class Cursor {
45       */       */
46      public int rotation;      public int rotation;
47    
48      /** The comparator used to order the nodes in the graph.      /** The comparator used to order statements by subject.
49       *  The vertical order of nodes is determined by this Comparator.       *  The vertical order of object nodes
50         *  is determined by this Comparator.
51       */       */
52      public Comparator order;      protected Comparator subjOrder;
53    
54      /** Compare statements by their subjects.      /** The comparator used to order statements by object.
55       *  <code>subjOrder</code> orders statements by applying       *  The vertical order of subject nodes
56       *  <code>order</code> to their subjects.       *  is determined by this Comparator.
57       */       */
58      protected Comparator subjOrder = new Comparator() {      protected Comparator objOrder;
             public int compare(Object o1, Object o2) {  
                 Statement s1 = (Statement)o1, s2 = (Statement)o2;  
                 return order.compare(s1.getSubject(), s2.getSubject());  
             }  
         };  
   
     /** Compare statements by their objects.  
      *  <code>objOrder</code> orders statements by applying  
      *  <code>order</code> to their objects.  
      */  
     protected Comparator objOrder = new Comparator() {  
             public int compare(Object o1, Object o2) {  
                 Statement s1 = (Statement)o1, s2 = (Statement)o2;  
                 return order.compare(s1.getObject(), s2.getObject());  
             }  
         };  
59    
60      /** Create a new cursor without giving it a position yet.      /** Create a new cursor without giving it a position yet.
61       */       */
62      public Cursor(Comparator order) {      public Cursor(Comparator subjOrder, Comparator objOrder) {
63          this.order = order;          this.subjOrder = subjOrder;
64            this.objOrder = objOrder;
65      }      }
66    
67      /** Create a new cursor and give it a position.      /** Create a new cursor and give it a position.
68       */       */
69      public Cursor(Comparator order, Resource focus, int dir,      public Cursor(Comparator subjOrder, Comparator objOrder,
70                      Resource focus, int dir,
71                    RDFNode rotation) {                    RDFNode rotation) {
72          this(order);          this(subjOrder, objOrder);
73          set(focus, dir, rotation);          set(focus, dir, rotation);
74      }      }
75    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26