public class RepertoryGrid
extends Object
Conceptually the grid is a list of attributes (row labels), a list of elements (col labels) and a list of cells.
Modifier and Type | Field and Description |
---|---|
String |
attributeLabel
The type of the attributes (rows) of this grid.
|
protected ArrayList<RGAttribute> |
attributes |
private ArrayList |
cells |
String |
elementLabel
The type of the elements (columns) of this grid.
|
private ArrayList<RGElement> |
elements |
String |
name
An identifying string for this grid.
|
String |
relationLabel
The relation type that relates to attributes and elements
|
RGValue |
valuetype
What type is every cell in this grid?
|
Constructor and Description |
---|
RepertoryGrid()
Create a new, empty and completely blank repertory grid, ready to have
everything set.
|
RepertoryGrid(String eLabel,
String rLabel,
String aLabel,
RGValue type)
Create a new, empty repertory grid, with the particular labels and value
type.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String s)
Adds the given string as an attribute (row) label.
|
void |
addAttribute(String s,
int pos)
Add an attribute (construct) "row" with the given description to this
grid.
|
void |
addElement(String s)
Adds the given string as an element (column) label.
|
void |
addElement(String s,
int pos)
Add an element (column) with the given description to this grid.
|
void |
deleteAttribute(RGAttribute attr)
Deletes an attribute (row) label and all of its associated cells froma
repertory grid.
|
void |
deleteAttribute(String label)
Deletes an attribute (row) label and all of its associated cells from a
repertory grid.
|
void |
deleteCell(RGCell c)
Detaches a cell from its associated element, attribute and the list of
cells.
|
void |
deleteElement(RGElement elem)
Deletes an element (col) label and all of its associated cells froma
repertory grid.
|
void |
deleteElement(String label)
Deletes an element (col) label and all of its associated cells from a
repertory grid.
|
RGAttribute |
getAttribute(String label)
Finds an attribute object based on its label.
|
ArrayList<RGAttribute> |
getAttributes()
Accesses the attributes (rows) of this repertory grid.
|
RGCell |
getCell(int attnum,
int elemnum)
Find the cell at the given row,col index, considering the grid as a
simple 2-dimensional array.
|
RGCell |
getCell(RGAttribute a,
RGElement e)
Find the cell associated with a given attribute (row) and element
(column) pair.
|
ArrayList<RGCell> |
getCells()
Returns the list of cells in this grid.
|
RGElement |
getElement(String label)
Finds an element object based on its label.
|
ArrayList<RGElement> |
getElements()
Accesses the elements (columns) of this repertory grid.
|
String |
getName() |
String |
getQuestionLabel()
Get the string (question) used to label this grid; e.g., "What are
attributes of furniture?"
|
boolean |
gridComplete()
Determines whether any cells in the grid still need to have values
assigned.
|
boolean |
gridEmpty()
Are there no cells at all in this grid?
|
void |
setAttributeLabel(String s)
Sets the term that includes all of the attributes/constructs in this grid
(e.g., "attribute" ).
|
void |
setElementLabel(String s)
Sets the term that includes all of the elements in this grid (e.g.,
"furniture" ).
|
void |
setName(String n)
Sets a name for the grid (usually its filename)
|
void |
setRelationLabel(String s)
Sets the term that denotes the relationship from the element to the
attributes (e.g., "has").
|
void |
setValueType(RGValue v)
Sets the value type that will be used to acquire and represent values for
this grad.
|
void |
summary()
Prints a summary of the grid on System.out
|
void |
summary(String s)
Prints a summary of the grid on System.out.
|
String |
toCXTString(String title) |
public String attributeLabel
public String elementLabel
public String relationLabel
public RGValue valuetype
protected ArrayList<RGAttribute> attributes
private ArrayList<RGElement> elements
private ArrayList cells
public String name
TrackedRepertoryGrid
public RepertoryGrid(String eLabel, String rLabel, String aLabel, RGValue type)
eLabel
- the term that includes all of the elements in this grid
(e.g., "furniture").rLabel
- the term that denotes the relationship from the element to
the attributes (e.g., "has").aLabel
- the term that includes all of the attributes/constructs in
this grid (e.g., "attribute" ).type
- the type of value for each cell of this grid. Any actual
values in this instance are ignored.RGValue
public RepertoryGrid()
public String getQuestionLabel()
public void setAttributeLabel(String s)
public void setElementLabel(String s)
public void setRelationLabel(String s)
public void setValueType(RGValue v)
public void addElement(String s) throws IllegalArgumentException
s
- the element(column) label; non-nullIllegalArgumentException
- if s is either null or the empty stringpublic void addElement(String s, int pos) throws IllegalArgumentException
s
- The label for the element (column) to addpos
- The position in the list of columns. -1 if to be added
automatically.IllegalArgumentException
- if s is either null or the empty stringpublic void addAttribute(String s) throws IllegalArgumentException
s
- the attribute (row) label; must be non-null;IllegalArgumentException
- if s is either null or the empty stringpublic void addAttribute(String s, int pos) throws IllegalArgumentException
s
- The label for the attribute (row) to addpos
- The position in the list of rows. -1 if label is to be added
automatically.IllegalArgumentException
- if s is either null or the empty stringpublic void deleteAttribute(String label)
public void deleteElement(String label)
public RGAttribute getAttribute(String label)
label
- identifier for this attributenull
otherwise.public RGElement getElement(String label)
label
- identifier for this elementnull
otherwise.public void deleteAttribute(RGAttribute attr)
public void deleteElement(RGElement elem)
public ArrayList<RGAttribute> getAttributes()
public ArrayList<RGElement> getElements()
public ArrayList<RGCell> getCells()
RGCell
public RGCell getCell(RGAttribute a, RGElement e)
null
if there isn't one.addAttribute(java.lang.String)
,
addElement(java.lang.String)
public RGCell getCell(int attnum, int elemnum)
attnum
- index into the attribute vectorelemnum
- index into the element vectornull
if there isn't one.public void deleteCell(RGCell c)
c
- the cell to be deleted.public void summary()
public void summary(String s)
s
- prefix the summary with this stringpublic boolean gridComplete()
public boolean gridEmpty()
public void setName(String n)
public String getName()
public String toCXTString(String title)