17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javafx.css;
27
28 import com.sun.javafx.css.PseudoClassState;
29
30 import static javafx.geometry.NodeOrientation.INHERIT;
31
32
33 /**
34 * Used by {@link Rule} to determine whether or not the selector applies to a
35 * given object.
36 *
37 * Returned by {@link Selector#matches} in the event of a match.
38 *
39 * @since 9
40 */
41 public final class Match implements Comparable<Match> {
42
43 final Selector selector;
44 final PseudoClassState pseudoClasses;
45 final int idCount;
46 final int styleClassCount;
47
48 // CSS3 spec gives weight to id count, then style class count,
49 // then pseudoclass count, and finally matching types (i.e., java name count)
50 final int specificity;
51
52 Match(final Selector selector, PseudoClassState pseudoClasses, int idCount, int styleClassCount) {
53 assert selector != null;
54 this.selector = selector;
55 this.idCount = idCount;
56 this.styleClassCount = styleClassCount;
57 this.pseudoClasses = pseudoClasses;
|
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javafx.css;
27
28 import com.sun.javafx.css.PseudoClassState;
29
30 import static javafx.geometry.NodeOrientation.INHERIT;
31
32
33 /**
34 * Used by {@link Rule} to determine whether or not the selector applies to a
35 * given object.
36 *
37 * Returned by {@link Selector} matches in the event of a match.
38 *
39 * @since 9
40 */
41 public final class Match implements Comparable<Match> {
42
43 final Selector selector;
44 final PseudoClassState pseudoClasses;
45 final int idCount;
46 final int styleClassCount;
47
48 // CSS3 spec gives weight to id count, then style class count,
49 // then pseudoclass count, and finally matching types (i.e., java name count)
50 final int specificity;
51
52 Match(final Selector selector, PseudoClassState pseudoClasses, int idCount, int styleClassCount) {
53 assert selector != null;
54 this.selector = selector;
55 this.idCount = idCount;
56 this.styleClassCount = styleClassCount;
57 this.pseudoClasses = pseudoClasses;
|