Class CharacterModel
- java.lang.Object
-
- com.realtime.crossfire.jxclient.account.CharacterModel
-
public class CharacterModel extends java.lang.ObjectMaintains the character list for an account. Only meaningful if the server supports the new "loginmethod".
-
-
Constructor Summary
Constructors Constructor Description CharacterModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(@NotNull CharacterInformation characterInformation)Adds an entry.voidaddCharacterInformationListener(int index, @NotNull CharacterInformationListener listener)Adds a character entry listener for one entry.voidaddCharacterListener(@NotNull CharacterListener listener)Adds a character listener.voidbegin()Starts an update transaction.voidcommit()Finishes an update transaction.booleandisplaysFace(int faceNum)Returns whether any character has the given face.intgetCharacterIndex(@NotNull java.lang.String characterName)Returns the index of an entry by character name.@Nullable CharacterInformationgetEntry(int index)Returns a character entry by index.voidremoveCharacterInformationListener(int index, @NotNull CharacterInformationListener listener)Removes a character entry listener for one entry.voidremoveCharacterListener(@NotNull CharacterListener listener)Removes a character listener.intsize()Returns the number of character entries.
-
-
-
Method Detail
-
getEntry
@Nullable public @Nullable CharacterInformation getEntry(int index)
Returns a character entry by index.- Parameters:
index- the index- Returns:
- the character entry, or
nullif the index is invalid
-
getCharacterIndex
public int getCharacterIndex(@NotNull @NotNull java.lang.String characterName)Returns the index of an entry by character name.- Parameters:
characterName- the character name- Returns:
- the index, or
-1if not found
-
size
public int size()
Returns the number of character entries.- Returns:
- the number of character entries
-
add
public void add(@NotNull @NotNull CharacterInformation characterInformation)Adds an entry.- Parameters:
characterInformation- the entry to add
-
begin
public void begin()
Starts an update transaction.
-
commit
public void commit()
Finishes an update transaction.
-
addCharacterListener
public void addCharacterListener(@NotNull @NotNull CharacterListener listener)Adds a character listener.- Parameters:
listener- the listener to add
-
removeCharacterListener
public void removeCharacterListener(@NotNull @NotNull CharacterListener listener)Removes a character listener.- Parameters:
listener- the listener to remove
-
addCharacterInformationListener
public void addCharacterInformationListener(int index, @NotNull @NotNull CharacterInformationListener listener)Adds a character entry listener for one entry.- Parameters:
index- the entry index to monitorlistener- the listener to add
-
removeCharacterInformationListener
public void removeCharacterInformationListener(int index, @NotNull @NotNull CharacterInformationListener listener)Removes a character entry listener for one entry.- Parameters:
index- the entry index to monitorlistener- the listener to remove
-
displaysFace
public boolean displaysFace(int faceNum)
Returns whether any character has the given face.- Parameters:
faceNum- the face- Returns:
- whether the face was found
-
-