jpos.config.simple.editor
Class JposEntryList

java.lang.Object
  |
  +--jpos.config.simple.editor.JposEntryList

class JposEntryList
extends java.lang.Object

Simple bean list class for JposEntry objects. Allows listeners to know when JposEntry objects are added and removed to the list.

Since:
0.1 (Philly 99 meeting)
Author:
E. Michael Maximilien (maxim@us.ibm.com)

Constructor Summary
JposEntryList()
          Default no-arg ctor
JposEntryList(java.lang.String fileName)
          1-arg ctor
 
Method Summary
 void add(java.lang.String logicalName, JposEntry entry)
          Adds a new entry with logicalName in the list
 void addJposEntryListListener(JposEntryListListener l)
          Adds new listener for this JposEntryList NOTE: the listener name should change to JposEntryListListener insteand of JposEntryTreeListener
 void change(java.lang.String logicalName, JposEntry entry)
          Change/replace the entry with logicalName with this one
 java.util.Enumeration getEntries()
           
 java.lang.String getEntriesFileName()
           
 java.util.Enumeration getRemovedEntries()
           
 boolean hasJposEntry(java.lang.String logicalName)
           
 boolean isEmpty()
           
 boolean isLoadedFromFile()
           
 void load(java.lang.String fileName)
          Loads the JposEntry from the serialized file specified
 void remove(java.lang.String logicalName)
          Removes the entry with logicalName from the list
 void removeJposEntryListListener(JposEntryListListener l)
          Removes new listener for this JposEntryList NOTE: the listener name should change to JposEntryListListener insteand of JposEntryTreeListener
 void save()
          Serializes the JposEntry objects in the entriesFileName
 void setEntriesFileName(java.lang.String fileName)
          Sets the serialization file name
 int size()
           
 void sort()
          sorts the list of entries
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JposEntryList

public JposEntryList()
Default no-arg ctor
Since:
0.1 (Philly 99 meeting)

JposEntryList

public JposEntryList(java.lang.String fileName)
              throws java.lang.Exception
1-arg ctor
Parameters:
fileName - the file name to load the JposEntry from
Throws:
java.lang.Exception - if something goes wrong loading the entries
Since:
0.1 (Philly 99 meeting)
Method Detail

addJposEntryListListener

public void addJposEntryListListener(JposEntryListListener l)
Adds new listener for this JposEntryList NOTE: the listener name should change to JposEntryListListener insteand of JposEntryTreeListener
Parameters:
l - the listener instance
Since:
0.1 (Philly 99 meeting)

removeJposEntryListListener

public void removeJposEntryListListener(JposEntryListListener l)
Removes new listener for this JposEntryList NOTE: the listener name should change to JposEntryListListener insteand of JposEntryTreeListener
Parameters:
l - the listener instance
Since:
0.1 (Philly 99 meeting)

getEntries

public java.util.Enumeration getEntries()
Returns:
an Enumeration of JposEntry objects
Since:
0.1 (Philly 99 meeting)

getRemovedEntries

public java.util.Enumeration getRemovedEntries()
Returns:
an Enumeration of JposEntry objects that were removed from the list
Since:
0.1 (Philly 99 meeting)

size

public int size()
Returns:
the current size of the list
Since:
0.1 (Philly 99 meeting)

getEntriesFileName

public java.lang.String getEntriesFileName()
Returns:
the serialization file name
Since:
0.1 (Philly 99 meeting)

setEntriesFileName

public void setEntriesFileName(java.lang.String fileName)
Sets the serialization file name
Since:
0.1 (Philly 99 meeting)

load

public void load(java.lang.String fileName)
          throws java.lang.Exception
Loads the JposEntry from the serialized file specified
Parameters:
fileName - the serialized file name
Throws:
java.lang.Exception - if something goes wrong loading this ser file
Since:
0.1 (Philly 99 meeting)

save

public void save()
          throws java.lang.Exception
Serializes the JposEntry objects in the entriesFileName
Throws:
java.lang.Exception - if something goes wrong saving this ser file
Since:
0.1 (Philly 99 meeting)

add

public void add(java.lang.String logicalName,
                JposEntry entry)
Adds a new entry with logicalName in the list
Parameters:
logicalName - the logicalName for this entry
entry - the JposEntry to add
Since:
0.1 (Philly 99 meeting)

remove

public void remove(java.lang.String logicalName)
Removes the entry with logicalName from the list
Parameters:
entry - the JposEntry to add
Since:
0.1 (Philly 99 meeting)

change

public void change(java.lang.String logicalName,
                   JposEntry entry)
Change/replace the entry with logicalName with this one
Parameters:
logicalName - the logicalName for this entry
entry - the JposEntry to replace
Since:
0.1 (Philly 99 meeting)

isLoadedFromFile

public boolean isLoadedFromFile()
Returns:
true if the entries are loaded from a file or not
Since:
0.1 (Philly 99 meeting)

hasJposEntry

public boolean hasJposEntry(java.lang.String logicalName)
Parameters:
logicalName - of the JposEntry to be searched
Returns:
true if the entry is in the list
Since:
1.3 (SF 2K meeting)

isEmpty

public boolean isEmpty()
Returns:
true if the list is empty
Since:
1.3 (SF 2K meeting)

sort

public void sort()
sorts the list of entries
Since:
1.3 (SF 2K meeting)


This API and code belongs to the JavaPOS committee please see LISCENCE file for details