1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany
|
---|
2 | //
|
---|
3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
---|
4 | // you may not use this file except in compliance with the License.
|
---|
5 | // You may obtain a copy of the License at
|
---|
6 | //
|
---|
7 | // http://www.apache.org/licenses/LICENSE-2.0
|
---|
8 | //
|
---|
9 | // Unless required by applicable law or agreed to in writing, software
|
---|
10 | // distributed under the License is distributed on an "AS IS" BASIS,
|
---|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
12 | // See the License for the specific language governing permissions and
|
---|
13 | // limitations under the License.
|
---|
14 |
|
---|
15 | package de.ugoe.cs.autoquest.usageprofiles;
|
---|
16 |
|
---|
17 | import java.util.List;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * <p>
|
---|
21 | * This interface defines basic functions for classes that implement a memory about the recent
|
---|
22 | * events of a sequences.
|
---|
23 | * </p>
|
---|
24 | *
|
---|
25 | * @author Steffen Herbold
|
---|
26 | * @version 1.0
|
---|
27 | *
|
---|
28 | * @param <T>
|
---|
29 | * Type of the sequence elements that are memorized.
|
---|
30 | */
|
---|
31 | public interface IMemory<T> {
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Adds an element to the end of the memory.
|
---|
35 | *
|
---|
36 | * @param element
|
---|
37 | * Element to be added.
|
---|
38 | */
|
---|
39 | public void add(T element);
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * <p>
|
---|
43 | * Returns the last <code>num</code> memorized elements. If the history is shorter than
|
---|
44 | * <code>num</code>, the length of the returned {@link java.util.List} may be less than
|
---|
45 | * <code>num</code>.
|
---|
46 | * </p>
|
---|
47 | *
|
---|
48 | * @param num
|
---|
49 | * Number of states from the end of the memory to be returned.
|
---|
50 | * @return {@link java.util.List} of memorized elements.
|
---|
51 | */
|
---|
52 | public List<T> getLast(int num);
|
---|
53 |
|
---|
54 | }
|
---|