Class ObservablePatternMatchList<Match extends IPatternMatch>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.eclipse.core.databinding.observable.list.AbstractObservableList
-
- org.eclipse.viatra.addon.databinding.runtime.collection.ObservablePatternMatchList<Match>
-
- All Implemented Interfaces:
java.lang.Iterable
,java.util.Collection
,java.util.List
,org.eclipse.core.databinding.observable.IObservable
,org.eclipse.core.databinding.observable.IObservableCollection
,org.eclipse.core.databinding.observable.list.IObservableList
public class ObservablePatternMatchList<Match extends IPatternMatch> extends org.eclipse.core.databinding.observable.list.AbstractObservableList
Observable view of a match set for a givenViatraQueryMatcher
on a model (match sets of anViatraQueryMatcher
are ordered by the order of their appearance).For creating complex observable lists, use
ObservablePatternMatchCollectionBuilder
.This implementation uses the
ExecutionSchema
to get notifications for match set changes, and can be instantiated using either an existingViatraQueryMatcher
, or anIQuerySpecification
and either aViatraQueryEngine
orExecutionSchema
.Note that a converter can be used for the list, in which case the type of list items may be different from the generic type parameter Match.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ObservablePatternMatchList.ListCollectionUpdate
-
Constructor Summary
Constructors Modifier Constructor Description protected
ObservablePatternMatchList()
Creates an observable list, that will be built be theObservablePatternMatchCollectionBuilder
using theObservablePatternMatchCollection
interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
dispose()
protected int
doGetSize()
java.lang.Object
get(int index)
java.lang.Object
getElementType()
protected ObservablePatternMatchCollection<Match>
getInternalCollection()
RuleSpecification<Match>
getSpecification()
java.util.Iterator
iterator()
void
setFilter(Match filter)
Update the filter used by the observable during runtime.-
Methods inherited from class org.eclipse.core.databinding.observable.list.AbstractObservableList
add, addAll, addAll, addChangeListener, addDisposeListener, addListChangeListener, addStaleListener, checkRealm, contains, containsAll, equals, fireChange, fireListChange, fireStale, firstListenerAdded, getRealm, hashCode, hasListeners, indexOf, isDisposed, isEmpty, isStale, lastIndexOf, lastListenerRemoved, move, remove, removeAll, removeChangeListener, removeDisposeListener, removeListChangeListener, removeStaleListener, retainAll, size, toArray, toArray
-
Methods inherited from class java.util.AbstractList
add, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
ObservablePatternMatchList
protected ObservablePatternMatchList()
Creates an observable list, that will be built be theObservablePatternMatchCollectionBuilder
using theObservablePatternMatchCollection
interface.
-
-
Method Detail
-
getInternalCollection
protected ObservablePatternMatchCollection<Match> getInternalCollection()
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<Match extends IPatternMatch>
- Specified by:
clear
in interfacejava.util.List<Match extends IPatternMatch>
- Overrides:
clear
in classjava.util.AbstractList
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.core.databinding.observable.IObservable
- Overrides:
dispose
in classorg.eclipse.core.databinding.observable.list.AbstractObservableList
-
getElementType
public java.lang.Object getElementType()
-
doGetSize
protected int doGetSize()
- Specified by:
doGetSize
in classorg.eclipse.core.databinding.observable.list.AbstractObservableList
-
get
public java.lang.Object get(int index)
- Specified by:
get
in interfaceorg.eclipse.core.databinding.observable.list.IObservableList<Match extends IPatternMatch>
- Specified by:
get
in interfacejava.util.List<Match extends IPatternMatch>
- Specified by:
get
in classjava.util.AbstractList
-
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection<Match extends IPatternMatch>
- Specified by:
iterator
in interfaceorg.eclipse.core.databinding.observable.list.IObservableList<Match extends IPatternMatch>
- Specified by:
iterator
in interfacejava.lang.Iterable<Match extends IPatternMatch>
- Specified by:
iterator
in interfacejava.util.List<Match extends IPatternMatch>
- Overrides:
iterator
in classorg.eclipse.core.databinding.observable.list.AbstractObservableList
-
getSpecification
public RuleSpecification<Match> getSpecification()
- Returns:
- the specification
-
setFilter
public void setFilter(Match filter)
Update the filter used by the observable during runtime. The contents of the observable are updated and the diff is sent to observers.- Parameters:
filter
-
-
-