|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DAMLList
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.hp.hpl.jena.rdf.model.RDFList |
---|
RDFList.ApplyFn, RDFList.ReduceFn |
Method Summary | |
---|---|
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. |
ExtendedIterator |
getAll()
Answer an iteration over the values in the list. |
int |
getCount()
Answer a count of the items in the list. |
RDFNode |
getFirst()
Answer the value at the head of 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 the list that consists of all values of the list save the first. |
boolean |
isNil(Resource resource)
Answer true if the given resource is the nil 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.rdf.model.RDFList |
---|
add, append, append, apply, asJavaList, concatenate, concatenate, cons, contains, copy, get, getHead, getStrict, getTail, getValidityErrorMessage, indexOf, indexOf, isEmpty, isValid, iterator, mapWith, reduce, remove, removeAll, removeHead, replace, sameListAs, setHead, setStrict, setTail, size, with |
Methods inherited from interface com.hp.hpl.jena.rdf.model.Resource |
---|
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getNode, getProperty, getRequiredProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, isAnon, listProperties, listProperties, removeAll, removeProperties, toString |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFNode |
---|
as, canAs, inModel, visitWith |
Methods inherited from interface com.hp.hpl.jena.graph.FrontsNode |
---|
asNode |
Method Detail |
---|
ExtendedIterator getAll()
RDFNode getFirst()
Answer the value at the head of the list. Since, strictly speaking, DAML collections
are unordered, the position items in the list should not be relied on in client
code, as the definition of 'first' in the list may change in future releases.
However, the identity
is guaranteed, providing that the contents of L do not change.
List L = L.getFirst() + L.getRest()
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. This is the 'cons' operator familiar from other list processing languages.
value
- The new value to be added to the head of the list
daml:first
is the value, and whose
daml:rest
is this list.DAMLList getRest()
Answer the list that consists of all values of the list save the first. Since, strictly
speaking, DAML collections are unordered, this corresponds to returning the collection
minus an unspecified one of its values. However, the identity
is guaranteed, providing that the contents of L do not change.
List L = L.getFirst() + L.getRest()
int getCount()
Answer a count of the items in the list. Does not check for duplications, so this is the count of entries in the list, not the count of distinct items in the list.
void setFirst(DAMLCommon value)
Set the property 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 cellvoid setRest(DAMLList tail)
Set the property daml:rest
for the given list element. This is a single
value that denotes the tail of the list.
tail
- The value to be assigned to the tail of the list.void setRestNil()
Set the property daml:rest
for the given list element to be the
nil list. This correctly terminates the list at this point.
DAMLList getNil()
Answer the well-known constant denoting the nil list.
boolean isNil(Resource resource)
Answer true if the given resource is the nil list.
resource
- The resource to be tested
DAMLList findLast()
Find the last list element, i.e. the one whose rest is nil.
DAMLCommon getItem(int i)
Answer the i'th element of the list, if it exists. If i is less than 1, or is larger than the length of the list, throw an illegal argument exception.
i
- The position of the list to return
ListIndexException
- if i is less than one, or
larger than the length of the list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |