public class PebbleList
extends java.lang.Object
Constructor and Description |
---|
PebbleList(int degree) |
Modifier and Type | Method and Description |
---|---|
void |
addPebble(CompositePebble cp)
Add the pebble without checking whether or not it is better/worse than anything already on the list.
|
void |
clear() |
java.util.ArrayList<CompositePebble> |
getPebbles() |
boolean |
hasUnprocessedPebble() |
boolean |
isPermissible(CompositePebble cp)
Return true if and only if there is no pebble P in the current list that is better than cp.
|
void |
markUnprocessedAllPebblesWithSourceFromSpecifiedVertex(int vertexIndex)
This method will be called by IsSolveableMergePebbles.
|
java.util.ArrayList<CompositePebble> |
processNext()
Combine the first unprocessed pebble with all of the processed pebbles AND with itself.
|
void |
removeCompositePebble(CompositePebble toRemove) |
int |
size() |
java.lang.String |
toString() |
boolean |
tryToAddPebble(CompositePebble cp)
Attempt to add the CompositePebble cp to the list.
|
public java.util.ArrayList<CompositePebble> getPebbles()
public void removeCompositePebble(CompositePebble toRemove)
public void clear()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPermissible(CompositePebble cp)
cp
- public boolean tryToAddPebble(CompositePebble cp)
cp
- public void addPebble(CompositePebble cp)
cp
- public boolean hasUnprocessedPebble()
public java.util.ArrayList<CompositePebble> processNext()
public void markUnprocessedAllPebblesWithSourceFromSpecifiedVertex(int vertexIndex)
vertexIndex
- The index of the vertex that gained a pebble.