Permalink
Browse files

creating first node wrappers

  • Loading branch information...
1 parent cf5302f commit 527a148a43b9c44f7fc1c5691b4af91a8ce6256a @pablopareja pablopareja committed Apr 25, 2012
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 "GRG"
+ *
+ * This file is part of GRG
+ *
+ * Bio4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+package org.grassius.grg.model.nodes;
+
+import com.era7.bioinfo.bioinfoneo4j.BasicEntity;
+import org.neo4j.graphdb.Node;
+
+/**
+ *
+ * @author Pablo Pareja Tobes <ppareja@era7.com>
+ */
+public class ChromosomeNode extends BasicEntity{
+
+ public static final String NODE_TYPE = ChromosomeNode.class.getCanonicalName();
+
+
+ public ChromosomeNode(Node n){
+ super(n);
+ }
+
+
+ @Override
+ public int hashCode(){
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof ChromosomeNode){
+ ChromosomeNode other = (ChromosomeNode) obj;
+ return this.node.equals(other.node);
+ }else{
+ return false;
+ }
+ }
+
+}
+
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2012 "GRG"
+ *
+ * This file is part of GRG
+ *
+ * Bio4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+package org.grassius.grg.model.nodes;
+
+import com.era7.bioinfo.bioinfoneo4j.BasicEntity;
+import org.neo4j.graphdb.Node;
+
+/**
+ *
+ * @author Pablo Pareja Tobes <ppareja@era7.com>
+ */
+public class GRGGeneNode extends BasicEntity{
+
+ public static final String NODE_TYPE = GRGGeneNode.class.getCanonicalName();
+
+ public static final String ID_PROPERTY = "id";
+ public static final String START_POSITION_PROPERTY = "start_position";
+ public static final String END_POSITION_PROPERTY = "end_position";
+
+
+ public GRGGeneNode(Node n){
+ super(n);
+ }
+
+
+ public String getId(){ return String.valueOf(node.getProperty(ID_PROPERTY));}
+ public int getStartPosition(){ return Integer.parseInt(String.valueOf(node.getProperty(START_POSITION_PROPERTY)));}
+ public int getEndPosition(){ return Integer.parseInt(String.valueOf(node.getProperty(END_POSITION_PROPERTY)));}
+
+
+ public void setId(String value){ node.setProperty(ID_PROPERTY, value);}
+ public void setStartPosition(int value){ node.setProperty(START_POSITION_PROPERTY, value);}
+ public void setEndPosition(int value){ node.setProperty(END_POSITION_PROPERTY, value);}
+
+
+ @Override
+ public int hashCode(){
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof GRGGeneNode){
+ GRGGeneNode other = (GRGGeneNode) obj;
+ return this.node.equals(other.node);
+ }else{
+ return false;
+ }
+ }
+
+}
+
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 "GRG"
+ *
+ * This file is part of GRG
+ *
+ * Bio4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+package org.grassius.grg.model.nodes;
+
+import com.era7.bioinfo.bioinfoneo4j.BasicEntity;
+import org.neo4j.graphdb.Node;
+
+/**
+ *
+ * @author Pablo Pareja Tobes <ppareja@era7.com>
+ */
+public class PromoterNode extends BasicEntity{
+
+ public static final String NODE_TYPE = PromoterNode.class.getCanonicalName();
+
+
+ public PromoterNode(Node n){
+ super(n);
+ }
+
+
+ @Override
+ public int hashCode(){
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof PromoterNode){
+ PromoterNode other = (PromoterNode) obj;
+ return this.node.equals(other.node);
+ }else{
+ return false;
+ }
+ }
+
+}
+

0 comments on commit 527a148

Please sign in to comment.