public class ConfigDescriptionModel extends AbstractListModel
listenerList
Constructor and Description |
---|
ConfigDescriptionModel()
Creates a new, initially empty ConfigDescriptionModel.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ConfigDescriptionEntry entry)
Adds the given entry to the end of the list.
|
boolean |
contains(ConfigDescriptionEntry entry)
Checks whether the given entry is already contained in this list.
|
ConfigDescriptionEntry |
get(int pos)
Returns the entry stored on the given list position.
|
Object |
getElementAt(int index)
Returns the value at the specified index.
|
int |
getSize()
Returns the length of the list.
|
void |
importFromConfig(Configuration config)
Imports all entries from the given report configuration.
|
int |
indexOf(ConfigDescriptionEntry entry)
Returns the index of the given entry or -1, if the entry is not in the list.
|
void |
load(InputStream in)
Loads the entries from the given xml file.
|
void |
remove(ConfigDescriptionEntry entry)
Removes the given entry from the list.
|
void |
removeAll(int[] indices) |
void |
save(OutputStream out,
String encoding)
Saves the model into an xml file.
|
void |
sort()
Sorts the entries of the list.
|
ConfigDescriptionEntry[] |
toArray()
Returns the contents of this model as object array.
|
void |
updated()
Fires an contents changed event for all elements in the list.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
public ConfigDescriptionModel()
public void add(ConfigDescriptionEntry entry)
entry
- the new entry.public void remove(ConfigDescriptionEntry entry)
entry
- the entry that should be removed.public void removeAll(int[] indices)
public ConfigDescriptionEntry get(int pos)
pos
- the positionIndexOutOfBoundsException
- if the position is invalid.public void updated()
public int indexOf(ConfigDescriptionEntry entry)
entry
- the entry whose position should be searched.public boolean contains(ConfigDescriptionEntry entry)
entry
- the entry that should be checked.public void sort()
public ConfigDescriptionEntry[] toArray()
public int getSize()
public Object getElementAt(int index)
index
- the requested indexindex
public void importFromConfig(Configuration config)
config
- the report configuration from where to add the entries.public void load(InputStream in) throws IOException, SAXException, ParserConfigurationException
in
- the inputstream from where to read the fileIOException
- if an error occured while reading the fileSAXException
- if an XML parse error occurs.ParserConfigurationException
- if the XML parser could not be initialized.public void save(OutputStream out, String encoding) throws IOException
out
- the target output stream.encoding
- the encoding of the content.IOException
- if an error occurs.Copyright © 2017 Hitachi Vantara. All rights reserved.