1 package org.catacomb.interlish.content; 2 3 import org.catacomb.datalish.SColor; 4 5 6 public class ConnectionFlavor { 7 8 private String flavor; 9 10 private SColor scolor; 11 12 13 14 public ConnectionFlavor(String cf) { 15 flavor = cf; 16 scolor = new SColor("#0000ff"); 17 } 18 19 public String toString() { 20 return " cf[f=" + flavor + ", c=" + scolor + "]"; 21 } 22 23 24 public int hashCode() { 25 return flavor.hashCode(); 26 } 27 28 public boolean equals(Object cf) { 29 boolean ret = false; 30 if (cf instanceof ConnectionFlavor) { 31 String cff = ((ConnectionFlavor)cf).getFlavor(); 32 ret = flavor.equals(cff); 33 } 34 return ret; 35 } 36 37 38 public void setColor(SColor sc) { 39 scolor = sc; 40 } 41 42 public SColor getColor() { 43 return scolor; 44 } 45 46 public String getFlavor() { 47 return flavor; 48 } 49 50 51 public boolean matches(ConnectionFlavor cf) { 52 return flavor.equals(cf.getFlavor()); 53 } 54 55 }