|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.data.SoyData
com.google.template.soy.data.restricted.CollectionData
com.google.template.soy.data.SoyListData
public class SoyListData
A list data node in a Soy data tree.
| Constructor Summary | |
|---|---|
SoyListData()
|
|
SoyListData(Iterable<?> data)
Constructor that initializes this SoyListData from an existing list. |
|
SoyListData(Object... values)
Constructor that initializes this SoyListData with the given elements. |
|
| Method Summary | |
|---|---|
void |
add(boolean value)
Adds a data value. |
void |
add(double value)
Adds a data value. |
void |
add(int value)
Adds a data value. |
void |
add(Object... values)
Convenience function to add multiple values in one call. |
void |
add(SoyData value)
Adds a data value. |
void |
add(String value)
Adds a data value. |
List<SoyData> |
asList()
Important: Please treat this method as superpackage-private. |
boolean |
equals(Object other)
Compares this data object against another for equality in the sense of the operator '==' for Soy expressions. |
SoyData |
get(int index)
Gets the data value at a given index. |
boolean |
getBoolean(int index)
Precondition: The specified index contains a boolean. |
double |
getFloat(int index)
Precondition: The specified index contains a float. |
int |
getInteger(int index)
Precondition: The specified index contains an integer. |
SoyListData |
getListData(int index)
Precondition: The specified index contains a SoyListData object. |
SoyMapData |
getMapData(int index)
Precondition: The specified index contains a SoyMapData object. |
SoyData |
getSingle(String key)
Important: Do not use outside of Soy code (treat as superpackage-private). |
String |
getString(int index)
Precondition: The specified index contains a string. |
Iterator<SoyData> |
iterator()
|
int |
length()
Gets the length of this list. |
void |
putSingle(String key,
SoyData value)
Important: Do not use outside of Soy code (treat as superpackage-private). |
void |
remove(int index)
Removes the data value at a given index. |
void |
removeSingle(String key)
Important: Do not use outside of Soy code (treat as superpackage-private). |
void |
set(int index,
boolean value)
Sets a data value at a given index. |
void |
set(int index,
double value)
Sets a data value at a given index. |
void |
set(int index,
int value)
Sets a data value at a given index. |
void |
set(int index,
SoyData value)
Sets a data value at a given index. |
void |
set(int index,
String value)
Sets a data value at a given index. |
boolean |
toBoolean()
Converts this data object into a boolean (e.g. |
String |
toString()
Converts this data object into a string (e.g. |
| Methods inherited from class com.google.template.soy.data.restricted.CollectionData |
|---|
ensureValidValue, get, getBoolean, getFloat, getInteger, getListData, getMapData, getString, put, put, put, put, put, put, remove |
| Methods inherited from class com.google.template.soy.data.SoyData |
|---|
booleanValue, createFromExistingData, createFromExistingData, floatValue, integerValue, numberValue, stringValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SoyListData()
public SoyListData(Iterable<?> data)
data - The initial data in an existing Iterable.public SoyListData(Object... values)
values - The initial data to add.| Method Detail |
|---|
public List<SoyData> asList()
public String toString()
This method should only be used for debugging purposes.
toString in class SoyDatapublic boolean toBoolean()
A list is always truthy.
toBoolean in class SoyDatapublic boolean equals(Object other)
SoyData
equals in class SoyDataother - The other data object to compare against.
public int length()
public Iterator<SoyData> iterator()
iterator in interface Iterable<SoyData>public void add(Object... values)
values - The data to add.public void add(SoyData value)
value - The data to add.public void add(boolean value)
value - The data to add.public void add(int value)
value - The data to add.public void add(double value)
value - The data to add.public void add(String value)
value - The data to add.
public void set(int index,
SoyData value)
index - The index.value - The data to set.
public void set(int index,
boolean value)
index - The index.value - The data to set.
public void set(int index,
int value)
index - The index.value - The data to set.
public void set(int index,
double value)
index - The index.value - The data to set.
public void set(int index,
String value)
index - The index.value - The data to set.public void remove(int index)
index - The index.public SoyData get(int index)
index - The index.
public SoyMapData getMapData(int index)
index - The index.
public SoyListData getListData(int index)
index - The index.
public boolean getBoolean(int index)
index - The index.
public int getInteger(int index)
index - The index.
public double getFloat(int index)
index - The index.
public String getString(int index)
index - The index.
public void putSingle(String key,
SoyData value)
putSingle in class com.google.template.soy.data.restricted.CollectionDatakey - An individual key.value - The data to put at the specified key.public void removeSingle(String key)
removeSingle in class com.google.template.soy.data.restricted.CollectionDatakey - An individual key.public SoyData getSingle(String key)
getSingle in class com.google.template.soy.data.restricted.CollectionDatakey - An individual key.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||