|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.hp.hpl.mesa.rdf.jena.common.ResourceImpl
|
+--com.hp.hpl.jena.daml.common.DAMLCommonImpl
|
+--com.hp.hpl.jena.daml.common.DAMLListImpl
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.
| Constructor Summary | |
DAMLListImpl(java.lang.String uri,
DAMLModel store,
DAMLVocabulary vocabulary)
Constructor, takes the URI for this list, and the underlying model it will be attached to. |
|
DAMLListImpl(java.lang.String namespace,
java.lang.String name,
DAMLModel store,
DAMLVocabulary vocabulary)
Constructor, takes the name and namespace for this list, and the underlying model it will be attached to. |
|
| 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 denototing 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 class com.hp.hpl.jena.daml.common.DAMLCommonImpl |
getAll, getDAMLModel, getEquivalenceSet, getEquivalentValues, getNumPropertyValues, getPropertyValue, getPropertyValues, getRDFTypes, getSelfIterator, getVocabulary, hasRDFType, hasRDFType, prop_comment, prop_equivalentTo, prop_label, prop_type, remove, removeAll, removeProperty, replaceProperty, setPropertyValue, setRDFType, setRDFType, toString |
| Methods inherited from class com.hp.hpl.mesa.rdf.jena.common.ResourceImpl |
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getEmbeddedResource, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hashCode, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, port, removeProperties |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| 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 |
| Constructor Detail |
public DAMLListImpl(java.lang.String uri,
DAMLModel store,
DAMLVocabulary vocabulary)
uri - The URI of the liststore - The RDF store that contains the RDF statements defining the properties of the listvocabulary - Reference to the DAML vocabulary used by this list.
public DAMLListImpl(java.lang.String namespace,
java.lang.String name,
DAMLModel store,
DAMLVocabulary vocabulary)
namespace - The namespace the list inhabits, or nullname - The name of the liststore - The RDF store that contains the RDF statements defining the properties of the listvocabulary - Reference to the DAML vocabulary used by this list.| Method Detail |
public void add(DAMLCommon value)
cons(com.hp.hpl.jena.daml.DAMLCommon)
for an operation that always returns a new list (i.e. no side-effects on
this list).add in interface DAMLListvalue - A DAML value to add to the listpublic void remove(DAMLCommon value)
remove in interface DAMLListvalue - A DAML value to be removed from the list.public java.util.Iterator getAll()
getAll in interface DAMLListpublic DAMLCommon getFirst()
List L = L.getFirst() + L.getRest()
is guaranteed, providing that the contents of L do not change.getFirst in interface DAMLListpublic DAMLList getRest()
List L = L.getFirst() + L.getRest()
is guaranteed, providing that the contents of L do not change.getRest in interface DAMLListpublic int getCount()
getCount in interface DAMLListpublic boolean isEmpty()
isEmpty in interface DAMLListpublic 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.setFirst in interface DAMLListvalue - 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.setRest in interface DAMLListvalue - 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.setRestNil in interface DAMLListpublic DAMLList cons(DAMLCommon value)
cons in interface DAMLListThe - new value to be added to the head of the listdaml:first is the value, and whose
daml:rest is this list.public DAMLList getNil()
getNil in interface DAMLListpublic boolean isNil(Resource resource)
isNil in interface DAMLListresource - A resource, that may be the nil listpublic DAMLList findLast()
findLast in interface DAMLListpublic DAMLCommon getItem(int i)
getItem in interface DAMLListi - 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 | ||||||||