Summary.java revision 1469
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** A document summary dynamically generated to match a query. */
public class Summary {
/** A fragment of text within a summary. */
public static class Fragment {
/** Constructs a fragment for the given text.
* @param text text for this fragment
*/
/** Get the text of this fragment.
* @return the text of this fragment */
/** Check whether this fragment is to be highlighted.
* @return {@code true} if highlighting is enabled */
@SuppressWarnings("static-method")
public boolean isHighlight() { return false; }
/** Check, whether this fragment is an ellipsis.
* @return {@code true} if this is an ellipsis */
@SuppressWarnings("static-method")
public boolean isEllipsis() { return false; }
/** Get an HTML representation of this fragment.
* @return the htmlized text of this fragment */
}
/** A highlighted fragment of text within a summary. */
/** Constructs a highlighted fragment for the given text.
* @param text text for this fragment
*/
/**
* {@inheritDoc}
*/
public boolean isHighlight() { return true; }
/**
* {@inheritDoc}
*/
}
/** An ellipsis fragment within a summary. */
/** Constructs an ellipsis fragment for the given text. */
public Ellipsis() { super(" ... "); }
/**
* {@inheritDoc}
*/
public boolean isEllipsis() { return true; }
/**
* {@inheritDoc}
*/
}
/** Adds a fragment to a summary.
* @param fragment fragment ot add */
/** Get an array of all of this summary's fragments.
* @return a possible empty array */
public Fragment[] getFragments() {
}
/** Get concatenation of all HTMLized fragments of this instance. */
}
}
}