示例#1
0
 /**
  * Implements equals for a typerel node. Two nodes are equal if the snumber and dnumber fields are
  * the same, and the rnumber fields are the same, or one of these is '-1' (don't care).
  *
  * @since MMBase-1.6.2
  */
 @Override
 public boolean equals(MMObjectNode o1, MMObjectNode o2) {
   if (o2.getBuilder() instanceof TypeRel) {
     int r1 = o1.getIntValue("rnumber");
     int r2 = o2.getIntValue("rnumber");
     return o1.getIntValue("snumber") == o2.getIntValue("snumber")
         && o1.getIntValue("dnumber") == o2.getIntValue("dnumber")
         && (r1 == -1 || r2 == -1 || r1 == r2);
   }
   return false;
 }
示例#2
0
 /**
  * Retrieves all relations which are 'allowed' for a specified node, that is, where the node is
  * either allowed to be the source, or to be the destination (but where the corresponing relation
  * definition is bidirectional). The allowed relations are determined by the type of the node
  *
  * @param node The node to retrieve the allowed relations of.
  * @return An <code>Enumeration</code> of nodes containing the typerel relation data
  */
 public Enumeration<MMObjectNode> getAllowedRelations(MMObjectNode node) {
   return getAllowedRelations(node.getBuilder().getNumber());
 }