org.openrdf.repository.object.composition.helpers
Class CachedPropertySet

java.lang.Object
  extended by org.openrdf.repository.object.composition.helpers.RemotePropertySet
      extended by org.openrdf.repository.object.composition.helpers.CachedPropertySet
Type Parameters:
E -
All Implemented Interfaces:
Iterable<Object>, Collection<Object>, Set<Object>, PropertySet, PropertyConsumer, Refreshable
Direct Known Subclasses:
LocalizedPropertySet

public class CachedPropertySet
extends RemotePropertySet
implements PropertyConsumer

A set for a given getResource(), predicate.

Author:
James Leigh

Field Summary
 
Fields inherited from class org.openrdf.repository.object.composition.helpers.RemotePropertySet
property
 
Fields inherited from interface org.openrdf.repository.object.traits.PropertyConsumer
USE
 
Fields inherited from interface org.openrdf.repository.object.composition.helpers.PropertySet
ADD_ALL, ADD_SINGLE, GET_ALL, GET_SINGLE, SET_ALL, SET_SINGLE
 
Constructor Summary
CachedPropertySet(ManagedRDFObject bean, PropertySetModifier property)
           
 
Method Summary
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
protected  ObjectIterator<?,Object> getObjectIterator()
           
protected  CloseableIteration<?,?> getObjects()
           
 Object getSingle()
          Assumes there is zero or one value and return null or the value.
protected  Value getValue(Object instance)
           
 boolean isEmpty()
           
 Iterator<Object> iterator()
           
 void refresh()
          Flushes the local state of the entity forcing it to refresh.
protected  void refreshCache()
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 void setAll(Set<?> set)
          Replaces all values with the values given.
 void setPropertySetFactory(PropertySetFactory creator)
           
 void setSingle(Object o)
          Replace all values with this value
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 void usePropertyBindings(String binding, List<BindingSet> bindings)
           
 
Methods inherited from class org.openrdf.repository.object.composition.helpers.RemotePropertySet
add, addAll, createInstance, equals, getAll, getStatements, getValues, hashCode, refresh, refreshEntity, remove, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachedPropertySet

public CachedPropertySet(ManagedRDFObject bean,
                         PropertySetModifier property)
Method Detail

setPropertySetFactory

public void setPropertySetFactory(PropertySetFactory creator)

usePropertyBindings

public void usePropertyBindings(String binding,
                                List<BindingSet> bindings)
Specified by:
usePropertyBindings in interface PropertyConsumer

refresh

public void refresh()
Description copied from interface: Refreshable
Flushes the local state of the entity forcing it to refresh.

Specified by:
refresh in interface Refreshable
Overrides:
refresh in class RemotePropertySet

clear

public void clear()
Specified by:
clear in interface Collection<Object>
Specified by:
clear in interface Set<Object>
Overrides:
clear in class RemotePropertySet

setSingle

public void setSingle(Object o)
Description copied from interface: PropertySet
Replace all values with this value

Specified by:
setSingle in interface PropertySet
Overrides:
setSingle in class RemotePropertySet

setAll

public void setAll(Set<?> set)
Description copied from interface: PropertySet
Replaces all values with the values given.

Specified by:
setAll in interface PropertySet
Overrides:
setAll in class RemotePropertySet

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Object>
Specified by:
contains in interface Set<Object>
Overrides:
contains in class RemotePropertySet

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Object>
Specified by:
containsAll in interface Set<Object>
Overrides:
containsAll in class RemotePropertySet

getSingle

public Object getSingle()
Description copied from interface: PropertySet
Assumes there is zero or one value and return null or the value.

Specified by:
getSingle in interface PropertySet
Overrides:
getSingle in class RemotePropertySet
Returns:
null or the single value

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Object>
Specified by:
isEmpty in interface Set<Object>
Overrides:
isEmpty in class RemotePropertySet

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Object>
Specified by:
removeAll in interface Set<Object>
Overrides:
removeAll in class RemotePropertySet

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Object>
Specified by:
retainAll in interface Set<Object>
Overrides:
retainAll in class RemotePropertySet

size

public int size()
Specified by:
size in interface Collection<Object>
Specified by:
size in interface Set<Object>
Overrides:
size in class RemotePropertySet

iterator

public Iterator<Object> iterator()
Specified by:
iterator in interface Iterable<Object>
Specified by:
iterator in interface Collection<Object>
Specified by:
iterator in interface Set<Object>
Overrides:
iterator in class RemotePropertySet

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Object>
Specified by:
toArray in interface Set<Object>
Overrides:
toArray in class RemotePropertySet

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<Object>
Specified by:
toArray in interface Set<Object>
Overrides:
toArray in class RemotePropertySet

refreshCache

protected void refreshCache()

getValue

protected Value getValue(Object instance)
                  throws RepositoryException
Overrides:
getValue in class RemotePropertySet
Throws:
RepositoryException

getObjects

protected CloseableIteration<?,?> getObjects()
                                      throws RepositoryException,
                                             QueryEvaluationException
Overrides:
getObjects in class RemotePropertySet
Throws:
RepositoryException
QueryEvaluationException

getObjectIterator

protected ObjectIterator<?,Object> getObjectIterator()
Overrides:
getObjectIterator in class RemotePropertySet


Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.