visidia.rule
Class Neighbor

java.lang.Object
  extended by visidia.rule.Neighbor

public class Neighbor
extends java.lang.Object

A Neighbor contains all the information concerning a node.


Field Summary
protected  int door
           
protected  boolean mark
           
protected  java.lang.String state
           
 
Constructor Summary
Neighbor()
          the default constructor default values are : "UNKNOWN", false , -1
Neighbor(boolean edgMark, int door)
           
Neighbor(int door)
           
Neighbor(java.lang.String state)
           
Neighbor(java.lang.String state, boolean edgMark)
           
Neighbor(java.lang.String state, boolean edgMark, int door)
          constructor.
 
Method Summary
 java.lang.Object clone()
           
 int doorNum()
          return the door number.
 boolean equals(Neighbor n)
          two neighbors are equal if they have same labels, marks, and doors.
 boolean mark()
          return the edge mark.
 boolean sameState(Neighbor n)
          compare only the labels.
 void setDoorNum(int n)
          set the value of door.
 void setState(Neighbor n)
          sets properties with value of those of the Neighbor given on parameters. only the door number is not set.
 java.lang.String state()
          return the state ( a )
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

state

protected java.lang.String state

mark

protected boolean mark

door

protected int door
Constructor Detail

Neighbor

public Neighbor()
the default constructor default values are : "UNKNOWN", false , -1


Neighbor

public Neighbor(java.lang.String state,
                boolean edgMark,
                int door)
constructor.

Parameters:
state - the new Label
edgMark - the mark of the edge
door - the number of the door

Neighbor

public Neighbor(java.lang.String state,
                boolean edgMark)

Neighbor

public Neighbor(boolean edgMark,
                int door)

Neighbor

public Neighbor(java.lang.String state)
Parameters:
state - the label of the node

Neighbor

public Neighbor(int door)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

doorNum

public int doorNum()
return the door number.

Returns:
accessor to door.

setDoorNum

public void setDoorNum(int n)
set the value of door.

Parameters:
n - the new door number.

setState

public void setState(Neighbor n)
sets properties with value of those of the Neighbor given on parameters. only the door number is not set.

Parameters:
n - Neighbor.

mark

public boolean mark()
return the edge mark.

Returns:
the edge mark.

state

public java.lang.String state()
return the state ( a )

Returns:
the state (label).

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(Neighbor n)
two neighbors are equal if they have same labels, marks, and doors. doors are not compared if not affected ( -1 ).

Parameters:
n -
Returns:
true if Neighbors are equals, -1 otherwise.

sameState

public boolean sameState(Neighbor n)
compare only the labels.

Parameters:
n -
Returns:
true if labels are equals, -1 otherwise.