Source for file ResSeq.php
Documentation is available at ResSeq.php
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
* This interface defines methods for accessing RDF Sequence resources.
* These methods operate on the RDF statements contained in a model.
* @version $Id: fsource_resModel__resModelResSeq.php.html 443 2007-06-01 16:25:38Z cax $
* @author Daniel Westphal <mail at d-westphal dot de>
* Insert a new member into the sequence at the specified position.
* The existing member at that position, and all others with higher indexes,
* have their index increased by one.
* @param object ResResource/ResLiteral $resResource
//type this container, if it isn't already typed
//renumber all higher members
for ($i =
count($memberIndex);$i >=
$index ; $i--
)
$this->removeAll($this->_getMembershipPropertyWithIndex($i));
$this->addProperty($this->_getMembershipPropertyWithIndex($i+
1),$memberIndex[$i]);
//remove the old value at this position
$this->removeAll($this->_getMembershipPropertyWithIndex($index));
$this->addProperty($this->_getMembershipPropertyWithIndex($index),$object);
* Get the member at a given index
* @return object ResResource/ResLiteral
$result=
$this->listProperties($this->_getMembershipPropertyWithIndex($index));
* Return the index of a given member of the sequence.
* If the same value appears more than once in the sequence, it is undefined
* which of the indexes will be returned.
* If the member is not found in this sequence, a value of 0 is returned.
* @param object ResResource/ResLiteral $object
//check all members, until $object is found
$predicateLabel=
$statement->getLabelPredicate();
if ($this->_predicateLabelMatchesMembershipProperty($predicateLabel))
if($object->equals($statement->getObject()))
//analyze the container membership property and return the index
return $this->_getMemberIndexNrFromMembershipPropertyLabel($predicateLabel);
//return 0 if $object wasn't found
* Remove the member at the specified index.
* All other members with a higher index will have their index reduced by one.
$this->removeAll($this->_getMembershipPropertyWithIndex($index));
for ($i =
$index;$i <
count($memberIndex); $i++
)
$this->removeAll($this->_getMembershipPropertyWithIndex($i+
1));
$this->addProperty($this->_getMembershipPropertyWithIndex($i),$memberIndex[$i+
1]);
* Set the value at a given index in the sequence.
* If the index is not in the range of the sequence, false is returned
function set($index, $object)
if (!$this->hasProperty($this->_getMembershipPropertyWithIndex($index)))
$this->removeAll($this->_getMembershipPropertyWithIndex($index));
$this->addProperty($this->_getMembershipPropertyWithIndex($index),$object);
Documentation generated on Fri, 1 Jun 2007 16:51:39 +0200 by phpDocumentor 1.3.2