Click or drag to resize

LGSPMatchesListMatch, MatchInterface Class

An object representing a (possibly empty) set of matches in a graph before the rewrite has been applied. It is returned by IAction.Match() and given to the OnMatched, OnPreMatched, OnFinishing and OnFinished event. Generic to be instantiated with the exact interface and the exact implementation type of the match object Every generated Action contains a LGSPMatchesList, the matches contain one LGSPMatchesList per iterated pattern. A matches list stores the matches found by the last application of the action, the matches objects within the list are recycled by the next application of the action, only their content gets updated. The purpose of this list is to act as a memory manager to save new/garbage collection cycles and improve cache footprint. Additionally this list is used for storing the results of an iteration in the matches objects, Producer being null in this case. Then it is just used as a container for already allocated elements.
Inheritance Hierarchy
SystemObject
  de.unika.ipd.grGen.lgspLGSPMatchesListMatch, MatchInterface

Namespace:  de.unika.ipd.grGen.lgsp
Assembly:  lgspBackend (in lgspBackend.dll) Version: GrGen.NET 7.2
Syntax
C#
public class LGSPMatchesList<Match, MatchInterface> : IMatchesExact<MatchInterface>, 
	IMatches, IEnumerable<IMatch>, IEnumerable
where Match : new(), MatchListElement<Match>, MatchInterface
where MatchInterface : IMatch

Type Parameters

Match
MatchInterface

The LGSPMatchesListMatch, MatchInterface type exposes the following members.

Constructors
  NameDescription
Public methodLGSPMatchesListMatch, MatchInterface(IAction)
Constructs a new LGSPMatchesList instance.
Protected methodLGSPMatchesListMatch, MatchInterface(LGSPMatchesListMatch, MatchInterface)
Initializes a new instance of the LGSPMatchesListMatch, MatchInterface class
Public methodLGSPMatchesListMatch, MatchInterface(LGSPMatchesListMatch, MatchInterface, IDictionaryIGraphElement, IGraphElement)
Initializes a new instance of the LGSPMatchesListMatch, MatchInterface class
Protected methodLGSPMatchesListMatch, MatchInterface(LGSPMatchesListMatch, MatchInterface, IDictionaryIMatch, IMatch)
Initializes a new instance of the LGSPMatchesListMatch, MatchInterface class
Top
Properties
  NameDescription
Public propertyCount
The number of matches in this list.
Public propertyFirst
The first match of this list.
Public propertyFirstExact
Returns the first match of exact type (null if no match exists).
Public propertyFirstImplementation
Returns the first match of exact type (null if no match exists).
Public propertyItem
Returns the match with the given index. This may be slow. If you want to iterate over the elements the Matches IEnumerable should be used.
Public propertyProducer
The action object used to generate this LGSPMatchesList object
Public propertyRoot
The root element of the list.
Top
Methods
  NameDescription
Public methodAdd
adds a match object to the end of the list; only applicable if this is the match of an iteration, not an action
Public methodClear
remove all filled and committed elements from the list
Public methodClone
Clone the matches
Public methodClone(IDictionaryIMatch, IMatch)
Clones the matches.
Public methodFilter_keepFirst
For filtering with the auto-supplied filter keepFirst
Public methodFilter_keepFirstFraction
For filtering with the auto-supplied filter keepFirstFraction
Public methodFilter_keepLast
For filtering with the auto-supplied filter keepLast
Public methodFilter_keepLastFraction
For filtering with the auto-supplied filter keepLastFraction
Public methodFilter_removeFirst
For filtering with the auto-supplied filter removeFirst
Public methodFilter_removeFirstFraction
For filtering with the auto-supplied filter removeFirstFraction
Public methodFilter_removeLast
For filtering with the auto-supplied filter removeLast
Public methodFilter_removeLastFraction
For filtering with the auto-supplied filter removeLastFraction
Public methodFilterExact_keepFirst
For filtering with the auto-supplied filter keepFirst
Public methodFilterExact_keepFirstFraction
For filtering with the auto-supplied filter keepFirstFraction
Public methodFilterExact_keepLast
For filtering with the auto-supplied filter keepLast
Public methodFilterExact_keepLastFraction
For filtering with the auto-supplied filter keepLastFraction
Public methodFilterExact_removeFirst
For filtering with the auto-supplied filter removeFirst
Public methodFilterExact_removeFirstFraction
For filtering with the auto-supplied filter removeFirstFraction
Public methodFilterExact_removeLast
For filtering with the auto-supplied filter removeLast
Public methodFilterExact_removeLastFraction
For filtering with the auto-supplied filter removeLastFraction
Public methodFromList
Reincludes the array handed out with ToList, REPLACING the current matches with the ones from the list. The list might have been reordered, matches might have been removed, or even added. Elements which were null-ed count as deleted; this gives an O(1) mechanism to remove from the array.
Public methodFromListExact
Reincludes the array handed out with ToListExact, REPLACING the current matches with the ones from the list. The list might have been reordered, matches might have been removed, or even added. Elements which were null-ed count as deleted; this gives an O(1) mechanism to remove from the array.
Public methodGetEnumerator
Returns an enumerator over all found matches with inexact match interface type.
Public methodGetEnumeratorExact
Returns an enumerator over all found matches with exact match interface type
Public methodGetMatch
Returns the match with the given index. Invalid indices cause an exception. This may be slow. If you want to iterate over the elements the Matches IEnumerable should be used.
Public methodGetMatchExact
Returns the match of exact type with the given index. Invalid indices cause an exception. This may be slow. If you want to iterate over the elements the MatchesExact IEnumerable should be used.
Public methodGetNextUnfilledPosition
returns an empty match object from the matches list to be filled by the matching action with the found nodes, edges and subpatterns. unless PositionWasFilledFixIt is called you always get the same element
Public methodPositionWasFilledFixIt
the match object returned by GetNextUnfilledPosition was filled, now fix it within the list, so that the next call to GetNextUnfilledPosition returns a new element
Public methodRemoveFirst
removes the first match object from the the list
Public methodRemoveMatch
Removes the match at the given index and returns it.
Public methodRemoveMatchExact
Removes the match of exact type at the given index and returns it.
Public methodRemoveUnavailable
Public methodToList
Returns the content of the current matches list in form of an array which can be efficiently indexed and reordered. The array is destroyed when this method is called again, the content is destroyed when the rule is matched again (there is only one array existing).
Public methodToListCopy
Returns a copy of the content of the current matches list in form of an array. Attention: matches may get stale when the rule is matched again. This is only a convenience helper method, unrelated to ToList, and its pairing with FromList, as well as ToListExact, and its pairing with FromListExact.
Public methodToListExact
Returns the content of the current matches list in form of an array which can be efficiently indexed and reordered. The array is destroyed when this method is called again, the content is destroyed when the rule is matched again (there is only one array existing).
Top
Fields
  NameDescription
Public fieldproducer
the action object used to generate this LGSPMatchesList object
Top
See Also