Gridarta Editor
Index.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.model.index;
21 
22 import java.io.IOException;
23 import java.io.ObjectInputStream;
24 import java.io.ObjectOutputStream;
25 import java.util.Collection;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
28 
41 public interface Index<V> {
42 
47  int size();
48 
54  @NotNull
55  Collection<V> findPartialName(@NotNull String name);
56 
61  void beginUpdate();
62 
69  void endUpdate();
70 
78  void add(@NotNull V value, long timestamp);
79 
85  void remove(@NotNull V value);
86 
91  void setPending(@NotNull V value);
92 
99  void setName(@NotNull V value, long timestamp, @NotNull String name);
100 
107  @Nullable
108  String getName(@NotNull V value);
109 
114  @Nullable
115  V removePending();
116 
121  boolean hasPending();
122 
127  boolean isModified();
128 
133  void addIndexListener(@NotNull IndexListener<V> listener);
134 
139  void removeIndexListener(@NotNull IndexListener<V> listener);
140 
147  void save(@NotNull ObjectOutputStream objectOutputStream) throws IOException;
148 
155  void load(@NotNull ObjectInputStream objectInputStream) throws IOException;
156 
160  void clear();
161 
165  void indexingFinished();
166 
167 }
net.sf.gridarta.model.index.Index.endUpdate
void endUpdate()
net.sf.gridarta.model.index.Index.removePending
V removePending()
net.sf.gridarta.model.index.Index.removeIndexListener
void removeIndexListener(@NotNull IndexListener< V > listener)
net.sf.gridarta.model.index.Index.clear
void clear()
net.sf.gridarta.model.index.Index.size
int size()
net.sf.gridarta.model.index.Index.add
void add(@NotNull V value, long timestamp)
net.sf.gridarta.model.index.Index.setName
void setName(@NotNull V value, long timestamp, @NotNull String name)
net.sf.gridarta.model.index.IndexListener
Definition: IndexListener.java:30
net.sf.gridarta.model.index.Index.addIndexListener
void addIndexListener(@NotNull IndexListener< V > listener)
net.sf.gridarta.model.index.Index.findPartialName
Collection< V > findPartialName(@NotNull String name)
net.sf.gridarta.model.index.Index.hasPending
boolean hasPending()
net.sf.gridarta.model.index.Index.indexingFinished
void indexingFinished()
name
name
Definition: ArchetypeTypeSetParserTest-ignoreDefaultAttribute1-result.txt:2
net.sf.gridarta.model.index.Index.getName
String getName(@NotNull V value)
net.sf.gridarta.model.index.Index
Definition: Index.java:41
net.sf.gridarta.model.index.Index.save
void save(@NotNull ObjectOutputStream objectOutputStream)
net.sf.gridarta.model.index.Index.beginUpdate
void beginUpdate()
net.sf.gridarta.model.index.Index.setPending
void setPending(@NotNull V value)
net.sf.gridarta.model.index.Index.load
void load(@NotNull ObjectInputStream objectInputStream)
net.sf.gridarta.model.index.Index.isModified
boolean isModified()