de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive


Class ArchiveEntryImpl

de.tuberlin.cs.flp.jspwiki.util.PropertiesOrdered
    inheritjava.util.Properties
        inheritde.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveEntryImpl
All known Subclassifier:
ArchiveEntryBibTeX , ArchiveEntryPlaintext

All known implemented Interfaces:
ArchiveEntry


public class ArchiveEntryImpl
Namespace: wikiarchive


Default implementation of an ArchiveEntry. Extends a HashMap to allow storage of individual key/value-fields as entry content.
Authors:
Jens Gulden
Version:
0.2.0


Attribute Summary
protected String  name
 
protected String  plaintext
 
private static long  serialVersionUID
 
protected String  text
 

Constructor Summary
public   ArchiveEntryImpl()
Creates a new instance of ArchiveEntryImpl.  
public   ArchiveEntryImpl(String name, Map m)
Creates a new instance of ArchiveEntryImpl.  
public   ArchiveEntryImpl(String name)
Creates a new instance of ArchiveEntryImpl.  

Method Summary
public int  compareTo(Object o)
Compares the name This can be used for implenting a Comparator and using it to sort a list of entry names. The comparison is performed case-insensitive.  
protected boolean  equalEntry(String key, String val1, String val2)
 
public boolean  equals(Object o)
Tests for equality of the whole entry. Unlike compareTo(), this compares all key/value-fields, too, not only the entry name.  
public Map   getMap()
 
public String   getName()
Returns the name of the entry.  
public String   getPlainText()
 
public String   getText()
 
public String   getValue(String key)
Gets a field's value.  
public boolean  isOptional()
May be overwritten by subclass.  
public void  setName(String name)
 
public void  setPlainText(String text)
 
public void  setText(String text)
 
public String   toString()
May be overwritten by subclass.  

Tagged Values
static false
documentation#author Jens Gulden
documentation#version 0.2.0

Attribute Detail

name

protected String name

Multiplicity: 1..1
Ordering: unspecified



plaintext

protected String plaintext

Multiplicity: 1..1
Ordering: unspecified



serialVersionUID

private static final long serialVersionUID

Multiplicity: 1..1
Ordering: unspecified



text

protected String text

Multiplicity: 1..1
Ordering: unspecified

Constructor Detail

ArchiveEntryImpl

public de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveEntryImpl ArchiveEntryImpl()

Has stereotypes: << create >>

Creates a new instance of ArchiveEntryImpl.
Returns:


ArchiveEntryImpl

public de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveEntryImpl ArchiveEntryImpl(String name, Map m)

Has stereotypes: << create >>

Creates a new instance of ArchiveEntryImpl.
Parameters:
name -
m - Map with default key/value-fields.
Returns:


ArchiveEntryImpl

public de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveEntryImpl ArchiveEntryImpl(String name)

Has stereotypes: << create >>

Creates a new instance of ArchiveEntryImpl.
Parameters:
name - The name of the entry.
Returns:
Method Detail

compareTo

public int compareTo(Object o)


Compares the name This can be used for implenting a Comparator and using it to sort a list of entry names. The comparison is performed case-insensitive.
Parameters:
o - An instance of ArchiveEntry to compare with based on the name.
Returns:
A value <0 if this entrie's name is to be sorted before the other entry,
0 if the names are equal,
a value >0 if this entrie's name is to be sorted behind the other entry.


equalEntry

protected boolean equalEntry(String key, String val1, String val2)

Parameters:
key -
val1 -
val2 -
Returns:


equals

public boolean equals(Object o)


Tests for equality of the whole entry. Unlike compareTo(), this compares all key/value-fields, too, not only the entry name.
Parameters:
o - Another instance of ArchiveEntryImpl to test for equality with.
Returns:
true if the entries and all their fields are equal, false otherwise.


getMap

public Map getMap()

Returns:


getName

public String getName()


Returns the name of the entry.
Returns:
The name.


getPlainText

public String getPlainText()

Returns:


getText

public String getText()

Returns:


getValue

public String getValue(String key)


Gets a field's value.
Parameters:
key - The field key.
Returns:
The value, or an empty string if the value as not been set. Never returns null.


isOptional

public boolean isOptional()


May be overwritten by subclass.
Returns:


setName

public void setName(String name)

Parameters:
name -


setPlainText

public void setPlainText(String text)

Parameters:
text -


setText

public void setText(String text)

Parameters:
text -


toString

public String toString()


May be overwritten by subclass.
Returns:

previous   TOC   next

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in the USA and other countries. Copyright 2003-2006 Gentleware AG, Ludwigstr. 12, 20357 Hamburg, Germany. All Rights Reserved.
UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.