public class CharacterModel
extends java.lang.Object
Constructor and Description |
---|
CharacterModel() |
Modifier and Type | Method and Description |
---|---|
void |
add(@NotNull CharacterInformation characterInformation)
Adds an entry.
|
void |
addCharacterInformationListener(int index,
@NotNull CharacterInformationListener listener)
Adds a character entry listener for one entry.
|
void |
addCharacterListener(@NotNull CharacterListener listener)
Adds a character listener.
|
void |
begin()
Starts an update transaction.
|
void |
commit()
Finishes an update transaction.
|
boolean |
displaysFace(int faceNum)
Returns whether any character has the given face.
|
int |
getCharacterIndex(@NotNull java.lang.String characterName)
Returns the index of an entry by character name.
|
@Nullable CharacterInformation |
getEntry(int index)
Returns a character entry by index.
|
void |
removeCharacterInformationListener(int index,
@NotNull CharacterInformationListener listener)
Removes a character entry listener for one entry.
|
void |
removeCharacterListener(@NotNull CharacterListener listener)
Removes a character listener.
|
int |
size()
Returns the number of character entries.
|
@Nullable public @Nullable CharacterInformation getEntry(int index)
index
- the indexnull
if the index is invalidpublic int getCharacterIndex(@NotNull @NotNull java.lang.String characterName)
characterName
- the character name-1
if not foundpublic int size()
public void add(@NotNull @NotNull CharacterInformation characterInformation)
characterInformation
- the entry to addpublic void begin()
public void commit()
public void addCharacterListener(@NotNull @NotNull CharacterListener listener)
listener
- the listener to addpublic void removeCharacterListener(@NotNull @NotNull CharacterListener listener)
listener
- the listener to removepublic void addCharacterInformationListener(int index, @NotNull @NotNull CharacterInformationListener listener)
index
- the entry index to monitorlistener
- the listener to addpublic void removeCharacterInformationListener(int index, @NotNull @NotNull CharacterInformationListener listener)
index
- the entry index to monitorlistener
- the listener to removepublic boolean displaysFace(int faceNum)
faceNum
- the face