org.wikimodel.wem
Class WikiFormat

java.lang.Object
  extended by org.wikimodel.wem.WikiFormat

public class WikiFormat
extends java.lang.Object

An immutable set of styles.

Author:
MikhailKotelnikov, VincentMassol

Field Summary
static WikiFormat EMPTY
           
 
Constructor Summary
WikiFormat()
           
WikiFormat(java.util.Collection<WikiParameter> params)
           
WikiFormat(java.util.Set<WikiStyle> styles)
           
WikiFormat(java.util.Set<WikiStyle> styles, java.util.Collection<WikiParameter> params)
           
WikiFormat(WikiStyle style)
           
WikiFormat(WikiStyle[] styles)
           
WikiFormat(WikiStyle style, java.util.Collection<WikiParameter> params)
           
 
Method Summary
 WikiFormat addStyle(WikiStyle style)
          Creates a new style set and adds the given style to it.
 boolean equals(java.lang.Object obj)
           
protected  WikiFormat getClone()
           
 java.util.List<WikiParameter> getParams()
           
 java.util.List<WikiStyle> getStyles()
           
 java.lang.String getTags(boolean open)
          Returns opening or closing tags corresponding to the given format(it depends on the given flag).
 int hashCode()
           
 boolean hasStyle(WikiStyle style)
           
 WikiFormat removeStyle(WikiStyle style)
          Creates a new style set which does not contain the specified style.
 WikiFormat setParameters(java.util.Collection<WikiParameter> params)
           
 WikiFormat switchStyle(WikiStyle wikiStyle)
          Creates a new format object where the specified style is switched: if this format contains the given style then the resulting format does not and vice versa.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static WikiFormat EMPTY
Constructor Detail

WikiFormat

public WikiFormat()

WikiFormat

public WikiFormat(java.util.Set<WikiStyle> styles)
Parameters:
styles -

WikiFormat

public WikiFormat(java.util.Set<WikiStyle> styles,
                  java.util.Collection<WikiParameter> params)

WikiFormat

public WikiFormat(java.util.Collection<WikiParameter> params)

WikiFormat

public WikiFormat(WikiStyle style)
Parameters:
style -

WikiFormat

public WikiFormat(WikiStyle style,
                  java.util.Collection<WikiParameter> params)

WikiFormat

public WikiFormat(WikiStyle[] styles)
Parameters:
styles -
Method Detail

setParameters

public WikiFormat setParameters(java.util.Collection<WikiParameter> params)

addStyle

public WikiFormat addStyle(WikiStyle style)
Creates a new style set and adds the given style to it.

Parameters:
style - the style to add
Returns:
a new copy of the style set containing the given style

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getClone

protected WikiFormat getClone()
Returns:
a new clone of this format object

getTags

public java.lang.String getTags(boolean open)
Returns opening or closing tags corresponding to the given format(it depends on the given flag).

Parameters:
open - if this flag is true then this method returns opening tags for this format
Returns:
opening or closing tags corresponding to the given format(it depends on the given flag)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

hasStyle

public boolean hasStyle(WikiStyle style)
Parameters:
style - the style to check
Returns:
true if this format has the specified style

removeStyle

public WikiFormat removeStyle(WikiStyle style)
Creates a new style set which does not contain the specified style.

Parameters:
style - the style to add
Returns:
a new copy of the style set containing the given style

switchStyle

public WikiFormat switchStyle(WikiStyle wikiStyle)
Creates a new format object where the specified style is switched: if this format contains the given style then the resulting format does not and vice versa.

Parameters:
wikiStyle - the style to switch
Returns:
a format object where the given style is inverted relatively to this format

getStyles

public java.util.List<WikiStyle> getStyles()
Returns:
the list of styles in the order in which they were created

getParams

public java.util.List<WikiParameter> getParams()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2005-2010. All Rights Reserved.