001/**
002 * Copyright 2010 The University of Southampton, Yahoo Inc., and the
003 * individual contributors. All rights reserved.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.openimaj.web.readability;
018
019/**
020 * Class to represent a simple HTML anchor tag.
021 * 
022 * @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
023 *
024 */
025public class Anchor {
026        String text;
027        String href;
028        
029        /** 
030         * Default constructor with text and a href.
031         * @param text
032         * @param href
033         */
034        public Anchor(String text, String href) {
035                this.text = text;
036                this.href = href;
037        }
038        
039        /**
040         * @return The anchor text
041         */
042        public String getText() {
043                return text;
044        }
045        
046        /**
047         * Set the anchor text
048         * @param anchorText The text to set 
049         */
050        public void setAnchorText(String anchorText) {
051                this.text = anchorText;
052        }
053        
054        /**
055         * @return The href
056         */
057        public String getHref() {
058                return href;
059        }
060        
061        /**
062         * Set the href
063         * @param href the href to set
064         */
065        public void setHref(String href) {
066                this.href = href;
067        }
068        
069        @Override
070        public String toString() {
071                return "(text: \""+ text+"\", url:\""+ href + "\")";
072        }
073}