1 16 17 package org.apache.jetspeed.portal; 18 19 25 public class BasePortletSetConstraints extends java.util.HashMap 26 implements PortletSet.Constraints 27 { 28 32 public Integer getColumn() 33 { 34 Object column = get("column"); 35 if (column instanceof String ) 36 { 37 try 38 { 39 column = new Integer (Integer.parseInt((String )column)); 40 put("column", column); 41 } 42 catch (Exception e) 43 { 44 remove("column"); 45 column=null; 46 } 47 } 48 return (Integer )column; 49 } 50 51 56 public void setColumn(Integer col) throws IllegalArgumentException 57 { 58 if (col.intValue() < 0) 59 { 60 throw new IllegalArgumentException ("Column coordinate must be positive"); 61 } 62 63 put("column",col); 64 } 65 66 70 public Integer getRow() 71 { 72 Object row = get("row"); 73 if (row instanceof String ) 74 { 75 try 76 { 77 row = new Integer (Integer.parseInt((String )row)); 78 put("row", row); 79 } 80 catch (Exception e) 81 { 82 remove("row"); 83 row = null; 84 } 85 } 86 return (Integer )row; 87 } 88 89 94 public void setRow(Integer row) throws IllegalArgumentException 95 { 96 if (row.intValue() < 0) 97 { 98 throw new IllegalArgumentException ("Row coordinate must be positive"); 99 } 100 101 put("row",row); 102 } 103 } 104 | Popular Tags |