1 | package org.sophie2.main.app.commons.element; |
---|
2 | |
---|
3 | import java.util.Map; |
---|
4 | |
---|
5 | import javax.swing.text.Element; |
---|
6 | |
---|
7 | import org.sophie2.base.model.text.HotAttr; |
---|
8 | |
---|
9 | /** |
---|
10 | * Holds style information for a text {@link Element}. |
---|
11 | */ |
---|
12 | public class ElementEntry { |
---|
13 | /** |
---|
14 | * The length (in chars) of the {@link Element}. |
---|
15 | */ |
---|
16 | private int length; |
---|
17 | /** |
---|
18 | * The style attributes for this element. |
---|
19 | */ |
---|
20 | private Map<HotAttr<?>, Object> attributes; |
---|
21 | |
---|
22 | /** |
---|
23 | * The default constructor |
---|
24 | * @param length |
---|
25 | * The length |
---|
26 | * @param attributes |
---|
27 | * The attributes of the elementEntry. |
---|
28 | */ |
---|
29 | public ElementEntry(int length, Map<HotAttr<?>, Object> attributes) { |
---|
30 | this.length = length; |
---|
31 | this.attributes = attributes; |
---|
32 | } |
---|
33 | |
---|
34 | /** |
---|
35 | * Getter for the length. |
---|
36 | * @return the length. |
---|
37 | */ |
---|
38 | public int getLength() { |
---|
39 | return this.length; |
---|
40 | } |
---|
41 | |
---|
42 | /** |
---|
43 | * Getter for the attributes of the ElementEntry object. |
---|
44 | * @return the attributes. |
---|
45 | */ |
---|
46 | public Map<HotAttr<?>, Object> getAttributes() { |
---|
47 | return this.attributes; |
---|
48 | } |
---|
49 | |
---|
50 | } |
---|