public abstract class Component extends Object implements Comparable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SOURCE_COL |
int |
index
Relative index of this component in its containing set.
|
Constructor and Description |
---|
Component(int row,
int col)
Creates a new component.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object object) |
abstract boolean |
dataEquals(String data) |
abstract boolean |
equals(Object c) |
String |
getCid()
Returns the internal component identifier.
|
int |
getSourceCol()
Returns the source column number (or character index in the row).
|
int |
getSourceRow()
Returns the source line number.
|
int |
hashCode()
Components are hashed on their identifiers.
|
static String |
html(Component c) |
abstract boolean |
isEmpty()
Tests whether this component is empty.
|
protected abstract String |
jsonize() |
protected static String |
jsonize(List<Component> options) |
static String |
makeComponentId(int row,
int col)
Creates a SurveyMan component internal identifier for the source location.
|
protected void |
resetCid(int row,
int col) |
String |
toString()
A string representation comprised of the identifier and the relative index.
|
public static int DEFAULT_SOURCE_COL
public int index
public Component(int row, int col)
row
- The source line number.col
- The source column (or character index in the row).public static String makeComponentId(int row, int col)
row
- The source line number.col
- The source column (or character index in the row)public String getCid()
protected void resetCid(int row, int col)
public int getSourceRow()
public int getSourceCol()
public abstract boolean isEmpty()
public abstract boolean dataEquals(String data)
protected abstract String jsonize()
public int hashCode()
public String toString()
public int compareTo(Object object)
compareTo
in interface Comparable
Copyright © 2015. All rights reserved.