org.xwiki.gwt.wysiwyg.client.plugin.font
Class FontSizeComparator

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.font.DefaultStringMatcher
      extended by org.xwiki.gwt.wysiwyg.client.plugin.font.AbstractFontMatcher
          extended by org.xwiki.gwt.wysiwyg.client.plugin.font.FontSizeComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.String>, Matcher<java.lang.String>

public class FontSizeComparator
extends AbstractFontMatcher
implements java.util.Comparator<java.lang.String>

Compares two font sizes. This is not trivial as it may seem because font-size CSS property can take different kind of values.

Version:
$Id: FontSizeComparator.java 26786 2010-02-07 16:46:17Z mflorea $

Field Summary
 
Fields inherited from class org.xwiki.gwt.wysiwyg.client.plugin.font.AbstractFontMatcher
container, left, right
 
Constructor Summary
FontSizeComparator()
          Creates a new font size comparator.
 
Method Summary
 int compare(java.lang.String leftValue, java.lang.String rightValue)
          
 boolean match(java.lang.String leftValue, java.lang.String rightValue)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

FontSizeComparator

public FontSizeComparator()
Creates a new font size comparator.

Method Detail

compare

public int compare(java.lang.String leftValue,
                   java.lang.String rightValue)

Specified by:
compare in interface java.util.Comparator<java.lang.String>
See Also:
Comparator.compare(Object, Object)

match

public boolean match(java.lang.String leftValue,
                     java.lang.String rightValue)

Specified by:
match in interface Matcher<java.lang.String>
Overrides:
match in class DefaultStringMatcher
Parameters:
leftValue - the left value
rightValue - the right value
Returns:
true if the left and right values match, false otherwise
See Also:
Matcher.match(Object, Object)


Copyright © 2004-2010 XWiki. All Rights Reserved.