01: /* Copyright 2005 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.layout.dlm;
07:
08: import org.w3c.dom.Element;
09:
10: /**
11: * @version $Revision: 35705 $ $Date: 2005-05-01 20:14:20 -0700 (Sun, 01 May 2005) $
12: * @since uPortal 2.5
13: */
14: public class NodeInfo {
15: public static final String RCS_ID = "@(#) $Header$";
16:
17: String id = null;
18: Element node = null;
19: boolean differentParent = false;
20: int indexInCVP = -1; // CVP = Composite View Parent
21: Precedence precedence = null;
22: Element positionDirective = null;
23:
24: NodeInfo(Element node) {
25: this .node = node;
26: precedence = Precedence.newInstance(node
27: .getAttribute(Constants.ATT_FRAGMENT));
28: id = node.getAttribute(Constants.ATT_ID);
29: }
30:
31: NodeInfo(Element node, int indexInCVP) {
32: this (node);
33: this .indexInCVP = indexInCVP;
34: }
35:
36: public boolean equals(Object o) {
37: if (o != null && o instanceof NodeInfo
38: && ((NodeInfo) o).id.equals(id))
39: return true;
40: if (o == this )
41: return true;
42: return false;
43: }
44:
45: public String toString() {
46: return "ni[ id:" + id + ", diffPrnt:" + differentParent
47: + ", idxInCVP:" + indexInCVP + ", prec:" + precedence
48: + " ]";
49: }
50: }
|