public class MetaserverModel
extends java.lang.Object
Constructor and Description |
---|
MetaserverModel() |
Modifier and Type | Method and Description |
---|---|
void |
addMetaserverEntry(@NotNull MetaserverEntry metaserverEntry)
Adds an entry.
|
void |
addMetaserverEntryListener(int index,
@NotNull MetaserverEntryListener listener)
Adds a metaserver entry listener for one entry.
|
void |
addMetaserverListener(@NotNull MetaserverListener listener)
Adds a metaserver listener.
|
void |
begin()
Starts an update transaction.
|
void |
commit()
Finishes an update transaction.
|
@Nullable MetaserverEntry |
getEntry(int index)
Returns a metaserver entry by index.
|
int |
getServerIndex(@NotNull java.lang.String serverName)
Returns the index of an entry by server name.
|
void |
removeMetaserverEntryListener(int index,
@NotNull MetaserverEntryListener listener)
Removes a metaserver entry listener for one entry.
|
void |
removeMetaserverListener(@NotNull MetaserverListener listener)
Removes a metaserver listener.
|
int |
size()
Returns the number of metaserver entries.
|
@Nullable public @Nullable MetaserverEntry getEntry(int index)
index
- the indexnull
if the index is invalidpublic int getServerIndex(@NotNull @NotNull java.lang.String serverName)
serverName
- the server name-1
if not foundpublic int size()
public void addMetaserverEntry(@NotNull @NotNull MetaserverEntry metaserverEntry)
metaserverEntry
- the entry to addpublic void begin()
public void commit()
public void addMetaserverListener(@NotNull @NotNull MetaserverListener listener)
listener
- the listener to addpublic void removeMetaserverListener(@NotNull @NotNull MetaserverListener listener)
listener
- the listener to removepublic void addMetaserverEntryListener(int index, @NotNull @NotNull MetaserverEntryListener listener)
index
- the entry index to monitorlistener
- the listener to addpublic void removeMetaserverEntryListener(int index, @NotNull @NotNull MetaserverEntryListener listener)
index
- the entry index to monitorlistener
- the listener to remove