|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisidia.rule.Star
public class Star
Field Summary | |
---|---|
protected java.lang.String |
centerState
|
protected RuleVector |
neighborhood
|
Constructor Summary | |
---|---|
Star()
default constructor. default centerState is "UNKNOWN" |
|
Star(int arity)
create a Star. which Neighbors doors are numbered from 0 to arity -1. |
|
Star(Star s)
constructor of a star clone of an other. |
|
Star(java.lang.String centerState)
|
|
Star(java.lang.String centerState,
int arity)
create a Star which Neighbors doors are numbered from 0 to arity -1. |
Method Summary | |
---|---|
void |
addNeighbor(Neighbor v)
add a the Neighbor v to the neighborhood. the Neighbor is added at the end of the vector. |
int |
arity()
|
java.lang.String |
centerState()
|
java.lang.Object |
clone()
|
int |
contains(Neighbor nei)
looks in the star for a Neighbor equals to the Neighbor nei. |
boolean |
contains(Star context)
warning: this method sets doors of context by those of corresponding elements in the star. so always use a copy of the context while using this method. the sense of equality is defined in the class Neighbor |
int |
containsLabel(Neighbor nei)
looks in the star for a Neighbor with the same label of the Neighbor nei. the operation "looking for" is Randomized |
boolean |
containsLabels(Star star)
|
Neighbor |
neighbor(int i)
|
int |
neighbourDoor(int i)
|
RuleVector |
neighbourhood()
|
void |
removeAll()
remove all elements from neighborhood. |
void |
removeNeighbour(int i)
remove from neighborhood the neighbor at position i. |
boolean |
sameCentState(Star s2)
|
void |
setCenterState(java.lang.String state)
|
void |
setDoors(Star b)
sets the door numbers of the star, with the value of door numbers of those at the same position in the star b. |
void |
setState(int position,
Neighbor n)
sets the Neighbor n at the position i in the neighborhood. |
void |
setStates(Star b)
sets states of the star elements (center and neighbors), with the value of states of those at the same position in the star b. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String centerState
protected RuleVector neighborhood
Constructor Detail |
---|
public Star()
public Star(Star s)
s
- a Star.public Star(java.lang.String centerState)
centerState
- the label of the center.public Star(java.lang.String centerState, int arity)
centerState
- the label of the center.arity
- the arity of the star.public Star(int arity)
arity
- the arity of the star.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public void setCenterState(java.lang.String state)
public java.lang.String centerState()
public Neighbor neighbor(int i)
i
- the position
public int neighbourDoor(int i)
i
- a position.
public void addNeighbor(Neighbor v)
v
- a new Neighborpublic void removeNeighbour(int i)
i
- a position.public void removeAll()
public void setState(int position, Neighbor n)
position
- a position in neighborhood.n
- a Neighbor.public boolean sameCentState(Star s2)
s2
- star
public int arity()
public RuleVector neighbourhood()
public void setDoors(Star b)
b
- a star with the same arity.public void setStates(Star b)
b
- a star with the same arity.public int contains(Neighbor nei)
nei
-
public int containsLabel(Neighbor nei)
nei
-
public boolean contains(Star context)
context
- a context
public boolean containsLabels(Star star)
star
- a star
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |