1 package org.jetbrains.plugins.ipnb.format.cells;
3 import com.intellij.openapi.util.text.StringUtil;
4 import org.jetbrains.annotations.NotNull;
9 public abstract class IpnbEditableCell implements IpnbCell {
10 @NotNull private List<String> mySource;
11 @NotNull final Map<String, Object> myMetadata;
13 IpnbEditableCell(@NotNull final List<String> source, @NotNull Map<String, Object> metadata) {
15 myMetadata = metadata;
19 public List<String> getSource() {
23 public void setSource(@NotNull final List<String> source) {
28 public String getSourceAsString() {
29 return StringUtil.join(mySource, "");
33 public Map<String, Object> getMetadata() {
38 public boolean equals(Object o) {
39 if (this == o) return true;
40 if (o == null || getClass() != o.getClass()) return false;
42 IpnbEditableCell cell = (IpnbEditableCell)o;
44 if (!mySource.equals(cell.mySource)) return false;
45 if (!myMetadata.equals(cell.myMetadata)) return false;
51 public int hashCode() {
52 int result = mySource.hashCode();
53 result = 31 * result + myMetadata.hashCode();