|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java representation of a DAML List. A list is the specified interpretation of rdf:parseType="daml:Collection" attributes, where a sequence of values is interpreted as a nested sequence of head/tail list cells. One consequence of this is that the list is quite specifically ordered, whereas the daml:collection is said to be an unordered collection. Consquently, we must caution that future versions of the DAML specificiation may create an unordered interpretation of daml:collection, and client code should not rely on the positionality of elements in the current list interpretation.
Method Summary | |
void |
add(DAMLCommon value)
Add an element to the list. |
DAMLList |
cons(DAMLCommon value)
Answer a new list formed by creating a new DAMLList element whose first is the given value and whose rest is the current list. |
DAMLList |
findLast()
Find the last list element, i.e. |
java.util.Iterator |
getAll()
Answer an iteration over the values in the list. |
int |
getCount()
Answer a count of the items in the list. |
DAMLCommon |
getFirst()
Answer the first value from the list. |
DAMLCommon |
getItem(int i)
Answer the i'th element of the list, if it exists. |
DAMLList |
getNil()
Answer the well-known constant denoting the nil list. |
DAMLList |
getRest()
Answer a new list that consists of all values of the list save the first. |
boolean |
isEmpty()
Answer true if the list has no values. |
boolean |
isNil(Resource resource)
Answer true if the given resource is the nil list. |
void |
remove(DAMLCommon value)
Remove the given value from the list. |
void |
setFirst(DAMLCommon value)
Set the property daml:first for the given list element. |
void |
setRest(DAMLList tail)
Set the property daml:rest for the given list element. |
void |
setRestNil()
Set the property daml:rest for the given list element to be the
nil list. |
Methods inherited from interface com.hp.hpl.jena.daml.DAMLCommon |
getAll, getDAMLModel, getEquivalenceSet, getEquivalentValues, getNumPropertyValues, getPropertyValue, getPropertyValues, getRDFTypes, getVocabulary, hasRDFType, hasRDFType, prop_comment, prop_equivalentTo, prop_label, prop_type, remove, removeAll, removeProperty, replaceProperty, setPropertyValue, setRDFType, setRDFType |
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Resource |
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, removeProperties, toString |
Method Detail |
public void add(DAMLCommon value)
value
- A DAML value to add to the listpublic void remove(DAMLCommon value)
value
- A DAML value to be removed from the list.public java.util.Iterator getAll()
public DAMLCommon getFirst()
List L = L.getFirst() + L.getRest()
is guaranteed, providing that the contents of L do not change.public DAMLList cons(DAMLCommon value)
The
- new value to be added to the head of the listdaml:first
is the value, and whose
daml:rest
is this list.public DAMLList getRest()
List L = L.getFirst() + L.getRest()
is guaranteed, providing that the contents of L do not change.public int getCount()
public boolean isEmpty()
public void setFirst(DAMLCommon value)
daml:first
for the given list element. This is a single
value that denotes the value at this position of the list.value
- The value to be assigned to the 'first' property of a list cellpublic void setRest(DAMLList tail)
daml:rest
for the given list element. This is a single
value that denotes the tail of the list.value
- The value to be assigned to the tail of the list.public void setRestNil()
daml:rest
for the given list element to be the
nil list. This correctly terminates the list at this point.public DAMLList getNil()
public boolean isNil(Resource resource)
resource
- The resource to be testedpublic DAMLList findLast()
public DAMLCommon getItem(int i)
i
- The position of the list to returnjava.lang.IllegalArgumentException
- if i is less than one, or
larger than the length of the list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |