Path: blob/trunk/third_party/closure/goog/dom/pattern/abstractpattern.js
2868 views
// Copyright 2007 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314/**15* @fileoverview DOM pattern base class.16*17* @author [email protected] (Robby Walker)18*/1920goog.provide('goog.dom.pattern.AbstractPattern');2122goog.require('goog.dom.pattern.MatchType');23242526/**27* Base pattern class for DOM matching.28*29* @constructor30*/31goog.dom.pattern.AbstractPattern = function() {32/**33* The first node matched by this pattern.34* @type {Node}35*/36this.matchedNode = null;37};383940/**41* Reset any internal state this pattern keeps.42*/43goog.dom.pattern.AbstractPattern.prototype.reset = function() {44// The base implementation does nothing.45};464748/**49* Test whether this pattern matches the given token.50*51* @param {Node} token Token to match against.52* @param {goog.dom.TagWalkType} type The type of token.53* @return {goog.dom.pattern.MatchType} {@code MATCH} if the pattern matches.54*/55goog.dom.pattern.AbstractPattern.prototype.matchToken = function(token, type) {56return goog.dom.pattern.MatchType.NO_MATCH;57};585960