jtulach@1334: /* jtulach@1334: * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. jtulach@1334: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jtulach@1334: * jtulach@1334: * This code is free software; you can redistribute it and/or modify it jtulach@1334: * under the terms of the GNU General Public License version 2 only, as jtulach@1334: * published by the Free Software Foundation. Oracle designates this jtulach@1334: * particular file as subject to the "Classpath" exception as provided jtulach@1334: * by Oracle in the LICENSE file that accompanied this code. jtulach@1334: * jtulach@1334: * This code is distributed in the hope that it will be useful, but WITHOUT jtulach@1334: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jtulach@1334: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jtulach@1334: * version 2 for more details (a copy is included in the LICENSE file that jtulach@1334: * accompanied this code). jtulach@1334: * jtulach@1334: * You should have received a copy of the GNU General Public License version jtulach@1334: * 2 along with this work; if not, write to the Free Software Foundation, jtulach@1334: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jtulach@1334: * jtulach@1334: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jtulach@1334: * or visit www.oracle.com if you need additional information or have any jtulach@1334: * questions. jtulach@1334: */ jtulach@1334: jtulach@1334: package java.text; jtulach@1334: jtulach@1334: /** jtulach@1334: * DontCareFieldPosition defines no-op FieldDelegate. Its jtulach@1334: * singleton is used for the format methods that don't take a jtulach@1334: * FieldPosition. jtulach@1334: */ jtulach@1334: class DontCareFieldPosition extends FieldPosition { jtulach@1334: // The singleton of DontCareFieldPosition. jtulach@1334: static final FieldPosition INSTANCE = new DontCareFieldPosition(); jtulach@1334: jtulach@1334: private final Format.FieldDelegate noDelegate = new Format.FieldDelegate() { jtulach@1334: public void formatted(Format.Field attr, Object value, int start, jtulach@1334: int end, StringBuffer buffer) { jtulach@1334: } jtulach@1334: public void formatted(int fieldID, Format.Field attr, Object value, jtulach@1334: int start, int end, StringBuffer buffer) { jtulach@1334: } jtulach@1334: }; jtulach@1334: jtulach@1334: private DontCareFieldPosition() { jtulach@1334: super(0); jtulach@1334: } jtulach@1334: jtulach@1334: Format.FieldDelegate getFieldDelegate() { jtulach@1334: return noDelegate; jtulach@1334: } jtulach@1334: }